[sugar] multiple gtk.Windows hide() and show()

Dan Winship dwinship
Mon Aug 27 17:16:46 EDT 2007


Erik Blankinship wrote:
> Let me explain what I am trying to achieve: I am creating a "picture in 
> a picture effect" (using XV in a window, amongst other windows).  GTK 
> doesn't play well with overlapping widgets, and gtk.Fixed() doesn't 
> guarantee Z-order.  So I am using a stack of gtk.Windows without 
> decoration to achieve the desired effect, but the appearance is that 
> everything looks like a nice gtk layout.

Sorry, got confused by your description; I thought you were trying to 
change stacking on the fly by swapping transient-fors around.

But anyway, you still have the problem that "transient for" doesn't 
actually mean anything having to do with stacking. (In fact, the ICCCM 
lists a bunch of things a window manager might do differently with 
transient windows, but stacking order isn't one of them.) So (1) setting 
transient-for on a window won't necessarily affect its stacking, and (2) 
it may affect it in ways other than stacking. (Eg, matchbox appears to 
assume that any window that has WM_TRANSIENT_FOR set is a dialog box.)

So your best bet is probably to make your own version of gtk.Fixed that 
does have a guaranteed Z-order, rather than trying to bend the wm to 
your will.

Marco says "I seem to remember blizzard wrote something like that for 
mozilla gtk2". You *might* also be able to get gtk.Fixed to work just by 
calling raise()/lower() on the child widgets' GdkWindows to stack them 
the way you want within the Fixed. (Or just by being sure to show() them 
in bottom-to-top order.)

-- Dan



More information about the Sugar-devel mailing list