From f38f82917d998f6a6c826a2016bee7f63539446a Mon Sep 17 00:00:00 2001 From: Lawtro <98205608+Lawtro37@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:42:29 +1000 Subject: [PATCH 1/7] Re-implement the removed set_size function I think this was accidentally removed. --- src/browser_window.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/browser_window.rs b/src/browser_window.rs index e82b1eb..439ef16 100644 --- a/src/browser_window.rs +++ b/src/browser_window.rs @@ -512,6 +512,20 @@ impl BrowserWindow { #[napi] /// Sets the window inner size (width and height). + pub fn set_size(&self, width: u32, height: u32, logical: Option) { + if let Some(logical) = logical { + if logical { + self.window.set_inner_size(LogicalSize::new(width, height)); + } else { + self.window.set_inner_size(PhysicalSize::new(width, height)); + } + } else { + self.window.set_inner_size(PhysicalSize::new(width, height)); + } + } + + #[napi] + /// Sets the min window inner size (width and height). pub fn set_min_size(&self, width: u32, height: u32, logical: Option) { if width == 0 && height == 0 { self.window.set_min_inner_size(None::); From 2539e062a651d2898960f95278efafda269ffd35 Mon Sep 17 00:00:00 2001 From: Lawtro <98205608+Lawtro37@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:45:36 +1000 Subject: [PATCH 2/7] reimplement setSize() --- js-bindings.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js-bindings.d.ts b/js-bindings.d.ts index 64e2c89..79c75e0 100644 --- a/js-bindings.d.ts +++ b/js-bindings.d.ts @@ -49,6 +49,8 @@ export declare class BrowserWindow { setMinimizable(minimizable: boolean): void setResizable(resizable: boolean): void /** Sets the window inner size (width and height). */ + setSize(width: number, height: number, logical?: boolean | undefined |null): void + /** Sets the min window inner size (width and height). */ setMinSize(width: number, height: number, logical?: boolean | undefined | null): void /** Gets the window inner size. */ getInnerSize(logical?: boolean | undefined | null): Dimensions From 42b088d917713af989265160b42367f3e53acaa7 Mon Sep 17 00:00:00 2001 From: Lawtro <98205608+Lawtro37@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:59:56 +1000 Subject: [PATCH 3/7] Add set_outer_size() function for completeness --- src/browser_window.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/browser_window.rs b/src/browser_window.rs index 439ef16..fa30336 100644 --- a/src/browser_window.rs +++ b/src/browser_window.rs @@ -524,6 +524,20 @@ impl BrowserWindow { } } + #[napi] + /// Sets the window outer size (width and height). + pub fn set_outer_size(&self, width: u32, height: u32, logical: Option) { + if let Some(logical) = logical { + if logical { + self.window.set_outer_size(LogicalSize::new(width, height)); + } else { + self.window.set_outer_size(PhysicalSize::new(width, height)); + } + } else { + self.window.set_outer_size(PhysicalSize::new(width, height)); + } + } + #[napi] /// Sets the min window inner size (width and height). pub fn set_min_size(&self, width: u32, height: u32, logical: Option) { From 412780ff3177772ecc75d8d7801c962512cccaad Mon Sep 17 00:00:00 2001 From: Lawtro <98205608+Lawtro37@users.noreply.github.com> Date: Sun, 21 Jun 2026 21:01:15 +1000 Subject: [PATCH 4/7] Add setOuterSize() to javascript bindings --- js-bindings.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js-bindings.d.ts b/js-bindings.d.ts index 79c75e0..05493f2 100644 --- a/js-bindings.d.ts +++ b/js-bindings.d.ts @@ -50,6 +50,8 @@ export declare class BrowserWindow { setResizable(resizable: boolean): void /** Sets the window inner size (width and height). */ setSize(width: number, height: number, logical?: boolean | undefined |null): void + /** Sets the window outer size (width and height). */ + setOuterSize(width: number, height: number, logical?: boolean | undefined |null): void /** Sets the min window inner size (width and height). */ setMinSize(width: number, height: number, logical?: boolean | undefined | null): void /** Gets the window inner size. */ From abd2ce74ec578938df1cd47ab9ce834a6a2e7b77 Mon Sep 17 00:00:00 2001 From: Lawtro Date: Sun, 21 Jun 2026 21:32:14 +1000 Subject: [PATCH 5/7] Revert "Add set_outer_size() function for completeness" I realy should have tested if this was actual a thing. --- src/browser_window.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/browser_window.rs b/src/browser_window.rs index fa30336..439ef16 100644 --- a/src/browser_window.rs +++ b/src/browser_window.rs @@ -524,20 +524,6 @@ impl BrowserWindow { } } - #[napi] - /// Sets the window outer size (width and height). - pub fn set_outer_size(&self, width: u32, height: u32, logical: Option) { - if let Some(logical) = logical { - if logical { - self.window.set_outer_size(LogicalSize::new(width, height)); - } else { - self.window.set_outer_size(PhysicalSize::new(width, height)); - } - } else { - self.window.set_outer_size(PhysicalSize::new(width, height)); - } - } - #[napi] /// Sets the min window inner size (width and height). pub fn set_min_size(&self, width: u32, height: u32, logical: Option) { From af7e02026769d0a3a3a062330d49dadb5155e99a Mon Sep 17 00:00:00 2001 From: Lawtro Date: Sun, 21 Jun 2026 21:42:23 +1000 Subject: [PATCH 6/7] Revert "Add setOuterSize() to javascript bindings" --- js-bindings.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/js-bindings.d.ts b/js-bindings.d.ts index 05493f2..79c75e0 100644 --- a/js-bindings.d.ts +++ b/js-bindings.d.ts @@ -50,8 +50,6 @@ export declare class BrowserWindow { setResizable(resizable: boolean): void /** Sets the window inner size (width and height). */ setSize(width: number, height: number, logical?: boolean | undefined |null): void - /** Sets the window outer size (width and height). */ - setOuterSize(width: number, height: number, logical?: boolean | undefined |null): void /** Sets the min window inner size (width and height). */ setMinSize(width: number, height: number, logical?: boolean | undefined | null): void /** Gets the window inner size. */ From e49a7cb5d9a0f5b8733e9f749c1fdba5a1bc886a Mon Sep 17 00:00:00 2001 From: Lawtro <98205608+Lawtro37@users.noreply.github.com> Date: Sun, 21 Jun 2026 21:52:51 +1000 Subject: [PATCH 7/7] use "request_inner_size()" as we are using winit now --- src/browser_window.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/browser_window.rs b/src/browser_window.rs index 439ef16..499ffc8 100644 --- a/src/browser_window.rs +++ b/src/browser_window.rs @@ -515,12 +515,12 @@ impl BrowserWindow { pub fn set_size(&self, width: u32, height: u32, logical: Option) { if let Some(logical) = logical { if logical { - self.window.set_inner_size(LogicalSize::new(width, height)); + self.window.request_inner_size(LogicalSize::new(width as f64, height as f64)); } else { - self.window.set_inner_size(PhysicalSize::new(width, height)); + self.window.request_inner_size(PhysicalSize::new(width, height)); } } else { - self.window.set_inner_size(PhysicalSize::new(width, height)); + self.window.request_inner_size(PhysicalSize::new(width, height)); } }