You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes to isMaximized implementation recently have made reporting of isMaximized worse as they do not use standard operating system calls to determine the window state. Maximizing a window using the windows system menu, or using WIN + Up Arrow will always return isMaximized() false.
Should return true when the window has been maximized by the operating system
Actual Behavior
Returns false
To Reproduce
Enter the code above into a file named main.js and execute with
electron main.js
maximize the window using "alt+space" menu and select maximize, or use "WIN+Up Arrow" shortcut
Additional Information
Replacing the implementations on BrowserWindow with calls to native operating system APIs via a NAPI extension fixes this issue for me. I'd love to understand why electron does not use these standard calls as the code is simpler and should be more reliable (perhaps there were legacy issues, if so do they still apply?)
The text was updated successfully, but these errors were encountered:
suedama1756
changed the title
isMaximized is always false on frameless, thickframe: false window
isMaximized does not reflect OS window state on windows
Feb 21, 2021
Changes to isMaximized implementation recently have made reporting of isMaximized worse as they do not use standard operating system calls to determine the window state. Maximizing a window using the windows system menu, or using WIN + Up Arrow will always return isMaximized() false.
Preflight Checklist
Issue Details
Seen in 10.3.2 and 11.2.3
Windows 10
Not 100% sure as different versions have various issues with isMaximized.
Expected Behavior
Execute
Should return true when the window has been maximized by the operating system
Actual Behavior
Returns false
To Reproduce
Additional Information
Replacing the implementations on BrowserWindow with calls to native operating system APIs via a NAPI extension fixes this issue for me. I'd love to understand why electron does not use these standard calls as the code is simpler and should be more reliable (perhaps there were legacy issues, if so do they still apply?)
The NAPI extension is simply a wrapper on the following two windows APIs https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowplacement and https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
The text was updated successfully, but these errors were encountered: