Re: Problem with sawfish and GNOME global menus



On Thu, 2010-12-23 at 01:28 +0200, Timo Korvola wrote:
> On Wednesday 22 December 2010 21:46:04 Harald van Dijk wrote:
> > Unfortunately, unlike the original patch, as it turns out this does
> > not actually work right. Both sawfish and the menu bar get very
> > confused when switching windows via the keyboard.
> 
> A quick test with xev shows that alt-tabbing generates focus change 
> events with modes NotifyWhileGrabbed and NotifyUngrab.  mode_to_sym in 
> events.c appears to be broken, not recognizing the former value (it does 
> not occur for crossing events).

Ah yes, you're right. Sometimes the little things are too easy to
overlook. Thanks, here's an updated patch that takes the approach of the
previous one, and also updates mode_to_sym.

Cheers,
Harald
diff --git a/lisp/sawfish/wm/state/wm-spec.jl b/lisp/sawfish/wm/state/wm-spec.jl
index 674cd9e..7402969 100644
--- a/lisp/sawfish/wm/state/wm-spec.jl
+++ b/lisp/sawfish/wm/state/wm-spec.jl
@@ -264,9 +264,9 @@
 
   (define last-focus nil)
 
-  (define (update-focus-state)
+  (define (update-focus-state w mode)
     (let ((focus (input-focus)))
-      (unless (eq last-focus focus)
+      (unless (or (eq mode 'grab) (eq mode 'ungrab) (eq last-focus focus))
 	(setq last-focus focus)
 	(set-x-property 'root '_NET_ACTIVE_WINDOW
 			(vector (if focus (window-id focus) 0)) 'WINDOW 32))))
diff --git a/src/events.c b/src/events.c
index 9b6a1db..a84f8d7 100644
--- a/src/events.c
+++ b/src/events.c
@@ -124,6 +124,7 @@ DEFSYM(dimensions, "dimensions");
 DEFSYM(normal, "normal");
 DEFSYM(grab, "grab");
 DEFSYM(ungrab, "ungrab");
+DEFSYM(whilegrabbed, "whilegrabbed");
 
 repv Fsynthetic_configure_mutex (repv);
 
@@ -917,7 +918,9 @@ mode_to_sym (int mode)
 {
     return (mode == NotifyNormal ? Qnormal
 	    : mode == NotifyGrab ? Qgrab
-	    : Qungrab);
+	    : mode == NotifyUngrab ? Qungrab
+	    : mode == NotifyWhileGrabbed ? Qwhilegrabbed
+	    : Qnil);
 }
 
 static void


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