add minimum window size

macos-click-through
Keith Simmons 3 years ago
parent 18f9ae5dac
commit 4515aa5a61

@ -74,8 +74,6 @@ impl Handler for NeovimHandler {
ui_command_sender.send(UiCommand::UnregisterRightClick).ok(); ui_command_sender.send(UiCommand::UnregisterRightClick).ok();
} }
_ => {} _ => {}
}) });
.await
.ok();
} }
} }

@ -43,6 +43,9 @@ use renderer::SkiaRenderer;
static ICON: &[u8] = include_bytes!("../../../assets/neovide.ico"); static ICON: &[u8] = include_bytes!("../../../assets/neovide.ico");
const MIN_WINDOW_WIDTH: u64 = 15;
const MIN_WINDOW_HEIGHT: u64 = 6;
pub struct GlutinWindowWrapper { pub struct GlutinWindowWrapper {
windowed_context: WindowedContext<glutin::PossiblyCurrent>, windowed_context: WindowedContext<glutin::PossiblyCurrent>,
skia_renderer: SkiaRenderer, skia_renderer: SkiaRenderer,
@ -205,6 +208,12 @@ impl GlutinWindowWrapper {
.renderer .renderer
.grid_renderer .grid_renderer
.convert_physical_to_grid(new_size); .convert_physical_to_grid(new_size);
// Have a minimum size
if grid_size.width < MIN_WINDOW_WIDTH || grid_size.height < MIN_WINDOW_HEIGHT {
return;
}
if self.saved_grid_size == Some(grid_size) { if self.saved_grid_size == Some(grid_size) {
trace!("Grid matched saved size, skip update."); trace!("Grid matched saved size, skip update.");
return; return;

Loading…
Cancel
Save