FANDOM


Browse all patches

Author

Rüdiger Otte

Synopsis

Since focusing a window without also raising it is the desired behaviour with the RISC-OS alike ROX Desktop Environment, I was looking for a possibility to do this with sawfish. I ended up adding a new pseudo raise-function which I call "focus-and-pass-through-click" by cloning "raise-and-pass-through-click" without the raise command.

Patch testing

  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: ./autogen.sh && 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

--- sawfish-1.3.3.orig/lisp/sawfish/wm/autoload.jl	2007-07-29 11:45:04.000000000 +0200
+++ sawfish-1.3.3/lisp/sawfish/wm/autoload.jl	2008-03-12 15:06:36.000000000 +0100
@@ -98,6 +98,7 @@
 (autoload-command (quote raise-and-pass-through-click) (quote sawfish.wm.commands.raise-commands))
 (autoload-command (quote raise-and-pass-through-click-if-focused) (quote sawfish.wm.commands.raise-commands))
 (autoload-command (quote raise-or-pass-through-click) (quote sawfish.wm.commands.raise-commands))
+(autoload-command (quote focus-and-pass-through-click) (quote sawfish.wm.commands.raise-commands))
 (autoload-command (quote raise-window-and-pass-through-click) (quote sawfish.wm.commands.raise-commands) #:class 'advanced)
 (autoload-command (quote raise-group-and-pass-through-click) (quote sawfish.wm.commands.raise-commands) #:class 'advanced)
 (autoload-command (quote raise-transients-and-pass-through-click) (quote sawfish.wm.commands.raise-commands) #:class 'advanced)

--- sawfish-1.3.3.orig/lisp/sawfish/wm/commands/raise-commands.jl	2007-07-29 11:45:04.000000000 +0200
+++ sawfish-1.3.3/lisp/sawfish/wm/commands/raise-commands.jl	2008-03-12 15:06:47.000000000 +0100
@@ -61,6 +61,12 @@
 	(maybe-raise-window w)
       (replay-pointer w)))
 
+  (define (focus-pass-through-click w)
+    "Focus the window that received the current event, then replay any pointer
+events that invoked the command."
+    (when (windowp w)
+      (replay-pointer w)))
+
   ;;###autoload
   (define-command 'raise-and-pass-through-click
     and-pass-through-click #:spec "%W")
@@ -68,6 +74,8 @@
     and-pass-through-click-if-focused #:spec "%w")
   (define-command 'raise-or-pass-through-click
     or-pass-through-click #:spec "%w")
+  (define-command 'focus-and-pass-through-click
+    focus-pass-through-click #:spec "%w")
 
 ;;; these should probably be considered obsolete

Community's reasons for inclusion or rejection

Patch submitters, please vote also! Yes, obviosuly your vote will be positive, but it's the place to give your explanation why this patch is good for all Sawfish users, and why it is correct - good reasons for inclusion.

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: ~~~~.

  • Wtf vote: pondering. Vote: pondering. - I don't know if this is necessary. I guess your focus mode is 'click', and you had binded 'Mouse1-click' to 'raise-and-pass-through-click' in the 'window' context. If so, simply unbinding 'Mouse1-click' must work. I tried and found that a mouse click is correctly passed to the window. Could you please test it? (I have fixed your patch, by rearranging a parenthesis.) - Teika kazura 04:44, 28 June 2008 (UTC)
  • Wtf vote: pondering. I agree with Teika, the problem looks more like a config issue. Non handled events are just passed untouched, so unbinding should work as expected, Sawfish does not force raises (I have been using enter focus mode for years without autoraises). GSR 21:37, 15 July 2008 (UTC)
  • No vote: no. Better to reconfigure your sawfish binding, than to apply your patch ;) In fact that's the configuration I'm currently using on my ROX+sawfish desktop (focus without raise, enter+click focus). But thank you for your effort. Janek Kozicki 15:34, 4 August 2008 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.