Hi,
In my gtk4 app, I’m trying to set a couple of hints in _NET_WM_STATE
, viz.
_NET_WM_STATE_STICKY
_NET_WM_STATE_BELOW
_NET_WM_STATE_SKIP_PAGER
_NET_WM_STATE_SKIP_TASKBAR
Setting _NET_WM_STATE_STICKY
works beautifully out-of-the-box. _NET_WM_STATE_BELOW
was disregarded by fvwm3, until I added
Style * EWMHUseStackingOrderHints
to ~/.fvwm/config.
But I cannot figure out why _NET_WM_STATE_SKIP_PAGER
& _NET_WM_STATE_SKIP_TASKBAR
are getting ignored.
(I’m checking the state with xprop | grep _NET_WM_STATE
.)
Here’s the fn I use, I think it’s correct, but just for the reference:
// net_wm_state_set_prop(win, "_NET_WM_STATE_STICKY", 1);
void net_wm_state_set_prop(GtkWidget *win, char *prop, int state) {
Display *dpy = GDK_SURFACE_XDISPLAY(GDK_SURFACE(gtk_native_get_surface(GTK_NATIVE(win))));
Window id = GDK_SURFACE_XID(GDK_SURFACE(gtk_native_get_surface(GTK_NATIVE(win))));
XClientMessageEvent msg = {
.type = ClientMessage,
.display = dpy,
.window = id,
.message_type = XInternAtom(dpy, "_NET_WM_STATE", False),
.format = 32,
.data = {
.l = {
state,
XInternAtom(dpy, prop, False),
None,
1,
0
}
}
};
if (!XSendEvent(dpy, XRootWindow(dpy, XDefaultScreen(dpy)), False,
SubstructureRedirectMask|SubstructureNotifyMask,
(XEvent*)&msg))
g_warning("net_wm_state_set_prop %s=%d failed", prop, state);
}
$ fvwm3 --version
fvwm3 1.0.7 (released)
with support for: ReadLine, XPM, PNG, SVG, Shape, XShm, SM, Bidi text, XRandR, XRender, XCursor, XFT