Keeping X11 window on top of another window

2019-06-20 23:18发布

I have two x11 windows which need to maintain a certain stacking order between each other, namely one window needs to stay above the other. I don't care about other windows outside the application. Normally, I would use a parent/child for this, but since X11 clips the child window to the parent, I have to fake it. I've tried various methods to keep and/or adjust the window stack to maintain the proper order. However, the WM is ignoring pretty much everything except for XRaiseWindow() which is too brute force and causes problems for other windows.

So the question is how do I set the stacking between two windows, or is there a way to set a parent/child that doesn't result in the parent clipping the child?

标签: linux x11
1条回答
闹够了就滚
2楼-- · 2019-06-20 23:42

Yes, you can use the WM_TRANSIENT_FOR Window property to make the (transient) parent appear behind the child without clipping it. Qt uses it internally, you can grep its sources for an example usage.

See also this answer by cap.

查看更多
登录 后发表回答