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

Philippe Brochard pbrochard at common-lisp.net
Mon Apr 18 11:50:32 UTC 2011


Author: pbrochard
Date: Mon Apr 18 07:50:32 2011
New Revision: 446

Log:
src/clfswm-pack.lisp (resize-frame-constrained): Takes care of border size.

Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/src/bindings-second-mode.lisp
   clfswm/src/bindings.lisp
   clfswm/src/clfswm-layout.lisp
   clfswm/src/clfswm-pack.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Mon Apr 18 07:50:32 2011
@@ -1,3 +1,8 @@
+2011-04-18  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-pack.lisp (resize-frame-constrained): Takes care of
+	border size.
+
 2011-04-17  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-pack.lisp (move-frame-constrained)

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Mon Apr 18 07:50:32 2011
@@ -9,6 +9,8 @@
 
 -> Nothing here yet.
 
+-> implode
+
 
 FOR THE NEXT RELEASE
 ====================

Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp	(original)
+++ clfswm/src/bindings-second-mode.lisp	Mon Apr 18 07:50:32 2011
@@ -185,6 +185,7 @@
   (or (do-corner-action root-x root-y *corner-second-mode-right-button*)
       (mouse-focus-move/resize-generic root-x root-y #'resize-frame nil)))
 
+
 (defun sm-mouse-middle-click (window root-x root-y)
   "Do actions on corners"
   (declare (ignore window))
@@ -234,6 +235,18 @@
   (mouse-focus-move/resize-generic root-x root-y #'resize-frame t))
 
 
+(defun sm-mouse-click-to-focus-and-move-window-constrained (window root-x root-y)
+  "Move (constrained by other frames) and focus the current child - Create a new frame on the root window"
+  (declare (ignore window))
+  (mouse-focus-move/resize-generic root-x root-y #'move-frame-constrained t))
+
+
+(defun sm-mouse-click-to-focus-and-resize-window-constrained (window root-x root-y)
+  "Resize (constrained by other frames) and focus the current child - Create a new frame on the root window"
+  (declare (ignore window))
+  (mouse-focus-move/resize-generic root-x root-y #'resize-frame-constrained t))
+
+
 
 (defun set-default-second-mouse ()
   (define-second-mouse (1) 'sm-mouse-click-to-focus-and-move)
@@ -241,6 +254,8 @@
   (define-second-mouse (3) 'sm-mouse-click-to-focus-and-resize)
   (define-second-mouse (1 :mod-1) 'sm-mouse-click-to-focus-and-move-window)
   (define-second-mouse (3 :mod-1) 'sm-mouse-click-to-focus-and-resize-window)
+  (define-second-mouse (1 :mod-1 :shift) 'sm-mouse-click-to-focus-and-move-window-constrained)
+  (define-second-mouse (3 :mod-1 :shift) 'sm-mouse-click-to-focus-and-resize-window-constrained)
   (define-second-mouse (1 :control :mod-1) 'mouse-move-child-over-frame)
   (define-second-mouse (4) 'sm-mouse-select-next-level)
   (define-second-mouse (5) 'sm-mouse-select-previous-level)

Modified: clfswm/src/bindings.lisp
==============================================================================
--- clfswm/src/bindings.lisp	(original)
+++ clfswm/src/bindings.lisp	Mon Apr 18 07:50:32 2011
@@ -114,7 +114,7 @@
 
 
 (defun mouse-click-to-focus-and-resize-window-constrained (window root-x root-y)
-  "Resize and focus the current child - Create a new frame on the root window"
+  "Resize (constrained by other frames) and focus the current child - Create a new frame on the root window"
   (declare (ignore window))
   (stop-button-event)
   (mouse-focus-move/resize-generic root-x root-y #'resize-frame-constrained t))

Modified: clfswm/src/clfswm-layout.lisp
==============================================================================
--- clfswm/src/clfswm-layout.lisp	(original)
+++ clfswm/src/clfswm-layout.lisp	Mon Apr 18 07:50:32 2011
@@ -143,6 +143,23 @@
   (- v (* (xlib:drawable-border-width (frame-window child)) 2)))
 
 
+(declaim (inline anti-adj-border-xy anti-adj-border-wh))
+(defgeneric anti-adj-border-xy (value child))
+(defgeneric anti-adj-border-wh (value child))
+
+(defmethod anti-adj-border-xy (v (child xlib:window))
+  (- v (xlib:drawable-border-width child)))
+
+(defmethod anti-adj-border-xy (v (child frame))
+  (- v (xlib:drawable-border-width (frame-window child))))
+
+(defmethod anti-adj-border-wh (v (child xlib:window))
+  (+ v (* (xlib:drawable-border-width child) 2)))
+
+(defmethod anti-adj-border-wh (v (child frame))
+  (+ v (* (xlib:drawable-border-width (frame-window child)) 2)))
+
+
 ;;; No layout
 (defgeneric no-layout (child parent)
   (:documentation "No layout: Maximize windows in there frame - Leave frames to there original size"))

Modified: clfswm/src/clfswm-pack.lisp
==============================================================================
--- clfswm/src/clfswm-pack.lisp	(original)
+++ clfswm/src/clfswm-pack.lisp	Mon Apr 18 07:50:32 2011
@@ -290,6 +290,6 @@
                              (when resize-w (setf lx x))
                              (when resize-h (setf ly y))
                              (values resize-w resize-h))))))
-      (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent)
-	    (frame-h frame) (h-px->fl (xlib:drawable-height window) parent)))
+      (setf (frame-w frame) (w-px->fl (anti-adj-border-wh (xlib:drawable-width window) frame) parent)
+	    (frame-h frame) (h-px->fl (anti-adj-border-wh (xlib:drawable-height window) frame) parent)))
     (show-all-children)))




More information about the clfswm-cvs mailing list