Viewport and window simultaneous move fix [PATCH]



Currently, if one uses the keyboard to switch viewports while moving
one's window, using the move-window-up, move-window-down, etc
bindings, it's possible for the moved window to lose focus.  This is
very annoying if you have, say, a 3x4 set of viewports and want to
move a window two viewports down by tapping the "move-window-down"
combination.

This patch fixes this so that a window moved that owns the focus will
continue to own the focus.

I've been sitting on this patch for a while -- I thought I checked it
in to the bug tracker, but apparently not, since I can't find it.  :-(

As an aside, I know that the status of viewport support has been, uh,
a bit shaky, since the GNOME folks have come down firmly in favor of
workspaces.  I just wanted to let sawfish-list folks know that there's
another person out there who likes and depends on viewports, and would
hate to see viewport operation go away.

Thanks for a great window manager!

-- 
Best of luck,
Mark Schreiber
--- /home/schreib1/main/dev/cvs/sawfish/lisp/sawfish/wm/viewport.jl	2002-04-22 23:44:18.000000000 -0400
+++ viewport.jl	2004-09-19 02:21:46.834916516 -0400
@@ -262,11 +262,13 @@
   ;; viewport that is relative those offsets to the current viewport.
   (define (move-window-to-viewport-and-move-viewport window col row)
     (require 'sawfish.wm.util.stacking)
-    (let ((sticky-viewport (window-get window 'sticky-viewport)))
+    (let ((had-focus (= (input-focus) window))
+          (sticky-viewport (window-get window 'sticky-viewport)))
       (window-put window 'sticky-viewport t)
       (with-server-grabbed
        (raise-window* window)
-       (move-viewport col row))
+       (move-viewport col row)
+       (if had-focus (set-input-focus window) ()))
       (unless sticky-viewport
 	(window-put window 'sticky-viewport nil))))
 

Attachment: pgpPdWiRNFeeS.pgp
Description: PGP signature



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