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 <[email protected]>
---
 src/window.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/window.c b/src/window.c
index 6c538da..4dcfddb 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);
                }
        }
 
-- 
1.7.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to