[Thunar-dev] ThunarDesktopView managing multiple GdkScreens

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Sun Jul 10 12:36:28 CEST 2005


Brian J. Tarricone wrote:
> Benedikt Meurer wrote:
> 
>>>Brian J. Tarricone wrote:
>>>
>>>
>>>>In this case, it makes more sense to me - rather, it's just overall much
>>>>easier - to derive ThunarDesktopView from GtkWindow instead of
>>>>GtkWidget.  Setting up the window requires a bit of work that's pretty
>>>>much completely done for you with GtkWindow, though I suppose there is a
>>>>bit of overhead.  What do you think?
>>>
>>>I don't think GtkWindow offers any advantage here, because you'll have 
>>>to do custom create and size handling anyways. I don't see anything that 
>>>GtkWindow offers over GtkWidget that is required for desktop windows. 
>>>Maybe I'm missing something?
> 
> 
> The problem I keep running into is that GtkWindow does some things like:
> 
> GTK_PRIVATE_SET_FLAG(widget, GTK_ANCHORED);
> 
> which is defined in gtk/gtkprivate.h.  If you don't do this step, when
> you calll gtk_widget_show() on the ThunarDesktopView, you get a failure
> from gtk:
> 
> Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED
> (widget) || GTK_IS_INVISIBLE (widget)' failed
> 
> Calling gtk_widget_set_parent_window() (using the root window) doesn't
> seem to help.  Perhaps it's possible to get around this by overriding
> gtk_widget_show(), but my guess would be no, since this check happens in
> gtk_widget_realize().  Maybe calling stuff in gtk/gtkprivate.h is fine,
> but I'm a bit wary of relying on something called 'private'.
> 
> Anyway, I'll play around with it a bit more and see if I can't figure
> out a way to make it work without doing icky things.  Poring over the
> GtkWindow source will probably help ^_^.

Hm, indeed, this looks like it would be better to inherit GtkWindow 
rather than relying on gtkprivate.h (although I doubt that this flag 
will be removed in any upcoming Gtk version).

> 	-brian

Benedikt



More information about the Thunar-dev mailing list