[clfswm-cvs] r255 - in clfswm: . src

Philippe Brochard pbrochard at common-lisp.net
Sat Nov 7 21:33:21 UTC 2009


Author: pbrochard
Date: Sat Nov  7 16:33:20 2009
New Revision: 255

Log:
Simplification of Escape key to close/kill/remove the focus window and unhide all windows.

Modified:
   clfswm/ChangeLog
   clfswm/src/bindings-second-mode.lisp
   clfswm/src/bindings.lisp
   clfswm/src/clfswm-corner.lisp
   clfswm/src/clfswm-util.lisp
   clfswm/src/clfswm.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sat Nov  7 16:33:20 2009
@@ -1,3 +1,16 @@
+2009-11-07  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/bindings-second-mode.lisp (set-default-second-keys):
+	Simplification of Escape key to close/kill/remove the focus window
+	and unhide all windows.
+
+	* src/bindings.lisp (set-default-main-keys): Simplification of
+	Escape key to close/kill/remove the focus window and unhide all
+	windows.
+
+	* src/clfswm-util.lisp (ask-close/kill-current-window): Add remove
+	focus and unhide all windows capabilities.
+
 2009-10-10  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* contrib/mpd.lisp (start-gmpc): Add gmpc in the mpd menu.

Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp	(original)
+++ clfswm/src/bindings-second-mode.lisp	Sat Nov  7 16:33:20 2009
@@ -119,10 +119,7 @@
   (define-second-key (#\o :control) 'set-open-in-new-frame-in-root-frame-nw-hook)
   (define-second-key (#\a) 'add-default-frame)
   ;; Escape
-  (define-second-key ("Escape" :control :shift) 'delete-focus-window)
-  (define-second-key ("Escape" :mod-1 :control :shift) 'destroy-focus-window)
-  (define-second-key ("Escape" :control) 'remove-focus-window)
-  (define-second-key ("Escape" :shift) 'unhide-all-windows-in-current-child)
+  (define-second-key ("Escape" :control) 'ask-close/kill-current-window)
   ;; Selection
   (define-second-key ("x" :control) 'cut-current-child)
   (define-second-key ("x" :control :mod-1) 'clear-selection)

Modified: clfswm/src/bindings.lisp
==============================================================================
--- clfswm/src/bindings.lisp	(original)
+++ clfswm/src/bindings.lisp	Sat Nov  7 16:33:20 2009
@@ -64,10 +64,8 @@
   (define-main-key ("Menu" :control) 'toggle-show-root-frame)
   (define-main-key (#\b :mod-1) 'banish-pointer)
   ;; Escape
-  (define-main-key ("Escape" :control :shift) 'delete-focus-window)
-  (define-main-key ("Escape" :mod-1 :control :shift) 'destroy-focus-window)
-  (define-main-key ("Escape" :control) 'remove-focus-window)
-  (define-main-key ("Escape" :shift) 'unhide-all-windows-in-current-child)
+  (define-main-key ("Escape" :control) 'ask-close/kill-current-window)
+  ;; Second mode
   (define-main-key (#\t :mod-1) 'second-key-mode)
   (define-main-key ("less" :control) 'second-key-mode)
   ;; Bind or jump functions

Modified: clfswm/src/clfswm-corner.lisp
==============================================================================
--- clfswm/src/clfswm-corner.lisp	(original)
+++ clfswm/src/clfswm-corner.lisp	Sat Nov  7 16:33:20 2009
@@ -54,7 +54,7 @@
 	  ((and (<= 0 x cs) (<= (- sh cs) y sh)) :bottom-left)
 	  ((and (<= (- sw cs) x sw) (<= (- sh cs) y sh)) :bottom-right)
 	  (t nil))))
-  
+
 
 
 
@@ -147,11 +147,3 @@
   t)
 
 
-(defun ask-close/kill-current-window ()
-  "Close or kill the current window (ask before doing anything)"
-  (let ((window (xlib:input-focus *display*)))
-    (when (and window (not (xlib:window-equal window *no-focus-window*)))
-      (info-mode-menu `(,(format nil "Focus window: ~A" (xlib:wm-name window))
-			 (#\c delete-focus-window "Close the focus window")
-			 (#\k destroy-focus-window "Kill the focus window"))))))
-

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Sat Nov  7 16:33:20 2009
@@ -103,7 +103,7 @@
       (show-all-children))))
 
 (defun remove-focus-window ()
-  "Remove the focus window in the current frame"
+  "Remove the focus window from the current frame"
   (let ((window (xlib:input-focus *display*)))
     (when (and window (not (xlib:window-equal window *no-focus-window*)))
       (setf *current-child* *current-root*)
@@ -1240,3 +1240,19 @@
 
 
 
+;;; Close/Kill focused window
+
+(defun ask-close/kill-current-window ()
+  "Close or kill the current window (ask before doing anything)"
+  (let ((window (xlib:input-focus *display*)))
+    (info-mode-menu
+     (if (and window (not (xlib:window-equal window *no-focus-window*)))
+	 `(,(format nil "Focus window: ~A" (xlib:wm-name window))
+	    (#\c delete-focus-window "Close the focus window")
+	    (#\k destroy-focus-window "Kill the focus window")
+	    (#\r remove-focus-window)
+	    (#\u unhide-all-windows-in-current-child))
+	 `(,(format nil "Focus window: None")
+	    (#\u unhide-all-windows-in-current-child))))))
+
+

Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp	(original)
+++ clfswm/src/clfswm.lisp	Sat Nov  7 16:33:20 2009
@@ -59,9 +59,9 @@
 				 x y width height border-width value-mask &allow-other-keys)
   (declare (ignore event-slots))
   (labels ((has-x (mask) (= 1 (logand mask 1)))
-    	   (has-y (mask) (= 2 (logand mask 2)))
-    	   (has-w (mask) (= 4 (logand mask 4)))
-    	   (has-h (mask) (= 8 (logand mask 8)))
+	   (has-y (mask) (= 2 (logand mask 2)))
+	   (has-w (mask) (= 4 (logand mask 4)))
+	   (has-h (mask) (= 8 (logand mask 8)))
 	   (has-bw (mask) (= 16 (logand mask 16)))
 	   (has-stackmode (mask) (= 64 (logand mask 64)))
 	   (adjust-from-request ()




More information about the clfswm-cvs mailing list