[clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch test updated. R-1106-61-g76075c2

Philippe Brochard pbrochard at common-lisp.net
Thu Jun 7 21:49:06 UTC 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager".

The branch, test has been updated
       via  76075c217d62ae600da3460ef62687966d6e3fbc (commit)
      from  7057baaaf3e5dc4372b8385534b540a12edbadcd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 76075c217d62ae600da3460ef62687966d6e3fbc
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date:   Thu Jun 7 23:49:01 2012 +0200

    (define-toolbar-hooks): Add auto-hide toolbar (show/hide on mouse motion event).

diff --git a/ChangeLog b/ChangeLog
index acaf844..e0ffc64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 	* contrib/toolbar.lisp (define-toolbar-hooks): Add auto-hide
 	clickable toolbar.
+	(define-toolbar-hooks): Add auto-hide toolbar (show/hide on mouse
+	motion event).
 
 2012-06-06  Philippe Brochard  <pbrochard at common-lisp.net>
 
diff --git a/contrib/toolbar.lisp b/contrib/toolbar.lisp
index 9df8750..1e6552e 100644
--- a/contrib/toolbar.lisp
+++ b/contrib/toolbar.lisp
@@ -146,6 +146,8 @@
 
 (use-event-hook :exposure)
 (use-event-hook :button-press)
+(use-event-hook :motion-notify)
+(use-event-hook :leave-notify)
 
 
 (defun toolbar-add-exposure-hook (toolbar)
@@ -170,10 +172,27 @@
             (stop-button-event)
             (throw 'exit-handle-event nil)))))))
 
+(defun toolbar-add-hide-motion-hook (toolbar)
+  (define-event-hook :motion-notify (root-x root-y)
+    (unless (compress-motion-notify)
+      (when (toolbar-in-sensibility-zone-p toolbar root-x root-y)
+        (map-window (toolbar-window toolbar))
+        (raise-window (toolbar-window toolbar))
+        (refresh-toolbar toolbar)
+        (throw 'exit-handle-event nil)))))
+
+(defun toolbar-add-hide-leave-hook (toolbar)
+  (define-event-hook :leave-notify (window)
+    (when (xlib:window-equal (toolbar-window toolbar) window)
+      (hide-window window)
+      (throw 'exit-handle-event nil))))
+
 (defun define-toolbar-hooks (toolbar)
   (toolbar-add-exposure-hook toolbar)
   (case (toolbar-autohide toolbar)
-    (:click (toolbar-add-hide-button-press-hook toolbar))))
+    (:click (toolbar-add-hide-button-press-hook toolbar))
+    (:motion (toolbar-add-hide-motion-hook toolbar)
+             (toolbar-add-hide-leave-hook toolbar))))
 
 
 
@@ -222,7 +241,7 @@
                                                                  :border (when (plusp (toolbar-border-size toolbar))
                                                                            (get-color *toolbar-window-border*))
                                                                  :colormap (xlib:screen-default-colormap *screen*)
-                                                                 :event-mask '(:exposure :key-press))
+                                                                 :event-mask '(:exposure :key-press :leave-window))
                     (toolbar-gc toolbar) (xlib:create-gcontext :drawable (toolbar-window toolbar)
                                                                :foreground (get-color *toolbar-window-foreground*)
                                                                :background (get-color *toolbar-window-background*)
@@ -231,10 +250,11 @@
               (push (toolbar-window toolbar) windows-list)
               (setf (window-transparency (toolbar-window toolbar)) *toolbar-window-transparency*)
               (push (list #'is-toolbar-window-p nil) *never-managed-window-list*)
-              (unless (toolbar-autohide toolbar)
-                (map-window (toolbar-window toolbar))
-                (raise-window (toolbar-window toolbar))
-                (refresh-toolbar toolbar))
+              (map-window (toolbar-window toolbar))
+              (raise-window (toolbar-window toolbar))
+              (refresh-toolbar toolbar);)
+              (when (toolbar-autohide toolbar)
+                (hide-window (toolbar-window toolbar)))
               (xlib:display-finish-output *display*)
               (define-toolbar-hooks toolbar))))))))
 
@@ -250,7 +270,8 @@
     (close-toolbar toolbar)))
 
 
-(defun add-toolbar (root-x root-y direction size placement &rest modules)
+(defun add-toolbar (root-x root-y direction size placement modules
+                    &key (autohide *toolbar-default-autohide*))
   "Add a new toolbar.
      root-x, root-y: root coordinates
      direction: one of :horiz or :vert
@@ -259,7 +280,7 @@
                       :direction direction :size size
                       :thickness *toolbar-default-thickness*
                       :placement placement
-                      :autohide *toolbar-default-autohide*
+                      :autohide autohide
                       :refresh-delay *toolbar-default-refresh-delay*
                       :border-size *toolbar-default-border-size*
                       :modules modules)))
diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp
index 2606087..a3017d6 100644
--- a/src/clfswm-internal.lisp
+++ b/src/clfswm-internal.lisp
@@ -1488,7 +1488,8 @@ managed."
 	      (wm-state (window-state win)))
 	  (unless (or (eql (xlib:window-override-redirect win) :on)
 		      (eql win *no-focus-window*)
-                      (is-notify-window-p win))
+                      (is-notify-window-p win)
+                      (never-managed-window-p win))
 	    (when (or (eql map-state :viewable)
 		      (eql wm-state +iconic-state+))
 	      (format t "Processing ~S: type=~A ~S~%" (xlib:wm-name win) (window-type win) win)
diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp
index b77ad4c..a1731ad 100644
--- a/src/xlib-util.lisp
+++ b/src/xlib-util.lisp
@@ -36,6 +36,7 @@
 				:colormap-change
 				:focus-change
 				:enter-window
+                                :leave-window
 				:exposure)
   "The events to listen for on managed windows.")
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    2 ++
 contrib/toolbar.lisp     |   37 +++++++++++++++++++++++++++++--------
 src/clfswm-internal.lisp |    3 ++-
 src/xlib-util.lisp       |    1 +
 4 files changed, 34 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CLFSWM - A(nother) Common Lisp FullScreen Window Manager




More information about the clfswm-cvs mailing list