Skip to content

Fixed workspace stacking for future always on top support#227

Open
a0405u wants to merge 2 commits into
JLErvin:masterfrom
a0405u:fix/restack-inconsistency
Open

Fixed workspace stacking for future always on top support#227
a0405u wants to merge 2 commits into
JLErvin:masterfrom
a0405u:fix/restack-inconsistency

Conversation

@a0405u

@a0405u a0405u commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

I redone everything I've mentioned in the previous pull request from scratch and closed it. I made a new function restack_ws() that restacks all windows on the workspace and makes their order on screen consistent with the client list in our WM. It uses XRestackWindows() as your original solution.

The issue with original function was in that it was called on absent decorations (if they are disabled or an undecorated window is present, like the fullscreen one). In that situation X was probably giving BadMatch errors which are silent and does not restack properly. I made it work for present windows and decorations only.

I removed unnecessary client_move_to_front() which doubles the client_raise() functionality. Now every client_raise() call makes sure that our WM is in line with X.

This helps to solve issues with focusing/raising windows when fullscreen window is present on screen and other potential issues of client_raise() not updating the client stack. The solution in the previous pull request which uses XRaiseWindow() might work but I encountered issues with blinking windows, and most importantly, it had bad scalability for future implementation of always on top windows which I'm working on.

@a0405u

a0405u commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

Removed unnecessary client_raise() inside of client_show() which caused broken window order on switch_ws() call because of incorrect window raise order. Windows were risen starting from top to bottom, which caused the reverse order. Not sure if it was caused by my changes or if it was an issue before that.

@a0405u

a0405u commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

As it turned out this also helps with the unmanaged windows that have override_redirect property to stay always on top. If we used XRaiseWindow() as in my previous solution and in the part of the original code, it raises the window on top of everything including override_redirect windows, which should stay always on top and be unmanaged by the WM.

I saw this issue with dmenu previously, when you had a non decorated window on screen (for example a fullscreen one), the original code was raising it simply with XRaiseWindow() which made this window overlap dmenu which is not managed by the WM and is override_redirect. Same issue appeared when I tried to solve the issue by removing XRestackWindows() completely and changing it to XRaiseWindow().

I actually lost a lot of time trying to make my own app to be unmanaged by WM and always on top but it turned out the the issue was not the in the app but in the WM. Thankfully, all of this is now solved.

Nabile-Rahmani added a commit to Nabile-Rahmani/berry that referenced this pull request Mar 20, 2026
…gh screen lockers)

Always prepend an oldest fake window managed by berry to inherit its lower stacking order to ensure the WM doesn't draw above unmanaged windows.

Fixes JLErvin#231 (https://www.jwz.org/xscreensaver/faq.html#popup-windows)

Depends on JLErvin#227
@a0405u

a0405u commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

Some issues of this pull request are fixed in #229, so they should be merged together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant