transient windows with the gtk socket and plug mechanism
Andreas Lampersperger
a_lampersperger at web.de
Tue Apr 24 16:37:58 CEST 2007
Hello,
please write me your opinions to the following problem and the patch I provided:
I have encountered that the xfwm4 (ver 4.4.1) does not tread transient windows as transients when the gtksocket gtkplug mechanism is used. (Other window managers like kde does have the same problem).
test case: Use firefox and install adobe reader as a firefox plugin, so that pdf's are directly shown in the firefox window. If you click on "save a copy..." a "copy as"-dialog is shown. This dialog has the wm_hints transient and modal. If you now click on the pdf-window the "save-as" dialog is hidden by the firefox window and the adobe reader (within the firefox window) is not responding, which is imho a failure because of the transient and modal hints.
reason: the transient_for hint specifies the gtk-plug-window and this window is not registered by the xfwm as a "client"
solution: climbing up the x-window-tree from the gtk-plug-window to the gtk-socket-window to the firefox window and use this window as transient_for.
I made the necessary modifications to the file .../xfce-4.4.1/src/xfwm4-4.4.1/src/hints.c:
*** src/xfwm4-4.4.1/src/hints.c Sun Mar 11 14:44:43 2007
--- mod_src/xfwm4-4.4.1/src/hints.c Tue Apr 24 16:35:19 2007
***************
*** 629,638 ****
--- 629,678 ----
else if (*transient_for == w)
{
/* Very unlikely to happen, but who knows, maybe a braindead app */
*transient_for = None;
}
+ else
+ {
+ ScreenInfo * screen_info = myDisplayGetScreenFromWindow (display_info, w);
+ if ((screen_info) && (!clientGetFromWindow(screen_info, *transient_for, WINDOW)))
+ {
+ Window dummy_root, parent;
+ Window *wins = NULL;
+ unsigned int count;
+ Status test;
+ Window win = *transient_for;
+ TRACE ("transient-for-window (0x%lx) is not known, climbing x-tree...", *transient_for);
+ while (win)
+ {
+ test = XQueryTree(display_info->dpy, win, &dummy_root, &parent, &wins, &count);
+ if (wins) XFree (wins);
+
+ if ((parent) && (parent != win) && (test != 0) )
+ {
+ TRACE ("... climbing from window (0x%lx) up to window (0x%lx) ...", win, parent);
+ win = parent;
+ }
+ else
+ {
+ TRACE ("... end of x-tree, stop climbing");
+ break;
+ }
+
+ if (!clientGetFromWindow(screen_info, win, WINDOW))
+ {
+ TRACE ("... transient-for-window (0x%lx) is also not known, continue climbing...", win);
+ }
+ else
+ {
+ TRACE ("transient-for-window (0x%lx) was found", win);
+ *transient_for = win;
+ break;
+ }
+ }
+ }
+ }
}
else
{
*transient_for = None;
}
Greetings
Andreas
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
More information about the Xfce4-dev
mailing list