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: Maximize window on creation on linux #2454

Closed
wants to merge 1 commit into from

Conversation

agraven
Copy link
Contributor

@agraven agraven commented Mar 30, 2024

The code notes a flickering issue when creating the window in a maximized state, but I haven't been able to reproduce this flicking on any Linux environment. I tested GNOME, KDE, and sway, and none of them exhibited any flickering. I therefore changed the behavior so that the window is maximized on creation in accordance with persistent window settings or config file/command.

This also resolves the mild annoyance of the window existing in a blank, non-maximized state for a short while before initialization is finished, since set_visible has no effect on Wayland

TODO: More X11 testing

What kind of change does this PR introduce?

  • Fix

Did this PR introduce a breaking change?

  • No

Create the window in a maximized state instead of applying maximization
after the fact on Linux
@fredizzimo
Copy link
Member

The reason why it's not maximized on creation, is because it creates a very noticeable white flash on Windows. There's a bug in winit that shows the window for one frame when set to hidden and maximized.

But even if we disable this on Windows, and merge your PR, it will only be a temporary fix, so I'm not sure if it's worth merging.

The next version of Winit will require us to create the window inside the event loop which also fixes some macOS bugs in the current version. So, our plan is to run the event loop and Neovim event processing without a window initially, and only create the window when it's time to show. That's the same place as our current code sets it as visible. That way we can create the window with the correct flags and attributes without any flickering.

Would you want to work on that instead?

@agraven
Copy link
Contributor Author

agraven commented Mar 30, 2024

Sure thing, that definitely seems like a more ideal solution. I also managed to reproduce an unpleasant visual artifact when testing on plasma and gnome on X11, so for this to even make sense it would also require a runtime check that neovide is running under wayland, at which point this workaround becomes far more trouble than it's worth.

@Theaninova
Copy link
Contributor

Interesting, this is actually also a kinda bad issue on tiling WMs (such as Hyprland) as the short while before the window is maximized makes the WM think it's a manual maximize request and overrides the normal behaviour of launching it tiled.

In my case I worked around it by forcing Neovide to never be allowed to be maximized with a window rule like this suppressevent maximize,class:^(neovide)$, but it's not a great solution.

@fredizzimo
Copy link
Member

Since #2562 is now merged, I think we can close this one.

@fredizzimo fredizzimo closed this May 19, 2024
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.

None yet

3 participants