Draw on the root window?
Hi all, I'm trying to draw several widgets on the root window. I've been trying to get this to work for a while now. Someone pointed me (and I seem to end up everytime) at this thread: http://mail.gnome.org/archives/gtk-list/2000-August/msg00227.html However that seems to be gtk+ 1.x related. I've tried to modify the code to work with gtk+ 2.x, but all it seems to do right now is draw all the widgets in a seperate window (managed seperately by the window manager and they won't even accept input properly) Currently the code looks like this: // Create the window GdkWindow *gdkRootWindow = gdk_get_default_root_window(); topLevelWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_realize(topLevelWindow); gdk_window_unref(topLevelWindow->window); topLevelWindow->window = gdk_window_ref(gdkRootWindow); gdk_window_set_user_data(gdkRootWindow, browser->topLevelWindow); // Create the other widgets topLevelVBox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(topLevelWindow), topLevelVBox); ... As said above this doesn't seem to work. The thread mentioned above also includes some calls to catch expose events, I probably don't need those though, I want to have it act like a normal window. Help would really be appreciated, I've looked all over but I have no idea how to do it. :) -- G-LiTe ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Draw on the root window?
* [rSu]G-LiTe ([EMAIL PROTECTED]) wrote: > Hi all, > > I'm trying to draw several widgets on the root window. > I've been trying to get this to work for a while now. Someone pointed me > (and I seem to end up everytime) at this thread: > http://mail.gnome.org/archives/gtk-list/2000-August/msg00227.html > > However that seems to be gtk+ 1.x related. I've tried to modify the code > to work with gtk+ 2.x, but all it seems to do right now is draw all the > widgets in a seperate window (managed seperately by the window manager > and they won't even accept input properly) Have you checked out the Wheelbarrow example in the examples directory? I think it *might* answer some of your questions. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: Draw on the root window?
Well, the wheelbarrow is just a normal, but shaped, window. It's not exactly what I want, I'm trying to draw on the root window. What I'm writing is going to cover the entire root window and should always be in the background. I could use a normal window but not all window managers support keeping a window in the background as far as I know. That's why I'm using this approach. It'd be very nice if I could get it to work. Carl B. Constantine wrote: >* [rSu]G-LiTe ([EMAIL PROTECTED]) wrote: > >>Hi all, >> >>I'm trying to draw several widgets on the root window. >>I've been trying to get this to work for a while now. Someone pointed me >>(and I seem to end up everytime) at this thread: >>http://mail.gnome.org/archives/gtk-list/2000-August/msg00227.html >> >>However that seems to be gtk+ 1.x related. I've tried to modify the code >>to work with gtk+ 2.x, but all it seems to do right now is draw all the >>widgets in a seperate window (managed seperately by the window manager >>and they won't even accept input properly) > > >Have you checked out the Wheelbarrow example in the examples directory? >I think it *might* answer some of your questions. > ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Draw on the root window?
On Sat, Mar 08, 2003 at 01:14:06AM +0100, [rSu]G-LiTe wrote: > Well, the wheelbarrow is just a normal, but shaped, window. It's not > exactly what I want, I'm trying to draw on the root window. What I'm > writing is going to cover the entire root window and should always be in > the background. I could use a normal window but not all window managers > support keeping a window in the background as far as I know. That's why > I'm using this approach. It'd be very nice if I could get it to work. > You're way better off just creating a big background window as Nautilus and kdesktop do. Both GNOME and KDE use that approach, the root window approach is quite hard to do (and has unfixable issues) even if you know a heck of a lot about X and GDK. Most WMs that are actively developed support it these days. Havoc ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Draw on the root window?
Most blackbox based window managers don't. ;) Ah well. I sortof thought the same. I'll just try to use one big window and see if I can get it to go in the background anyways. If anyone however knows how to do this, please reply, as in my opinion it's the best way to do it and I'd like to do it that way if possible. Havoc Pennington wrote: You're way better off just creating a big background window as Nautilus and kdesktop do. Both GNOME and KDE use that approach, the root window approach is quite hard to do (and has unfixable issues) even if you know a heck of a lot about X and GDK. Most WMs that are actively developed support it these days. Havoc ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list