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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ pub fn create_window(
Some(PersistentWindowSettings::Windowed { position, .. }) => Some(position),
_ => None,
};
#[cfg(target_os = "linux")]
let maximized = matches!(window_settings, Some(PersistentWindowSettings::Maximized))
|| cmd_line_settings.geometry.maximized;
// Unfortunately we can't maximize here, because winit shows the window momentarily causing
// flickering
#[cfg(not(target_os = "linux"))]
let maximized = false;

log::trace!("Settings initial_window_size {:?}", initial_window_size);
log::trace!("Settings initial_window_size {initial_window_size:?} maximized {maximized:?}");

// NOTE: For Geometry, the window is resized when it's shown based on the font and other
// settings.
Expand All @@ -156,9 +163,7 @@ pub fn create_window(
.with_title("Neovide")
.with_window_icon(Some(icon))
.with_inner_size(inner_size)
// Unfortunately we can't maximize here, because winit shows the window momentarily causing
// flickering
.with_maximized(false)
.with_maximized(maximized)
.with_transparent(true)
.with_visible(false);

Expand Down
Loading