Gtk4 set window hint to utility or dock

How do I set window hint in gtk4. Especially in gtk4-rs

See the functions in gdk4_x11::X11Surface to set hints. You will have to downcast the GdkSurface to a X11Surface, and this will only work if using X11.

fn set_hint(surface: &gdk::Surface) {
    if let Ok(surface) = surface.downcast::<gdk4_x11::X11Surface>() {
        surface.set_skip_taskbar_hint(true);
    }
}

But this won’t set _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK

You can call xid on an X11Surface to get the underlying X11 window if you want to do xlib stuff

Gdk4 generally expects you to use platform-specific calls when doing platform-specific stuff, if nothing else to avoid confusion when a call becomes a noop on other platforms (as much of the old GdkWindow API did)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.