[Thunar-dev] ThunarDesktopView managing multiple GdkScreens

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Sat Jul 9 18:54:12 CEST 2005


Brian J. Tarricone wrote:
> Benny,

Brian,

> I'm working through the ThunarDesktopView skeleton in your 20050629
> snapshot.  From what I can tell, your intention was that a single
> instance will manage a GdkDisplay, which means it may have several
> GdkWindows, each on a different GdkScreen.  Is there any particular
> reason why this is so?  There are a couple problems/oddities I see with
> this approach:
> 
> 1) Traditionally, GtkWidgets appear to have a single GdkWindow.
> GtkWidgets that have more than one GdkWindow all seem to have one single
> GdkWindow (widget->window) with the other GdkWindows as children of
> widget->window.  This is obviously not the case with ThunarDesktopView.
> 
> 2) My understanding is that a GtkWidget generally represents an object
> on a single logical screen.  One example of why I think this is so is
> gtk_widget_set_screen() - this function is meaningless and has undefined
> behavior when applied to ThunarDesktopView.
> 
> Is there something I'm missing?
> 
> If there isn't, and we can agree that a single ThunarDesktopView should
> correspond to a single screen, then I'd suggest another class,
> ThunarDesktopManager, which can keep track of these multiple
> ThunarDesktopViews.  ThunarDesktopManager would just derive from GObject.

I thought it'd be easier to have one single view object rather than 
having one view per screen. But thats just a guess. If it turns out to 
be easier to do one view per screen, then go for it. Indeed, it sounds 
more logic, since GtkWidget's are normally per-screen rather than 
per-display.

What's important is that, no matter if there's one view per display or 
one view per screen, there's only a single ThunarDesktopModel shared by 
all views.

> 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?

> 	-brian

greets,
Benedikt



More information about the Thunar-dev mailing list