[Sawfish] Patch to remember window properties if you change the workspace

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


Hi,

If you e.g have a sticky window and you maximized-vertically the window
sawfish set unmaximized-geometry (and other properties) to wrong
values if you change the workspace. You can test it:

Open a window and make it sticky. maximized-vertically the window. Open
sawfish-client and "check" the window with: 
"(window-get (select-window) 'swapped)"
go to the next workspace and again:
(window-get (select-window) 'swapped)
go to the next workspace and again:
(window-get (select-window) 'swapped)
and also go back to the workspaces and check again.

We have by all workspace wrong values by "maximized-horizontally" and
"unmaximized-geometry" but not on the first workspace where we have set
the window sticky.

I also read the comments in workspace.jl. The comment before
"(define (swap-out w space)" and in 
"(define (window-add-to-workspace w space)" and also if i read the code
tells me that we should only call "swap-in" in:
"(define (select-workspace* space #!key dont-focus inner-thunk force)"
if we have a copy of the window on a other workspace and not by a
"single window".

I am not sure but i can't believe that that is a features, for me that
is a bug. Please test the patch. Comments welcome.

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
--- sawfish/lisp/sawfish/wm/workspace.jl.orig	2013-01-26 17:26:22.000000000 +0100
+++ sawfish/lisp/sawfish/wm/workspace.jl	2013-01-26 17:29:03.000000000 +0100
@@ -549,13 +549,14 @@
 
 	 ;; first map new windows top-to-bottom
 	 (mapc (lambda (w)
-		 (when (window-appears-in-workspace-p w current-workspace)
-		   (swap-in w current-workspace))
-		 (when (and (window-appears-in-workspace-p w current-workspace)
-			    (window-get w 'placed))
-		   (if (window-viewable-p w)
-		       (show-window w)
-		     (hide-window w))))
+             (when (and (window-appears-in-workspace-p w current-workspace)
+                        (cdr (window-get w 'workspaces)))
+               (swap-in w current-workspace))
+             (when (and (window-appears-in-workspace-p w current-workspace)
+                        (window-get w 'placed))
+               (if (window-viewable-p w)
+                   (show-window w)
+                 (hide-window w))))
 	       order)
 
 	 ;; then unmap old-windows bottom-to-top

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/