Movable GtkWindow with "desktop" type hint

Viewed 266

I am currently trying to make a window stick in the background and not be iconifiable. My window is undecorated, but has a custom header, so it's still dragable and resizable.

This behavior is achieved using this code:

win.SetKeepBelow(true)

win.Connect("window-state-event", func(window *gtk.Window, event *gdk.Event) {
    windowEvent := gdk.EventWindowStateNewFromEvent(event)
    newWindowState := windowEvent.NewWindowState()

    if (newWindowState & gdk.WINDOW_STATE_ICONIFIED) == gdk.WINDOW_STATE_ICONIFIED {
        window.Present()
    }
})

However, this way of doing it is very unreliable.

The proper way to achieve this behavior seems to be:

win.SetTypeHint(gdk.WINDOW_TYPE_HINT_DESKTOP)

The problem with that approach is, that the window becomes unresizable and unmovable.

So, how can i either make the window resizable and movable again or at least improve my own unreliable approach?

0 Answers
Related