sawfish r4215 - in trunk/lisp/sawfish/wm: . placement



Author: jkozicki
Date: Sun Jan 20 16:43:19 2008
New Revision: 4215
URL: http://svn.gnome.org/viewvc/sawfish?rev=4215&view=rev

Log:
Multihead placed patch by Fuchur + comments by Andrea Vettorello

http://sawfish.wikia.com/wiki/Multihead_placed_patch

http://mail.gnome.org/archives/sawfish-list/2006-August/msg00007.html

M    lisp/sawfish/wm/placement.jl
M    lisp/sawfish/wm/misc.jl
M    lisp/sawfish/wm/placement/top-left.jl


Modified:
   trunk/lisp/sawfish/wm/misc.jl
   trunk/lisp/sawfish/wm/placement.jl
   trunk/lisp/sawfish/wm/placement/top-left.jl

Modified: trunk/lisp/sawfish/wm/misc.jl
==============================================================================
--- trunk/lisp/sawfish/wm/misc.jl	(original)
+++ trunk/lisp/sawfish/wm/misc.jl	Sun Jan 20 16:43:19 2008
@@ -119,29 +119,34 @@
 
 (define (current-head #!optional (w (input-focus)))
   "Return the id of the `current' head."
-  (or (and w (let ((point (window-position w))
-		   (dims (window-dimensions w)))
-	       (find-head (+ (car point) (quotient (car dims) 2))
-			  (+ (cdr point) (quotient (cdr dims) 2)))))
-      (pointer-head)))
+  (require 'sawfish.wm.windows)
+  (if (not (desktop-window-p w))
+      (or (and w (let ((point (window-position w))
+                       (dims (window-dimensions w)))
+                   (find-head (+ (car point) (quotient (car dims) 2))
+                              (+ (cdr point) (quotient (cdr dims) 2)))))
+          (pointer-head))
+    (pointer-head)))
 
-(define (current-head-dimensions #!optional w)
+(define (current-head-dimensions #!optional (w (input-focus)))
   "Return a cons-cell defining the size in pixels of the current head (that
-containing the window W, or the pointer if W is false). Returns the screen
-dimensions if no such head can be identified."
-  (let ((head (current-head w)))
-    (if head
-	(head-dimensions head)
-      (screen-dimensions))))
+containing the window W, or containing the window with input focus if W is
+false). Returns the screen dimensions if no such head can be identified."
+  (or (and w (let ((head (current-head w)))
+               (if head
+                   (head-dimensions head)
+                 (screen-dimensions))))
+      (head-dimensions (pointer-head))))
 
-(define (current-head-offset #!optional w)
+(define (current-head-offset #!optional (w (input-focus)))
   "Return a cons-cell defining the origin of the current head (that
-containing the window W, or the pointer if W is false). Returns '(0 . 0)
-if no such head can be identified."
-  (let ((head (current-head w)))
-    (if head
-	(head-offset head)
-      (cons 0 0))))
+containing the window W, or containing the window with input focus if W is
+false). Returns '(0 . 0) if no such head can be identified."
+  (or (and w (let ((head (current-head w)))
+               (if head
+                   (head-offset head)
+                 (cons 0 0))))
+      (head-offset (pointer-head))))
 
 (define (load-module name)
   "Ensure that the module called NAME has been loaded. Note that this does

Modified: trunk/lisp/sawfish/wm/placement.jl
==============================================================================
--- trunk/lisp/sawfish/wm/placement.jl	(original)
+++ trunk/lisp/sawfish/wm/placement.jl	Sun Jan 20 16:43:19 2008
@@ -210,6 +210,6 @@
   (define-placement-mode 'randomly place-window-randomly #:for-normal t #:for-dialogs t)
   (define-placement-mode 'interactively place-window-interactively #:for-normal t)
   (define-placement-mode 'centered place-window-centered #:for-normal t #:for-dialogs t)
-  (define-placement-mode 'centered-on-parent place-window-centered-on-parent #:for-dialogs t)
-  (define-placement-mode 'under-pointer place-window-under-pointer #:for-dialogs t)
+  (define-placement-mode 'centered-on-parent place-window-centered-on-parent #:for-normal t #:for-dialogs t)
+  (define-placement-mode 'under-pointer place-window-under-pointer #:for-normal t #:for-dialogs t)
   (define-placement-mode 'none nop #:for-normal t #:for-dialogs t))

Modified: trunk/lisp/sawfish/wm/placement/top-left.jl
==============================================================================
--- trunk/lisp/sawfish/wm/placement/top-left.jl	(original)
+++ trunk/lisp/sawfish/wm/placement/top-left.jl	Sun Jan 20 16:43:19 2008
@@ -86,7 +86,7 @@
 	    (t (loop (next-position point))))))
 
   (define (place-window-top-left w)
-    (let* ((workarea (calculate-workarea #:window w))
+    (let* ((workarea (calculate-workarea #:window w #:head (current-head)))
 	   (dims (window-dimensions w))
 	   (f-dims (window-frame-dimensions w))
 	   (hints (window-size-hints w))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]