sawfish r4220 - in trunk: lisp/sawfish/wm/state src



Author: jkozicki
Date: Mon Feb 18 19:12:27 2008
New Revision: 4220
URL: http://svn.gnome.org/viewvc/sawfish?rev=4220&view=rev

Log:
Timo's patch - KDE tray fix 2:

Another KDE system tray fix. The diff is against 1.3.2. The essential content is the one-line change in wm-spec.jl but I am bundling it with some other cleanups.

As of 3.5.8, KDE has still not completely replaced their old wm-dependent system tray protocol with the freedesktop.org one. They just kluged it: KDE apps continue to use the old protocol, but a kded module called kdetrayproxy tries to perform the part of the wm in that protocol and docks the tray icons using the freedesktop.org protocol.

It turned out that kdetrayproxy watches for new windows not by monitoring MapNotify events but by monitoring changes in the _NET_CLIENT_LIST root window property. Sawfish added windows to that list at a very early stage, before they had even been decorated. The result was kdetrayproxy being confused by the events caused by Sawfish decorating the window and Sawfish being confused by interference from kdetrayproxy. This patch delays the update of _NET_CLIENT_LIST to map-notify-hook. At that time the new window is already mapped (unless it starts iconic - map-notify-hook is executed even in that case).

This patch also fixes a potential problem of reparent-notify-hook getting called with a removed window. I have never seen anyone use that hook though. I also modified unmap_notify so that removal of WM_STATE is the very last action there. That property change indicates to the client that we are done processing the window withdrawal. The client may then reuse the window, e.g., remap it.

You can also get this patch with Git from http://www.elisanet.fi/tkorvola/sawfish.git, branch kde-tray-fix-2. 



Modified:
   trunk/lisp/sawfish/wm/state/wm-spec.jl
   trunk/src/events.c

Modified: trunk/lisp/sawfish/wm/state/wm-spec.jl
==============================================================================
--- trunk/lisp/sawfish/wm/state/wm-spec.jl	(original)
+++ trunk/lisp/sawfish/wm/state/wm-spec.jl	Mon Feb 18 19:12:27 2008
@@ -630,7 +630,9 @@
     (add-hook 'workarea-changed-hook update-workspace-hints)
     (add-hook 'configure-notify-hook update-on-configure-notify)
 
-    (add-hook 'add-window-hook update-client-list-hints)
+    ; Better not expose work in progress.  map-notify-hook gets
+    ; called after this anyway.
+    ;(add-hook 'add-window-hook update-client-list-hints)
     (add-hook 'destroy-notify-hook update-client-list-hints)
     (add-hook 'map-notify-hook update-client-list-hints)
     (add-hook 'unmap-notify-hook update-client-list-hints)

Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c	(original)
+++ trunk/src/events.c	Mon Feb 18 19:12:27 2008
@@ -800,10 +800,15 @@
 	    w->reparented = FALSE;
 	    XRemoveFromSaveSet (dpy, w->id);
 
+            Fcall_window_hook (Qreparent_notify_hook,
+                               rep_VAL(w), Qnil, Qnil);
+
 	    /* Not us doing the reparenting. */
 	    remove_window (w, FALSE, FALSE);
 	}
-	Fcall_window_hook (Qreparent_notify_hook, rep_VAL(w), Qnil, Qnil);
+        else
+            Fcall_window_hook (Qreparent_notify_hook,
+                               rep_VAL(w), Qnil, Qnil);
     }
 }
 
@@ -888,14 +893,16 @@
 	}
 	Fcall_window_hook (Qunmap_notify_hook, rep_VAL(w), Qnil, Qnil);
 
-	XDeleteProperty (dpy, w->id, xa_wm_state);
-
 	/* Changed the window-handling model, don't let windows exist
 	   while they're withdrawn */
 	if (being_reparented)
 	    reparent_notify(&reparent_ev);
 	else
 	    remove_window (w, FALSE, FALSE);
+
+	/* This lets the client know that we are done, in case it wants
+	   to reuse the window. */
+	XDeleteProperty (dpy, ev->xunmap.window, xa_wm_state);
     }
 }
 



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