Re: _NET_WM_STATE and gdk_property_change



On Tue, 2004-06-22 at 12:48, Leonardo Quijano Vincenzi wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello.
> 
> I'm using GTK 2.2, and I need to make an 'always on top' app. I checked
> out the doc and I found out the gtk_window_set_keep_above() function,
> but that's only for GTK 2.4 :(.
> 
> So, how do I do that on GTK 2.2? I checked out the source code for this
> function, but it uses XSendEvent and other X things that I'd rather not
> use unless is strictly necessary. I tried using gdk_property_change,
> like this:
> 
> ~    GdkAtom wm_state[3];
> ~    wm_state[0] = (GdkAtom) 1; /* _NET_WM_STATE_ADD */
> ~    wm_state[1] = gdk_atom_intern("_NET_WM_STATE_ABOVE", FALSE);
> ~    wm_state[2] = 0;
> 
> ~    gtk_widget_realize(main_window.window);
> ~    gdk_property_change(
> ~        main_window.window->window,
> 		gdk_atom_intern("_NET_WM_STATE", FALSE),
> 		gdk_atom_intern("ATOM", FALSE),
> 		32, GDK_PROP_MODE_REPLACE,
> 		(guchar *) &wm_state, 1);
> 
> But this isn't working. I don't know if the problem is on the
> gdk_property_change parameters, the wm_state array, or even if I can't
> really use this function. I'd really like to keep using GDK instead of
> directly Xlib. But any pointers would be appreciated.
> 
> Thanks!

The most straightforward thing would be upgrading to 2.4...




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