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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Sat May 17 11:14:23 UTC 2008


Author: pbrochard
Date: Sat May 17 07:14:18 2008
New Revision: 127

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-nw-hooks.lisp
Log:
place-window-from-hints: Center unmanaged windows in the root screen. clear-nw-hook, clear-all-nw-hooks: new functions.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sat May 17 07:14:18 2008
@@ -1,3 +1,11 @@
+2008-05-17  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-internal.lisp (place-window-from-hints): Center
+	unmanaged windows in the root screen.
+
+	* src/clfswm-nw-hooks.lisp (clear-nw-hook, clear-all-nw-hooks):
+	new functions.
+
 2008-05-15  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-util.lisp (current-frame-manage-window-type): Fix a

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Sat May 17 07:14:18 2008
@@ -435,7 +435,7 @@
 
 (defmethod adapt-child-to-parent (child parent)
   (declare (ignore child parent))
-  ())
+  (values nil nil))
 
 
 
@@ -770,8 +770,8 @@
 			(xlib:drawable-height window))))
       (setf (xlib:drawable-width window) (min (max min-width rwidth *default-window-width*) max-width)
 	    (xlib:drawable-height window) (min (max min-height rheight *default-window-height*) max-height))
-            (setf (xlib:drawable-x window) (truncate (+ (frame-rx *current-child*) (/ (- (xlib:screen-width *screen*) (xlib:drawable-width window)) 2)))
-		  (xlib:drawable-y window) (truncate (+ (frame-ry *current-child*) (/ (- (xlib:screen-height *screen*) (xlib:drawable-height window)) 2)))))))
+      (setf (xlib:drawable-x window) (truncate (/ (- (xlib:screen-width *screen*) (xlib:drawable-width window)) 2))
+	    (xlib:drawable-y window) (truncate (/ (- (xlib:screen-height *screen*) (xlib:drawable-height window)) 2))))))
 
 
 

Modified: clfswm/src/clfswm-nw-hooks.lisp
==============================================================================
--- clfswm/src/clfswm-nw-hooks.lisp	(original)
+++ clfswm/src/clfswm-nw-hooks.lisp	Sat May 17 07:14:18 2008
@@ -65,6 +65,15 @@
     (leave-frame)
     (select-previous-level)))
 
+(defun clear-nw-hook (frame)
+  "Clear the frame new window hook"
+  (setf (frame-nw-hook frame) nil))
+
+(defun clear-all-nw-hooks ()
+  "Clear all new window hooks for all frames"
+  (with-all-frames (*root-frame* frame)
+    (clear-nw-hook frame)))
+
 
 
 ;;; Default frame new window hook
@@ -90,7 +99,7 @@
   (pushnew window (frame-child *current-root*))
   (setf *current-child* (first (frame-child *current-root*)))
   (default-window-placement *current-root* window)
-  (setf (frame-nw-hook frame) nil))
+  (clear-nw-hook frame))
 
 (defun set-open-in-current-root-nw-hook ()
   "Open the next window in the current root"
@@ -108,7 +117,7 @@
     (pushnew window (frame-child new-frame))
     (setf *current-child* new-frame)
     (default-window-placement new-frame window))
-  (setf (frame-nw-hook frame) nil))
+  (clear-nw-hook frame))
 
 (defun set-open-in-new-frame-in-current-root-nw-hook ()
   "Open the next window in a new frame in the current root"
@@ -128,7 +137,7 @@
     (set-tile-space-layout-once)
     (setf *current-child* new-frame)
     (default-window-placement new-frame window))
-  (setf (frame-nw-hook frame) nil))
+  (clear-nw-hook frame))
 
 (defun set-open-in-new-frame-in-root-frame-nw-hook ()
   "Open the next window in a new frame in the root frame"
@@ -150,7 +159,7 @@
       (setf *current-child* new-frame)
       (default-window-placement new-frame window)
       (show-all-children *current-root*)))
-  (setf (frame-nw-hook frame) nil))
+  (clear-nw-hook frame))
 
 (defun set-open-in-new-frame-in-parent-frame-nw-hook ()
   "Open the next window in a new frame in the parent frame"
@@ -170,7 +179,8 @@
     (when (second (frame-child *current-child*))
       (rotatef (first (frame-child *current-child*))
 	       (second (frame-child *current-child*)))))
-  (default-window-placement *current-child* window))
+  (default-window-placement *current-child* window)
+  (clear-nw-hook frame))
 
 (defun set-leave-focus-frame-nw-hook ()
   "Open the next window in the current frame and leave the focus on the current child"



More information about the clfswm-cvs mailing list