From 798d9c55dfaae46ab09e9176f5c3dd8fa21f478a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 3 Feb 2024 09:45:26 +0400 Subject: Support fullscreen for new windows --- src/layout/workspace.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/layout') diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 7324e93e..73a87376 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -330,6 +330,10 @@ impl Workspace { } } + pub fn view_size(&self) -> Size { + self.view_size + } + pub fn update_output_scale_transform(&mut self) { let Some(output) = self.output.as_ref() else { return; @@ -351,7 +355,7 @@ impl Workspace { )) } - pub fn configure_new_window(&self, window: &Window) { + pub fn new_window_size(&self) -> Size { let width = if let Some(width) = self.options.default_width { let mut width = width.resolve(&self.options, self.working_area.size.w); if !self.options.border.off { @@ -367,8 +371,11 @@ impl Workspace { height -= self.options.border.width as i32 * 2; } - let size = Size::from((width, max(height, 1))); + Size::from((width, max(height, 1))) + } + pub fn configure_new_window(&self, window: &Window) { + let size = self.new_window_size(); let bounds = self.toplevel_bounds(); if let Some(output) = self.output.as_ref() { @@ -1151,8 +1158,14 @@ impl Column { options, }; + let is_pending_fullscreen = window.is_pending_fullscreen(); + rv.add_window(window); + if is_pending_fullscreen { + rv.set_fullscreen(true); + } + rv } -- cgit