GNOME Bugzilla – Bug 97737
not setting _NET_WM_STATE_SKIP_{TASKBAR,PAGER} props
Last modified: 2004-12-22 21:47:04 UTC
Apparently metacity is not setting the _NET_WM_STATE_SKIP_TASKBAR and _NET_WM_STATE_SKIP_PAGER properties on the client window when the corresponding _NET_WM_STATE message is received. Using gkrellm-2.1.0 with metacity-2.4.0.92-5 (Red Hat 8.0) and toggling the "Do not include on a taskbar" or "Do not include on a pager" preferences (General prefs, Properties tab) does not work. As far as I can tell, gkrellm sends the _NET_WM_STATE message, but xprop shows that nothing is set in the _NET_WM_STATE property.
Created attachment 12059 [details] xprop output with gkrellm's do not include taskbar, pager options set
In principle fixed here: 2002-08-05 Ross Burton <ross@burtonini.com> * src/window.c: (meta_window_client_message): Set ->wm_state_skip_pager (ditto for _taskbar) instead of ->skip_pager so that these hints actually work. Fixes #89850.
Yes, I saw that bug report. However, that bug fix appears a day before 2.4.0 release in the changelog, so I guess the fix is present in Red Hat's metacity-2.4.0.92-5... but it does not work :-( Any ideas?
which version of gkrellm tries to set these props? can I get a copy of it?
gkrellm 2.1.0, from http://web.wt.net/~billw/gkrellm/gkrellm.html You can get a Red Hat 8.0 RPM from http://ltswww.epfl.ch/~dsanta/tmp/, but of course that does not allow for much debugging.
I'm going to mark this high, since it's possible that the patch in bug 89850 didn't work or something has broken this since that fix.
Turns out that 89850 fix was slightly wrong, but the main problem here is a gkrellm bug. Namely, gdk_atom_intern() doesn't return an Atom, it returns a GdkAtom. These were the same in GTK 1.2 but are not in GTK 2.0. So now with 2.0 it's necessary to use gdk_x11_get_xatom_by_name(). This needs to be fixed for both gdk_atom_intern() in winops-x11.c:net_wm_state() in gkrellm. Also, on startup gkrellm needs to set the _NET_WM_STATE property prior to mapping (gtk_window_show()) its window. Sending the client message won't work until the window manager is done managing the window, which means some undefined time after calling gtk_window_show().
I mailed the gkrellm author a pointer to this bug.
Sorry to keep bashing on this, but after the author modified the gkrellm source as explained above I cannot get it to work correctly. Specifically, toggling the skip {taskbar,pager} properties after startup does work now so the client messages are correctly sent. However, it seems that metacity ignores the _NET_WM_STATE property that it is set before the window is mapped and clobbers it with an empty value. I have placed an XSync(display,False);sleep(10); in gkrellm's source just before gtk_widget_show() of the top-level window so that I can read the properties before the metacity touches them. I attach next the result, but you can see that the _NET_WM_STATE property is set: _NET_WM_STATE(ATOM) = _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_SKIP_PAGER However, once the window is mapped it is _NET_WM_STATE(ATOM) = The metacity log also says "Setting _NET_WM_STATE with 0 atoms" but it never mentions that it reads the initial value. So it looks like metacity is ignoring the initial _NET_WM_STATE value of the window, or am I wrong? Or am I missing something about the use of _NET_WM_STATE? Running metacity-2.4.0.92-5 from RedHat 8.0.
Created attachment 12721 [details] xprop output of gkrellm window before it is mapped (i.e just before gtk_widget_show()).
Created attachment 12722 [details] metacity debug log concerning gkrellm window (id 0x800002)
Should be fixed in newer metacity. Ross fixed it August 5 and I fixed it more a while after that.
AFAIK, the version I'm running (metacity-2.4.0.92-5) includes the fix from Aug. 5, but not the later fix to the fix. I will probably test a more recent version when the 2nd fix appears in RedHat's rawhide (right now it's at 2.4.3-1).