[clfswm-cvs] r160 - in clfswm: . doc src

pbrochard at common-lisp.net pbrochard at common-lisp.net
Wed Sep 3 20:40:49 UTC 2008


Author: pbrochard
Date: Wed Sep  3 16:40:41 2008
New Revision: 160

Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/doc/menu.html
   clfswm/doc/menu.txt
   clfswm/src/clfswm-util.lisp
   clfswm/src/clfswm.lisp
   clfswm/src/menu-def.lisp
   clfswm/src/package.lisp
Log:
handle-enter-notify: Add a sloppy strict focus policy -> Sloppy focus only for windows in the current frame.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Wed Sep  3 16:40:41 2008
@@ -1,5 +1,8 @@
 2008-09-03  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm.lisp (handle-enter-notify): Add a sloppy strict focus
+	policy -> Sloppy focus only for windows in the current frame.
+
 	* src/clfswm-util.lisp (reset-clfswm): New function.
 
 2008-09-02  Philippe Brochard  <pbrochard at common-lisp.net>

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Wed Sep  3 16:40:41 2008
@@ -7,15 +7,12 @@
 ===============
 Should handle these soon.
 
-- Sloppy focus strict -> focus windows only in the current frame
-  Sloppy select -> select frame on mouse enter.
-
 - Hook to open next window in named/numbered frame [Philippe]
 
 - Ensure-unique-number/name (new function) [Philippe]
 
 - Show config -> list and display documentation for all tweakable global variables. [Philippe]
-   TODO : remove src/test.lisp src/load-test.lisp
+   TODO :
    In ~/.clfswmrc:
       ;;;; AUTO-CONFIG - Do not edit those lines by hands: they are overwritten by CLFSWM
       (defparameter *ma-var* value)

Modified: clfswm/doc/menu.html
==============================================================================
--- clfswm/doc/menu.html	(original)
+++ clfswm/doc/menu.html	Wed Sep  3 16:40:41 2008
@@ -352,10 +352,13 @@
       <a name="FRAME-FOCUS-POLICY"></a><a href="#FRAME-MENU">Frame-Focus-Policy</a>
     </h3>
     <p>
-      c: Set a click focus policy for the current frame
+      c: Set a click focus policy for the current frame.
     </p>
     <p>
-      s: Set a sloppy focus policy for the current frame
+      s: Set a sloppy focus policy for the current frame.
+    </p>
+    <p>
+      t: Set a (strict) sloppy focus policy only for windows in the current frame.
     </p>
     <hr>
     <h3>

Modified: clfswm/doc/menu.txt
==============================================================================
--- clfswm/doc/menu.txt	(original)
+++ clfswm/doc/menu.txt	Wed Sep  3 16:40:41 2008
@@ -124,8 +124,9 @@
 a: Resize down the current frame to its minimal size
 
 Frame-Focus-Policy
-c: Set a click focus policy for the current frame
-s: Set a sloppy focus policy for the current frame
+c: Set a click focus policy for the current frame.
+s: Set a sloppy focus policy for the current frame.
+t: Set a (strict) sloppy focus policy only for windows in the current frame.
 
 Frame-Managed-Window-Menu
 m: Change window types to be managed by a frame

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Wed Sep  3 16:40:41 2008
@@ -1084,14 +1084,21 @@
 
 
 ;;; Focus policy functions
-(defun current-frame-set-click-focus-policy ()
-  "Set a click focus policy for the current frame"
+(defun set-focus-policy-generic (focus-policy)
   (when (frame-p *current-child*)
-    (setf (frame-focus-policy *current-child*) :click))
+    (setf (frame-focus-policy *current-child*) focus-policy))
   (leave-second-mode))
+  
 
+(defun current-frame-set-click-focus-policy ()
+  "Set a click focus policy for the current frame."
+  (set-focus-policy-generic :click))
+  
 (defun current-frame-set-sloppy-focus-policy ()
-  "Set a sloppy focus policy for the current frame"
-  (when (frame-p *current-child*)
-    (setf (frame-focus-policy *current-child*) :sloppy))
-  (leave-second-mode))
+  "Set a sloppy focus policy for the current frame."
+  (set-focus-policy-generic :sloppy))
+
+(defun current-frame-set-sloppy-strict-focus-policy ()
+  "Set a (strict) sloppy focus policy only for windows in the current frame."
+    (set-focus-policy-generic :sloppy-strict))
+

Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp	(original)
+++ clfswm/src/clfswm.lisp	Wed Sep  3 16:40:41 2008
@@ -121,12 +121,18 @@
 
 (defun handle-enter-notify  (&rest event-slots &key window root-x root-y &allow-other-keys)
   (declare (ignore event-slots))
-  (when (eql :sloppy (if (frame-p *current-child*)
-			 (frame-focus-policy *current-child*)
-			 *default-focus-policy*))
-    (unless (and (> root-x (- (xlib:screen-width *screen*) 3))
-		 (> root-y (- (xlib:screen-height *screen*) 3)))
-      (focus-window window))))
+  (case (if (frame-p *current-child*)
+	    (frame-focus-policy *current-child*)
+	    *default-focus-policy*)
+    (:sloppy (unless (and (> root-x (- (xlib:screen-width *screen*) 3))
+			  (> root-y (- (xlib:screen-height *screen*) 3)))
+	       (focus-window window)))
+    (:sloppy-strict (unless (and (> root-x (- (xlib:screen-width *screen*) 3))
+				 (> root-y (- (xlib:screen-height *screen*) 3)))
+		      (when (and (frame-p *current-child*)
+				 (member window (frame-child *current-child*)))
+			(focus-window window))))))
+
 
 
 

Modified: clfswm/src/menu-def.lisp
==============================================================================
--- clfswm/src/menu-def.lisp	(original)
+++ clfswm/src/menu-def.lisp	Wed Sep  3 16:40:41 2008
@@ -114,6 +114,8 @@
 
 (add-menu-key 'frame-focus-policy "c" 'current-frame-set-click-focus-policy)
 (add-menu-key 'frame-focus-policy "s" 'current-frame-set-sloppy-focus-policy)
+(add-menu-key 'frame-focus-policy "t" 'current-frame-set-sloppy-strict-focus-policy)
+
 
 (add-menu-key 'frame-managed-window-menu "m" 'current-frame-manage-window-type)
 (add-menu-key 'frame-managed-window-menu "a" 'current-frame-manage-all-window-type)

Modified: clfswm/src/package.lisp
==============================================================================
--- clfswm/src/package.lisp	(original)
+++ clfswm/src/package.lisp	Wed Sep  3 16:40:41 2008
@@ -85,7 +85,7 @@
 
 ;;; CONFIG - Default focus policy
 (defparameter *default-focus-policy* :click
-  "Config(): Default mouse focus policy. One of :click or :sloppy")
+  "Config(): Default mouse focus policy. One of :click, :sloppy or :sloppy-strict.")
 
 
 



More information about the clfswm-cvs mailing list