-
-
Notifications
You must be signed in to change notification settings - Fork 551
fix: maximization on X11 #2824
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: maximization on X11 #2824
Conversation
Is it not enough to call neovide/src/window/window_wrapper.rs Line 413 in 6d0aa1a
According to this, it should work rust-windowing/winit#2360 (comment) We also have to be careful to not cause any artifacts which #2562 tries to fix. See the discussion there. Although it might be impossible in the case of maximization. |
I'm not very knowledgeable about X11 internals, but that was my first attempt and it doesn't seem to work, looks like it needs a rendering cycle with the window visible first. Please check out the updated code.
Thanks, I checked out your code and I agree with you, it looks like showing the window already maximized would not be feasible. There will be an artifact in the sense that the window will be maximized after it is made visible. Attaching an example below. Alacritty seems to do it without glitches and they do as you suggest |
Interestingly, when testing out this code: diff --git a/src/window/window_wrapper.rs b/src/window/window_wrapper.rs
index 39b57a0..0e821dd 100644
--- a/src/window/window_wrapper.rs
+++ b/src/window/window_wrapper.rs
@@ -410,8 +410,16 @@ impl WinitWindowWrapper {
}
skia_renderer.swap_buffers();
if self.ui_state == UIState::FirstFrame {
- skia_renderer.window().set_visible(true);
+ let window = skia_renderer.window();
+ window.set_visible(true);
self.ui_state = UIState::Showing;
+ let is_x11 = {
+ let handle = window.window_handle().unwrap().as_raw();
+ matches!(handle, RawWindowHandle::Xlib(_) | RawWindowHandle::Xcb(_))
+ };
+ if is_x11 {
+ window.set_maximized(true);
+ }
}
tracy_frame();
tracy_gpu_collect(); Works only when |
Does the latest version work without glitches? In that case I think it's good enough. |
@fredizzimo It is usable but still a bit glitchy, if you would like a temporary workaround it will work, otherwise feel free to close for now, when I have some free time I will hack on it some more. |
I'm putting this into draft status for now. I have to test it myself, and I also don't think I saw any problems on X11 on KDE Plasma before, so the original problem might be limited to some desktops/window managers only. |
Took a stab at a fix for #2657
What kind of change does this PR introduce?
Did this PR introduce a breaking change?