Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the sliding down of the window due to the reparenting caused by the window manager decorations. #75709

Closed

Conversation

n0tank3sh
Copy link
Contributor

@n0tank3sh n0tank3sh commented Apr 5, 2023

It fixes the sliding down of the window due to the reparenting by the window manager which is done after mapping the window in X11.
fixes #75292 and many more. It also slows down the thread as it waits for the window manager to complete the decorations. It would be optimal to start a new thread that will execute this solution and then terminate itself. I would love to have the dev's opinion on this.
Edit: It also doesn't work if the window manager takes more time in decoration than the waiting time given which can be solved by increasing the waiting time but it also slows the program even more.
Edit: It also just slows down the tiling window manager as XMoveWindow does not affect them.
Edit: Another solution as discussed in the review with no delay #76040

DEBUG_LOG_X11("show_window: %lu (%u) \n", wd.x11_window, p_id);

XMapWindow(x11_display, wd.x11_window);
XSync(x11_display, False);
_validate_mode_on_map(p_id);
if (!wd.borderless && !wd.fullscreen && !wd.exclusive_fullscreen) {
usleep(50000); // waiting for the window-manager to compelete the decoration of the window
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has to be a better solution, I got the idea (and it should work in most cases), but relying on delay is not a robust thing.

Copy link
Contributor Author

@n0tank3sh n0tank3sh Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we can track the window's parent through notify configure sent by the window manager while decorating. I don't know if that will be optimal.

@YuriSizov
Copy link
Contributor

Superseded by #76040.

@YuriSizov YuriSizov closed this Apr 14, 2023
@n0tank3sh n0tank3sh deleted the fix-sliding-window-linux branch April 14, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows move downward by the height of their title bars each time they popup (DisplayServer regression)
4 participants