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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Tue Mar 18 11:42:12 UTC 2008


Author: pbrochard
Date: Tue Mar 18 06:42:07 2008
New Revision: 47

Modified:
   clfswm/TODO
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-nw-hooks.lisp
   clfswm/src/clfswm.lisp
   clfswm/src/xlib-util.lisp
Log:
Remove :button-* in *window-events* -> prevent an access-error bug


Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Tue Mar 18 06:42:07 2008
@@ -18,6 +18,8 @@
 
 
 - Hooks when a new window is mapped [Philippe]
+   + Hook to open next window in named/numbered group
+
 
 - Add boundaries in the info window [Philippe]
 

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Tue Mar 18 06:42:07 2008
@@ -596,19 +596,20 @@
 
 (defun place-window-from-hints (window)
   "Place a window from its hints"
-  (let* ((hints (xlib:wm-normal-hints window))
-	 (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0))
-	 (min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0))
-	 (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (xlib:drawable-width *root*)))
-	 (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (xlib:drawable-height *root*)))
-	 (rwidth (or (and hints (or (xlib:wm-size-hints-width hints) (xlib:wm-size-hints-base-width hints)))
-		     (xlib:drawable-width window)))
-	 (rheight (or (and hints (or (xlib:wm-size-hints-height hints) (xlib:wm-size-hints-base-height hints)))
-		      (xlib:drawable-height window))))
-    (setf (xlib:drawable-width window) (min (max min-width rwidth) max-width)
-	  (xlib:drawable-height window) (min (max min-height rheight) max-height))
-    (setf (xlib:drawable-x window) (truncate (+ (group-rx *current-child*) (/ (- (group-rw *current-child*) (xlib:drawable-width window)) 2)))
-	  (xlib:drawable-y window) (truncate (+ (group-ry *current-child*) (/ (- (group-rh *current-child*) (xlib:drawable-height window)) 2))))))
+  (with-xlib-protect
+    (let* ((hints (xlib:wm-normal-hints window))
+	   (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0))
+	   (min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0))
+	   (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (xlib:drawable-width *root*)))
+	   (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (xlib:drawable-height *root*)))
+	   (rwidth (or (and hints (or (xlib:wm-size-hints-width hints) (xlib:wm-size-hints-base-width hints)))
+		       (xlib:drawable-width window)))
+	   (rheight (or (and hints (or (xlib:wm-size-hints-height hints) (xlib:wm-size-hints-base-height hints)))
+			(xlib:drawable-height window))))
+      (setf (xlib:drawable-width window) (min (max min-width rwidth) max-width)
+	    (xlib:drawable-height window) (min (max min-height rheight) max-height))
+      (setf (xlib:drawable-x window) (truncate (+ (group-rx *current-child*) (/ (- (group-rw *current-child*) (xlib:drawable-width window)) 2)))
+	    (xlib:drawable-y window) (truncate (+ (group-ry *current-child*) (/ (- (group-rh *current-child*) (xlib:drawable-height window)) 2)))))))
 
 
 
@@ -656,7 +657,6 @@
 ;;      (setf (group-nw-hook *current-child*) #'open-in-new-group-nw-hook))
     (unless (do-all-groups-nw-hook window)
       (default-group-nw-hook nil window))
-    (unhide-window window)
     (netwm-add-in-client-list window)))
 
 
@@ -680,7 +680,9 @@
 	    (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)
+	      (unhide-window win)
 	      (process-new-window win)
+	      (xlib:map-window win)
 	      (raise-window win)
 	      (pushnew (xlib:window-id win) id-list))))))
     (netwm-set-client-list id-list)))

Modified: clfswm/src/clfswm-nw-hooks.lisp
==============================================================================
--- clfswm/src/clfswm-nw-hooks.lisp	(original)
+++ clfswm/src/clfswm-nw-hooks.lisp	Tue Mar 18 06:42:07 2008
@@ -69,7 +69,7 @@
   (declare (ignore group))
   (leave-if-not-group *current-child*)
   (when (group-p *current-child*)
-    (pushnew window (group-child *current-child*))) ;)
+    (pushnew window (group-child *current-child*)))
   (default-window-placement *current-child* window))
 
 (defun set-default-group-nw-hook ()

Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp	(original)
+++ clfswm/src/clfswm.lisp	Tue Mar 18 06:42:07 2008
@@ -94,11 +94,11 @@
 (defun handle-map-request (&rest event-slots &key window send-event-p &allow-other-keys)
   (declare (ignore event-slots))
   (unless send-event-p
+    (unhide-window window)
     (process-new-window window)
     (xlib:map-window window)
     (show-all-childs)))
 
-
 (defun handle-unmap-notify (&rest event-slots &key send-event-p event-window window &allow-other-keys)
   (declare (ignore event-slots))
   (unless (and (not send-event-p)
@@ -126,7 +126,7 @@
 (defun handle-exposure   (&rest event-slots &key window &allow-other-keys)
   (declare (ignore event-slots))
   (awhen (find-group-window window *current-root*)
-	 (display-group-info it)))
+    (display-group-info it)))
 
 
 (defun handle-create-notify (&rest event-slots)

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Tue Mar 18 06:42:07 2008
@@ -37,10 +37,7 @@
 				:colormap-change
 				:focus-change
 				:enter-window
-				:exposure
-				:button-press
-				:button-release
-				:pointer-motion)
+				:exposure)
   "The events to listen for on managed windows.")
 
 



More information about the clfswm-cvs mailing list