From 20cc263b1e16094b3d88c8bb3d2688ef71c5fffe Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sat, 28 Jun 2008 22:08:33 +0200 Subject: [PATCH] Compress motion events in event loop --- ChangeLog | 12 ++++++++++++ TODO | 4 ---- src/clfswm-info.lisp | 3 +-- src/config.lisp | 2 +- src/xlib-util.lisp | 18 ++++++++++-------- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 496763f..16d529e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-28 Philippe Brochard + + * src/xlib-util.lisp (move-window, resize-window): Compress motion + events. + + * src/clfswm.lisp (handle-motion-notify): Compress motion events. + + * src/clfswm-second-mode.lisp (sm-handle-motion-notify): Compress + motion events. + + * src/clfswm-info.lisp (info-mode): Compress motion events. + 2008-06-21 Philippe Brochard * src/clfswm-internal.lisp (show-all-children): Compute geometry diff --git a/TODO b/TODO index d484f19..ff9e5ad 100644 --- a/TODO +++ b/TODO @@ -7,10 +7,6 @@ URGENT PROBLEMS =============== Should handle these soon. -- Raise Order when tile space layout - -- Use conpressed motion events for clisp. [Philippe] - - Show config -> list and display documentation for all tweakable global variables. [Philippe] - A Gimp layout example (a main window and all others on the left) [Philippe] diff --git a/src/clfswm-info.lisp b/src/clfswm-info.lisp index 06c10ca..4016b62 100644 --- a/src/clfswm-info.lisp +++ b/src/clfswm-info.lisp @@ -212,8 +212,7 @@ (funcall-key-from-code *info-keys* code state info)) (handle-motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (unless (xlib:event-case (*display* :discard-p nil :peek-p t :timeout 0) - (:motion-notify () t)) + (unless (compress-motion-notify) (funcall-button-from-code *info-mouse* 'motion 0 window root-x root-y *fun-press* (list info)))) (handle-button-press (&rest event-slots &key window root-x root-y code state &allow-other-keys) (declare (ignore event-slots)) diff --git a/src/config.lisp b/src/config.lisp index 54ca0b9..19d0309 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -32,7 +32,7 @@ ;;; CONFIG - Compress motion notify ? -(defparameter *have-to-compress-notify* nil +(defparameter *have-to-compress-notify* t "This variable may be useful to speed up some slow version of CLX. It is particulary useful with CLISP/MIT-CLX.") diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp index b50da66..eb53062 100644 --- a/src/xlib-util.lisp +++ b/src/xlib-util.lisp @@ -490,10 +490,11 @@ Corner is one of :bottom-right :bottom-left :top-right :top-left" (pointer-grabbed-p (xgrab-pointer-p))) (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (setf (xlib:drawable-x window) (+ root-x dx) - (xlib:drawable-y window) (+ root-y dy)) - (when additional-fn - (apply additional-fn additional-arg))) + (unless (compress-motion-notify) + (setf (xlib:drawable-x window) (+ root-x dx) + (xlib:drawable-y window) (+ root-y dy)) + (when additional-fn + (apply additional-fn additional-arg)))) (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) @@ -532,10 +533,11 @@ Corner is one of :bottom-right :bottom-left :top-right :top-left" (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) most-positive-fixnum))) (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x orig-x)) 10 min-width) max-width) - (xlib:drawable-height window) (min (max (+ orig-height (- root-y orig-y)) 10 min-height) max-height)) - (when additional-fn - (apply additional-fn additional-arg))) + (unless (compress-motion-notify) + (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x orig-x)) 10 min-width) max-width) + (xlib:drawable-height window) (min (max (+ orig-height (- root-y orig-y)) 10 min-height) max-height)) + (when additional-fn + (apply additional-fn additional-arg)))) (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) -- 2.11.4.GIT