[clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-20-g8f97d3e

Philippe Brochard pbrochard at common-lisp.net
Wed Jan 18 21:59:08 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, master has been updated
       via  8f97d3ed7637d664ca02edd295bfd47035dc40a5 (commit)
      from  e80edf80fac89a72295f52b7ef6f1f144fed0c8c (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 8f97d3ed7637d664ca02edd295bfd47035dc40a5
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date:   Wed Jan 18 22:59:02 2012 +0100

    src/bindings-second-mode.lisp (set-default-second-keys): New key binding to set window and frame transparency. src/bindings.lisp (set-default-main-mouse): New mouse binding to set window and frame transparency.

diff --git a/ChangeLog b/ChangeLog
index cc340f8..4bdd870 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-01-18  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/bindings-second-mode.lisp (set-default-second-keys): New
+	key binding to set window and frame transparency.
+
+	* src/bindings.lisp (set-default-main-mouse): New mouse binding to
+	set window and frame transparency.
+
 	* src/clfswm-keys.lisp (define-keys): New macro to ease multiple
 	keys definitions. (Thanks Valentin Plechinger for the request).
 
diff --git a/src/bindings-second-mode.lisp b/src/bindings-second-mode.lisp
index f62a1fc..dd3eef9 100644
--- a/src/bindings-second-mode.lisp
+++ b/src/bindings-second-mode.lisp
@@ -181,7 +181,10 @@
   (define-second-key ("7" :mod-1) 'bind-or-jump 7)
   (define-second-key ("8" :mod-1) 'bind-or-jump 8)
   (define-second-key ("9" :mod-1) 'bind-or-jump 9)
-  (define-second-key ("0" :mod-1) 'bind-or-jump 10))
+  (define-second-key ("0" :mod-1) 'bind-or-jump 10)
+  ;;; Transparency
+  (define-second-key ("t" :control :shift) 'key-inc-transparency)
+  (define-second-key ("t" :control) 'key-dec-transparency))
 
 (add-hook *binding-hook* 'set-default-second-keys)
 
diff --git a/src/bindings.lisp b/src/bindings.lisp
index e8fe183..142d9f2 100644
--- a/src/bindings.lisp
+++ b/src/bindings.lisp
@@ -137,7 +137,11 @@
   (define-main-mouse (4) 'mouse-select-next-level)
   (define-main-mouse (5) 'mouse-select-previous-level)
   (define-main-mouse (4 :mod-1) 'mouse-enter-frame)
-  (define-main-mouse (5 :mod-1) 'mouse-leave-frame))
+  (define-main-mouse (5 :mod-1) 'mouse-leave-frame)
+  (define-main-mouse (4 :mod-1 :control) 'dec-transparency)
+  (define-main-mouse (5 :mod-1 :control) 'inc-transparency)
+  (define-main-mouse (4 :mod-1 :control :shift) 'dec-transparency-slow)
+  (define-main-mouse (5 :mod-1 :control :shift) 'inc-transparency-slow))
 
 (add-hook *binding-hook* 'set-default-main-mouse)
 
diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp
index 4317de3..029e445 100644
--- a/src/clfswm-util.lisp
+++ b/src/clfswm-util.lisp
@@ -1618,3 +1618,39 @@ For window: set current child to window or its parent according to window-parent
           (show-all-children t))
         (funcall run-fn))))
 
+;;; Transparency setting
+(defun inc-transparency (window root-x root-y)
+  "Increment the child under mouse transparency"
+  (declare (ignore root-x root-y))
+  (unless *in-second-mode* (stop-button-event))
+  (incf (child-transparency window) 0.1))
+
+(defun dec-transparency (window root-x root-y)
+  "Decrement the child under mouse transparency"
+  (declare (ignore root-x root-y))
+  (unless *in-second-mode* (stop-button-event))
+  (decf (child-transparency window) 0.1))
+
+(defun inc-transparency-slow (window root-x root-y)
+  "Increment slowly the child under mouse transparency"
+  (declare (ignore root-x root-y))
+  (unless *in-second-mode* (stop-button-event))
+  (incf (child-transparency window) 0.01))
+
+(defun dec-transparency-slow (window root-x root-y)
+  "Decrement slowly the child under mouse transparency"
+  (declare (ignore root-x root-y))
+  (unless *in-second-mode* (stop-button-event))
+  (decf (child-transparency window) 0.01))
+
+
+(defun key-inc-transparency ()
+  "Increment the current window transparency"
+  (with-current-window
+      (incf (child-transparency window) 0.1)))
+
+(defun key-dec-transparency ()
+  "Decrement the current window transparency"
+  (with-current-window
+      (decf (child-transparency window) 0.1)))
+
diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp
index bd566ee..7aeaf80 100644
--- a/src/xlib-util.lisp
+++ b/src/xlib-util.lisp
@@ -231,7 +231,9 @@ they should be windows. So use this function to make a window out of them."
     "Set the window transparency"
     (when (numberp value)
       (xlib:change-property window :_NET_WM_WINDOW_OPACITY
-                            (list (min (round (* opaque (if (equal *transparent-background* t) value 1))) opaque))
+                            (list (max (min (round (* opaque (if (equal *transparent-background* t) value 1)))
+                                            opaque)
+                                       0))
                             :cardinal 32)))
 
   (defsetf window-transparency set-window-transparency))

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

Summary of changes:
 ChangeLog                     |    6 ++++++
 src/bindings-second-mode.lisp |    5 ++++-
 src/bindings.lisp             |    6 +++++-
 src/clfswm-util.lisp          |   36 ++++++++++++++++++++++++++++++++++++
 src/xlib-util.lisp            |    4 +++-
 5 files changed, 54 insertions(+), 3 deletions(-)


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




More information about the clfswm-cvs mailing list