XFWM4 Window Problems, Part Deux

Milosz Derezynski internalerror at gmail.com
Wed Nov 15 22:02:15 CET 2006


Ir ewrote this entire code right after the ML post, i just wanted to (still
want to..) understand why this behaves differently on XFWM4.

As for the code: I'm not counting at all anymore on _present() (and depend
on that it calls deiconfiy() or not), but to rather just use
iconify()/deiconify() themselves directly, and handle everything additional
in window-state-event (in the case of "trayconification", call _present() on
deiconification as well in addition to clearing the skip-taskbar/pager
hints, or set the skip hints when trayconification is enabled).

This mechanism is less intrusive and results in an equally working behaviour
on all WMs (which i've tested..)


On 11/15/06, Olivier Fourdan <fourdan at xfce.org> wrote:
>
>
>
> Milosz,
>
> Sorry, I was wrong, the problem doesn't lie in gtk+ at all. It's in your
> program. Let me explain, if you will...
>
> Problem:
> ========
>
> With your given sample program, the window application sometime shows
> mapped, sometime it appears iconified.
>
> Characterization:
> =================
>
> There is a race condition between the application and the window manager.
> That's why it's not 100% reproducible, even between different window
> managers.
>
> The scenario of events, as they occur in time:
>
> 1) the user iconifies the window,
> 2) The window manager unmaps the frame and then the client window,
> 3) The application unmaps the window, again, with on_window_state_event()
> callback
>    line 62: gtk_widget_hide (widget);
>    => It's where the race condition occurs, depending on which unmap event
> reaches the X server first.
> 4) The timeout occurs present_window () gets called, and the application
> invokes gtk_window_present (window);
> 5) The window manager remaps the frame and the client window,
> unfortuantely, the widget could be unmapped, and then the window shows
> hidden.
>
> Fix
> ===
>
> Either call gtk_widget_show () in present_window () to remap the widget or
> avoid calling gtk_widget_hide (); in on_window_state_event (). Both methods
> work and avoid the nasty race condition that occurs in your code.
>
> Sample program fixed attached.
>
> I hope you can understand and accept this explanation. Race conditions are
> quite common in the X11 world...
>
> Cheers,
> Olivier.
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20061115/fd10c2b3/attachment.html>


More information about the Xfce4-dev mailing list