Re: parent_relative questions



Replying to myself (having gdb and source code is nice, but it takes a while to slog through!) --

It's the double-buffering that's initing the pixmap to black. Since the TOPLEVEL window has no parent gdk window, gdk_window_get_bg_gc returns the window's bgcolor to initialize the pixmap with in gdk_window_begin_paint_region. If I gtk_widget_set_double_buffered(widget, FALSE), then I no longer get black. Double buffering sure is a nice feature, though. Is there any way to wrap the root window in such a way that it could be a workable GdkWindow parent for the TOPLEVEL windows? Barring that, is there a way to set the parent window for a GdkWindow correctly so that I could create a window with the desired background and use it as a parent for multiple windows? gtk_window_new either makes a frame a parent or NULL the parent...

Thanks again,
--Brett


Brett Granger wrote:

Adding a little to my previous post, I have written a very simple X-only app that creates a 200x200 window and sets the background pixmap to ParentRelative and can see that it works as expected (well, almost. It actually sets the window background to be whatever's already on screen as opposed to refreshing with the root window's bg pixmap, but that's okay for what I'm doing). When I use gtk for the simple test program (code attached), I get a solid black window instead.

So something in GTK2.0 must be drawing black into the rectangle that's about to be occupied by the window even though it's "app paintable", and then that black is getting picked up by the window's background, defeating the purpose of the ParentRelative setting. That's assuming that the ParentRelative setting even took and the black isn't just X clearing the background to black because it thinks the window has no pixmap...

Anybody ever worked with this or have any thoughts as to how I avoid the black? GTK+-2.0.2 on XFree86 4.2.0.

Thanks again,
--Brett


Brett Granger wrote:


I've been experimenting with gdk_window_set_back_pixmap and the parent_relative flag under X. According to the X docs, setting a bg pixmap of ParentRelative should indicate that the background of this window is the appropriately offset pixmap of whatever's in the bg of the parent window. This seems like it might be yet another way to pretend to have transparent top level windows, since the background pixmaps should be tiled in such a way as to make the child fit right in over the parent.

The first thing I learned is that if I don't "gtk_widget_set_app_paintable" I still get the default gray background fill. However, when I set the window to be "app paintable" I would expect that I should see the bg pixmap that I have set in my root window (since the windows I am playing with are TOPLEVEL). Instead I get a solid black background, regardless of what's in the root window.

Has anybody else had any success with parent_relative windows and can anyone comment on whether I really can achieve a fake transparency with toplevel windows in this way? I'm using GTK2.0.

Thanks in advance!
--Brett

ps. directfb is not an option for us, which is why I thought I'd try it this way...

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]