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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Thu May 15 20:14:03 UTC 2008


Author: pbrochard
Date: Thu May 15 16:14:02 2008
New Revision: 126

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-util.lisp
   clfswm/src/xlib-util.lisp
Log:
resize-window: Use a better algorithm to resize windows.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Thu May 15 16:14:02 2008
@@ -1,3 +1,14 @@
+2008-05-15  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-util.lisp (current-frame-manage-window-type): Fix a
+	typo in managed types.
+
+	* src/clfswm-internal.lisp (show-child): Always display frame info
+	even if the frame is hidden.
+
+	* src/xlib-util.lisp (resize-window): Use a better algorithme to
+	resize windows.
+
 2008-05-13  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-util.lisp (with-movement): Display frame info for all

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Thu May 15 16:14:02 2008
@@ -449,14 +449,14 @@
 
 (defmethod show-child ((frame frame) parent display-p raise-p first-p)
   (declare (ignore parent))
-  (when display-p
-    (with-xlib-protect
+  (with-xlib-protect
+    (when display-p
       (with-slots (window) frame
 	(when (or *show-root-frame-p* (not (equal frame *current-root*)))
 	  (setf (xlib:window-background window) (get-color "Black"))
 	  (xlib:map-window window)
-	  (raise-if-needed window raise-p first-p)
-	  (display-frame-info frame))))))
+	  (raise-if-needed window raise-p first-p))))
+    (display-frame-info frame)))
 
 
 (defmethod show-child ((window xlib:window) parent display-p raise-p first-p)

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Thu May 15 16:14:02 2008
@@ -804,21 +804,23 @@
 
 
 ;;; Managed window type functions
+(defun current-frame-manage-window-type-generic (type-list)
+  (when (frame-p *current-child*)
+    (setf (frame-managed-type *current-child*) type-list
+	  (frame-forced-managed-window *current-child*) nil
+	  (frame-forced-unmanaged-window *current-child*) nil))
+  (leave-second-mode))
+
+
 (defun current-frame-manage-window-type ()
   "Change window types to be managed by a frame"
   (when (frame-p *current-child*)
     (let* ((type-str (query-string "Managed window type: (all, normal, transient, maxsize, desktop, dock, toolbar, menu, utility, splash, dialog)"
-				   (format nil "~{~:(~A~)~}" (frame-managed-type *current-child*))))
+				   (format nil "~{~:(~A~) ~}" (frame-managed-type *current-child*))))
 	   (type-list (loop :for type :in (split-string type-str)
 			 :collect (intern (string-upcase type) :keyword))))
-      (setf (frame-managed-type *current-child*) type-list)))
-  (leave-second-mode))
-
+      (current-frame-manage-window-type-generic type-list))))
 
-(defun current-frame-manage-window-type-generic (type-list)
-  (when (frame-p *current-child*)
-    (setf (frame-managed-type *current-child*) type-list))
-  (leave-second-mode))
 
 (defun current-frame-manage-all-window-type ()
   "Manage all window type"

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Thu May 15 16:14:02 2008
@@ -496,10 +496,8 @@
 (defun resize-window (window orig-x orig-y &optional additional-fn additional-arg)
   (raise-window window)
   (let* ((done nil)
-	 (dx (- (xlib:drawable-x window) orig-x))
-	 (dy (- (xlib:drawable-y window) orig-y))
-	 (lx orig-x)
-	 (ly orig-y)
+	 (orig-width (xlib:drawable-width window))
+	 (orig-height (xlib:drawable-height window))
 	 (pointer-grabbed-p (xgrab-pointer-p))
 	 (hints (xlib:wm-normal-hints window))
 	 (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0))
@@ -508,11 +506,8 @@
 	 (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) most-positive-fixnum)))
     (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys)
 	       (declare (ignore event-slots))
-	       (setf (xlib:drawable-width window) (min (max (+ (xlib:drawable-width window) (- root-x lx)) 10 min-width) max-width)
-		     (xlib:drawable-height window) (min (max (+ (xlib:drawable-height window) (- root-y ly)) 10 min-height) max-height)
-		     dx (- dx (- root-x lx))
-		     dy (- dy (- root-y ly))
-		     lx root-x ly root-y)
+	       (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x orig-x)) 10 min-width) max-width)
+		     (xlib:drawable-height window) (min (max (+ orig-height (- root-y orig-y)) 10 min-height) max-height))
 	       (when additional-fn
 	       	 (apply additional-fn additional-arg)))
 	     (handle-event (&rest event-slots &key event-key &allow-other-keys)



More information about the clfswm-cvs mailing list