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

Philippe Brochard pbrochard at common-lisp.net
Sun Jul 18 21:07:06 UTC 2010


Author: pbrochard
Date: Sun Jul 18 17:07:03 2010
New Revision: 278

Log:
clfswm-util.lisp (delete-focus-window, destroy-focus-window): Remove child in parent frame before	stopping it.

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-util.lisp
   clfswm/src/clfswm.lisp
   clfswm/src/xlib-util.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sun Jul 18 17:07:03 2010
@@ -1,3 +1,9 @@
+2010-07-18  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-util.lisp (delete-focus-window)
+	(destroy-focus-window): Remove child in parent frame before
+	stopping it.
+
 2010-07-16  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-util.lisp (identify-key): Add a timeout in

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Sun Jul 18 17:07:03 2010
@@ -111,8 +111,11 @@
     (when (and window (not (xlib:window-equal window *no-focus-window*)))
       (when (equal window *current-child*)
 	(setf *current-child* *current-root*))
+      (hide-child window)
+      (remove-child-in-frame window (find-parent-frame window))
       (send-client-message window :WM_PROTOCOLS
 			   (xlib:intern-atom *display* "WM_DELETE_WINDOW"))
+      (xlib:display-finish-output *display*)
       (show-all-children))))
 
 (defun destroy-focus-window ()
@@ -121,7 +124,10 @@
     (when (and window (not (xlib:window-equal window *no-focus-window*)))
       (when (equal window *current-child*)
 	(setf *current-child* *current-root*))
+      (hide-child window)
+      (remove-child-in-frame window (find-parent-frame window))
       (xlib:kill-client *display* (xlib:window-id window))
+      (xlib:display-finish-output *display*)
       (show-all-children))))
 
 (defun remove-focus-window ()

Modified: clfswm/src/clfswm.lisp
==============================================================================
--- clfswm/src/clfswm.lisp	(original)
+++ clfswm/src/clfswm.lisp	Sun Jul 18 17:07:03 2010
@@ -76,11 +76,12 @@
 	(if (find-child window *current-root*)
 	    (let ((parent (find-parent-frame window *current-root*)))
 	      (if (and parent (managed-window-p window parent))
-		  (progn
-		    (adapt-child-to-parent window parent)
-		    (send-configuration-notify window))
+		  (adapt-child-to-parent window parent)
 		  (adjust-from-request)))
 	    (adjust-from-request))
+	(send-configuration-notify window (xlib:drawable-x window) (xlib:drawable-y window)
+				   (xlib:drawable-width window) (xlib:drawable-height window)
+				   (xlib:drawable-border-width window))
 	(when (has-stackmode value-mask)
 	  (case stack-mode
 	    (:above (raise-window window))))))))
@@ -161,7 +162,6 @@
 
 
 
-
 ;;; CONFIG: Main mode hooks
 (setf *key-press-hook* 'handle-key-press
       *configure-request-hook* 'handle-configure-request

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Sun Jul 18 17:07:03 2010
@@ -70,7 +70,7 @@
 	 , at body)
      ((or xlib:match-error xlib:window-error xlib:drawable-error) (c)
        (declare (ignore c)))))
-      ;;(dbg c ',body))))
+       ;;(dbg c ',body))))
 
 
 
@@ -128,16 +128,18 @@
 (defun unhide-window (window)
   (when window
     (with-xlib-protect
-      (when (window-hidden-p window)
-	(xlib:map-window window)
-	(setf (window-state window) +normal-state+
-	      (xlib:window-event-mask window) *window-events*))))
+	(when (window-hidden-p window)
+	  (xlib:map-subwindows window)
+	  (xlib:map-window window)
+	  (setf (window-state window) +normal-state+
+		(xlib:window-event-mask window) *window-events*))))
   (xlib:display-finish-output *display*))
 
 
 (defun map-window (window)
   (when window
     (with-xlib-protect
+      (xlib:map-subwindows window)
       (xlib:map-window window)
       (xlib:display-finish-output *display*))))
 
@@ -286,21 +288,18 @@
 
 
 
-;; Stolen from Eclipse
-(defun send-configuration-notify (window)
+;;; Stolen from Eclipse
+(defun send-configuration-notify (window x y w h bw)
   "Send a synthetic configure notify event to the given window (ICCCM 4.1.5)"
-  (multiple-value-bind (x y)
-      (xlib:translate-coordinates window 0 0 (xlib:drawable-root window))
-    (xlib:send-event window
-		     :configure-notify
-		     (xlib:make-event-mask :structure-notify)
-		     :event-window window :window window
-		     :x x :y y
-		     :override-redirect-p nil
-		     :border-width (xlib:drawable-border-width window)
-		     :width (xlib:drawable-width window)
-		     :height (xlib:drawable-height window)
-		     :propagate-p nil)))
+  (xlib:send-event window :configure-notify (xlib:make-event-mask :structure-notify)
+                   :event-window window
+                   :window window
+                   :x x :y y
+                   :width w
+                   :height h
+                   :border-width bw
+                   :propagate-p nil))
+
 
 
 (defun send-client-message (window type &rest data)




More information about the clfswm-cvs mailing list