From b16181143ce9ef3a32f74363308f0a3bc8e30842 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 5 Oct 2010 16:15:14 -0400 Subject: [PATCH] Fix stuck appicon from embedded apps When applications are embedded in firefox via mozplugger, e.g. ooffice for viewing .doc files or xpdf for viewing pdfs, and the embedded application opens a popup window, we end up with a shared appicon for the embedded app that remains until Window Maker is restarted. The underlying cause is that mozplugger winds up reparenting the embedded app's original leader window to a subwindow of itself, so wmaker's SubstructureNotifyMask on the root window no longer picks up the DestroyNotify when that original leader is destroyed. It seems easy to fix once you track down the problem: when fixing several other properties in fixLeaderProperties(), add StructureNotifyMask so we get DestroyNotify no matter where the leader gets reparented to. A more targeted fix would only add StructureNotifyMask when the fake group's origLeader is set, but I don't think a few extra structure notifications are going to cause us any real problems. Signed-off-by: Brad Jorsch --- src/window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/window.c b/src/window.c index 6c538da1..4dcfddb6 100644 --- a/src/window.c +++ b/src/window.c @@ -462,6 +462,7 @@ static void fixLeaderProperties(WWindow *wwin) { XClassHint *classHint; XWMHints *hints, *clientHints; + XWindowAttributes attr; Window leaders[2], window; char **argv, *command; int argc, i, pid; @@ -515,6 +516,10 @@ static void fixLeaderProperties(WWindow *wwin) XSetCommand(dpy, window, argv, argc); } } + + /* Make sure we get notification when this window is destroyed */ + if (XGetWindowAttributes(dpy, window, &attr)) + XSelectInput(dpy, window, attr.your_event_mask | StructureNotifyMask); } }