I am trying to build a window manager (as hobby project). I have the basic taskbar implemented as a window which is positioned at the bottom of the screen. However, I can raise other windows above it. Ideally the taskbar would stay at the top no matter what. I thought simply raising it every time it is not at the top would be fine, but I read it can cause issues with two windows attempting to fight for the top position.

Is there a preferred xlib way to ensure the taskbar remains at the topmost position (and all windows go behind it when being dragged)?

  • Unfortunately, no. My window manager is not yet EWMH compliant so the _NET_WM_STRUT property will not work. Although, do you recommend I remove this question and instead ask about the best way to implement the _NET_WM_STRUT property? Currently, I just have a list of windows that need to be raised ordered by priority. Works well enough for now.
    – Eshy
    Commented Oct 29, 2022 at 2:47

1 Answer 1


To solve this issue, I decided to disallow other windows from trying to raise themselves. When they do so I make sure they are raised and the taskbar is raised immediately afterward, if they send repeated requests (in an attempt to remain at the top) I simply ignore the requests.

To handle maximization and stuff, I use a display_width and display_height variable to represent the width and height of the usable display. It used to be screen, but now it is usable display. The usable display compensates for the taskbar at the bottom by subtracting the taskbar height from the display height.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .