BrowserWindowOptions is not setting Width and Height properly #457

Closed
opened 2026-01-29 16:40:02 +00:00 by claunia · 2 comments
Owner

Originally created by @sachin-devitpl on GitHub (Feb 13, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

I have tried to set the exact Width and Height of the window from BrowserWindowOptions in the Startup.cs but it is not setting it properly. I have set like this -

            var options = new BrowserWindowOptions
            {
                Frame = false,
                Width = 1280,
                Height = 720
            };

but it is setting 1294 x 727 pixel
If I am not using Frame = false then it is generating proper output 1280 x 720 px but I think there is some issue with using both of this parameters.

Originally created by @sachin-devitpl on GitHub (Feb 13, 2020). Originally assigned to: @GregorBiswanger on GitHub. I have tried to set the exact Width and Height of the window from BrowserWindowOptions in the Startup.cs but it is not setting it properly. I have set like this - ``` var options = new BrowserWindowOptions { Frame = false, Width = 1280, Height = 720 }; ``` but it is setting 1294 x 727 pixel If I am not using `Frame = false` then it is generating proper output 1280 x 720 px but I think there is some issue with using both of this parameters.
claunia added the bug label 2026-01-29 16:40:02 +00:00
Author
Owner

@sachin-devitpl commented on GitHub (Feb 13, 2020):

Temporary work around is setting Max Width & Max Height

            var options = new BrowserWindowOptions
            {
                Width = 1280,
                Height = 720,
                Frame = false,
                MaxWidth = 1280,
                MaxHeight = 720,
            }
@sachin-devitpl commented on GitHub (Feb 13, 2020): Temporary work around is setting Max Width & Max Height ``` var options = new BrowserWindowOptions { Width = 1280, Height = 720, Frame = false, MaxWidth = 1280, MaxHeight = 720, } ```
Author
Owner

@GregorBiswanger commented on GitHub (Apr 19, 2020):

Fixed with the new Electron.NET Version 8.31.1.

@GregorBiswanger commented on GitHub (Apr 19, 2020): Fixed with the new Electron.NET Version 8.31.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#457