773pages on
this wiki
Add New Page
Add New Page Talk0
Browse all patches

From the author: this patch is currently suspended - not to be accepted right now, but nor to be rejected - with good reason. If you are interested, please help me. Thank you. - Teika kazura 08:02, 17 July 2008 (UTC)

Author Edit

Teika kazura

Synopsis Edit

This patch allows the new window not to be focused when it appeared, overriding the global option `focus-windows-when-mapped'.


Let me remind you first that there's the global option `focus-windows-when-mapped', and the boolean window property `focus-when-mapped'. When a new window appears, will it be focused? Compare these situations:

  1. `focus-windows-when-mapped' is nil and `focus-when-mapped' is t. Then the window is focused. OK.
  2. `focus-windows-when-mapped' is t and `focus-when-mapped' is unset. Then the window is focused. OK.
  3. `focus-windows-when-mapped' is t and `focus-when-mapped' is set false. In fact, the window gets focused, despite of the window specific option. This seems quite unnatural; I expect that it is unfocused, and this patch allows it.

Let me summarize: if a boolean property is unset, nothing special is meant, the default. When set and is false, then it is stronger; a negation. At least I understand so.


Why this is suspended, dispite of its usefulness?

It used to be unable for Sawfish to distinguish between an unset property and set with the value nil. So fixing only 'focus when mapped' field is a bit lopsided - not consistent with other options.

Patch testing Edit

  1. Copy/paste the patch listed below into some file, eg. TEST.diff.
  2. If you don't have sawfish sources yet, have one, as described get it from GIT repo.
  3. Go into the directory where sawfish sources reside, eg. cd sawfish
  4. Test if the patch applies cleanly with this command:
    patch -p1 --ignore-whitespace --dry-run < TEST.diff
    in case of problems try also: -p0 or -p2
  5. If it applies cleanly, then remove the --dry-run from above command and run it again, otherwise ask on the mailing list.
  6. Compile sawfish: ./ && make
  7. Install it for testing, but it depends on your linux distribution.
    1. It is always better to install sawfish as your distribution package, but it is different for each distribution.
    2. So you may try make install, which will install sawifish in /usr/local/share/sawfish/ (if you have write access). But then make sure that you run the correct version and delete it from that directory afterwards, to avoid any conflicts.
  8. Se also

PS: edit this template if you feel that those instructions can be improved.

Patch Edit

For 1.5 and later:

diff --git a/lisp/sawfish/wm/state/transient.jl b/lisp/sawfish/wm/state/transient.jl
index d308d4e..9483d10 100644
--- a/lisp/sawfish/wm/state/transient.jl
+++ b/lisp/sawfish/wm/state/transient.jl
@@ -172,6 +172,7 @@ the level of any transient windows it has."
                               (eql x-for-id (root-window-id))
                               (let ((x-for (get-window-by-id x-for-id)))
                                 (and x-for (window-get x-for 'desktop))))
+			  (window-get w 'focus-when-mapped t)
                           (or (and
                                (not (window-get w 'never-focus))

For 1.3.x series:

--- sawfish-1.3.3.orig/lisp/sawfish/wm/state/transient.jl	2007-07-29 18:45:03.000000000 +0900
+++ sawfish-1.3.3/lisp/sawfish/wm/state/transient.jl	2008-06-22 17:03:06.000000000 +0900
@@ -165,7 +165,8 @@
 		(transient-of-p w (input-focus) #:allow-root t))
 	   (set-input-focus w))
-	  ((and (or (and focus-windows-when-mapped
+	  ((and (window-get w 'focus-when-mapped t)
+	        (or (and focus-windows-when-mapped
 			 (not (window-get w 'never-focus)))
 		    (window-get w 'focus-when-mapped))
 		(or (not (window-transient-p w))

Community's reasons for inclusion or rejection Edit

When voting anonymously please write your name, so that it can be associated with your posts on the mailing list. If you are logged in you can sign yourself by typing four tilda characters: ~~~~.

For old comments, see here

Also on Fandom

Random Wiki