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
{{ message }}
Repository navigation
Strange overflowing window when maximizing a frameless window #5267
just add a {frame: false} option to BrowserWindow, and maximize the window using
require('electron').remote.getCurrentWindow().maximize()
If you have multiple monitors, you'll see a white edge on the other display
When the window is maximized and the window thinks it has a frame, Windows will actually position the window offscreen (so that the "frame" doesn't show). There are then two approaches for solving in electron:
Update native_window_views_win.cc and handle the WM_GETMINMAXINFO event in PreHandleMSG(). You'll be able to get the coords from the l_param and can update them to be the expected values (x/y of 0,0 instead of -7,-7) and set *result to 0 / return true.
In the constructor for native_window_views.cc, unfortunately WS_THICKFRAME (among other styles such as WS_CAPTION and extended styles) are passed in (which trigger incorrect frame calculations). These styles can be removed completely and resizing still does work properly (at least in my testing). This would be my suggested approach.
If you have cloned the electron repo it will be in the same place as on github? If you are using the prebuilt NPM module then it's already been compiled and you can't edit it?
Discord is currently on Electron 7.3.2, and this is still an issue there. Hopefully this issue can get some attention again sometime soon, but it looks like the devs are already pretty busy.
Canary 70821 (b649fde)
Host 0.0.285
Windows 10 64-Bit (10.0.18363)
The issue appears, but they fixed (made a workaround) an oversized server/channel indications on the left when window is maximized! Meaning, now if window is maximized the indicators are not hidden (off-screen) like they were before.
Stable (6cb1462)
Host 0.0.308
Windows 10 64bit (10.0.19041)
Still exists in Teams, never fixed
It exists in all monitor layouts, but is particularly heinous on mixed-dpi as the "1 pixel" wide overlap onto the hi-dpi screen is extremely large.
What do you mean by it's broken in Discord?
Screen 1080p, 100% scaled, maximized Discord Canary window -> no overlap.
Screen 2160p, 150% scaled, maximized Discord Canary window -> no overlap.
Canary 72147 (197af06)
Host 0.0.288
Windows 10 64-Bit (10.0.18363)
In my case, it definitely extends onto the adjacent monitor by 1px on Discord.
Primary: 1920x1080
Secondary: 1280x1024 (Discord maximized on secondary)
In my case, it definitely extends onto the adjacent monitor by 1px on Discord.
Primary: 1920x1080
Secondary: 1280x1024 (Discord maximized on secondary)
Is it also running Electron 7.3.2? I really, really doubt the issue has been fixed, given that Electron has not made any changes to address this issue in version 7. You can check the electron version in the console from the variable process.versions.electron if you would like to verify, but I think canary is running 7.3.2 as well.
Aha, never mind, I was wrong. Electron 7 is being discontinued, so Discord Canary 72170 (49589ec) has finally updated to Electron 10.1.5, and it appears the issue has actually been fixed in this later version. Excited to finally be able to maximize Discord when it moves down into stable lol!
Yes, Electron normally doesn't set the process variable for security reasons, but you can modify Discord to cause it to set it, as described in /issues/18139 and SimulatedGREG/electron-vue/issues/871. BetterDiscord will also make that modification for you, as it is necessary for it to work, which is what I did to check.
I should note that using Better Discord is against Discord ToS for Modify of the client.
You agree not to (and not to attempt to) (i) use the Service for any use or purpose other than as expressly permitted by these Terms;(ii) copy, adapt, modify, prepare derivative works based upon, distribute, license, sell, transfer, publicly display, publicly perform, transmit, stream, broadcast, attempt to discover any source code, reverse engineer, decompile, disassemble, or otherwise exploit the Service or any portion of the Service, except as expressly permitted in these Terms; or (iii) use data mining, robots, spiders, or similar data gathering and extraction tools on the Service.
The issue has been reported on Discord's Bug Hunting Server (Discord Testers) a few times and this has been the default reason of rejecting the report implying this isn't a Discord issue and a known issue on Electron side.
This might explain the reason for people coming here regarding the issue still existing for Discord.
Please note I am simply one of the members of Discord Bug Hunting Community and not speaking on behalf of them
As Alipoodle noted, Discord Canary reverted to 9.3.5 and is no longer using 10.1.5 as I had stated, however Discord Stable has updated to 9.3.5, and as such, this overflowing bug is no longer present on Discord Stable 72915 (cac681d).
Ah nevermind, I take it back. It reverted back to Electron 7.3.2 the next day, but still reports version Stable 72915 (cac681d). Perhaps this will take some more time.
Activity
fancyydk commentedon Oct 6, 2016
Is any work being done on this issue?
odensc commentedon Jan 1, 2017
What is this blocked on?
zhenchaoli commentedon Jan 14, 2017
This is happening for 1.4.12 as well as 1.4.14. And it's pretty easy to reproduce using https://github.com/electron/electron-quick-start
just add a {frame: false} option to BrowserWindow, and maximize the window using
require('electron').remote.getCurrentWindow().maximize()
If you have multiple monitors, you'll see a white edge on the other display
bsclifton commentedon Jan 14, 2017
@fantasticsid what is your DPI set to? I may have a fix for this. See #8404
cc: @MarshallOfSound
bsclifton commentedon Jan 14, 2017
The root cause for this issue happening on multiple monitors having this issue can be read about here:
https://blogs.msdn.microsoft.com/oldnewthing/20120326-00/?p=8003
When the window is maximized and the window thinks it has a frame, Windows will actually position the window offscreen (so that the "frame" doesn't show). There are then two approaches for solving in electron:
WM_GETMINMAXINFOevent inPreHandleMSG(). You'll be able to get the coords from thel_paramand can update them to be the expected values (x/y of 0,0 instead of -7,-7) and set*resultto 0 / return true.native_window_views.cc, unfortunatelyWS_THICKFRAME(among other styles such asWS_CAPTIONand extended styles) are passed in (which trigger incorrect frame calculations). These styles can be removed completely and resizing still does work properly (at least in my testing). This would be my suggested approach.MarshallOfSound commentedon Jan 14, 2017
@bsclifton My DPI is 100% / the default. I'm running a triple 1080p monitor setup (at least where this issue occurs)
xela-zone commentedon Feb 21, 2017
issue will also occur on a single screen with the windows task bar on the right or left edge of the screen.
radencode commentedon Feb 25, 2017
Where can I find the native_window_views.cc file?
MarshallOfSound commentedon Feb 25, 2017
https://github.com/electron/electron/blob/9a7ac5326caadcae3cb2c7432c58353b7db1009e/atom/browser/native_window_views.cc
radencode commentedon Feb 25, 2017
MarshallOfSound commentedon Feb 25, 2017
If you have cloned the electron repo it will be in the same place as on github? If you are using the prebuilt NPM module then it's already been compiled and you can't edit it?
radencode commentedon Feb 25, 2017
49 remaining items
emrezorlu commentedon Oct 13, 2020
same problem in "WhatsApp" and "Atom Editor"
TechnicJelle commentedon Oct 15, 2020
I have the same problem in Discord and Franz/Ferdi.
PseudoResonance commentedon Oct 26, 2020
Discord is currently on Electron 7.3.2, and this is still an issue there. Hopefully this issue can get some attention again sometime soon, but it looks like the devs are already pretty busy.
serious-angel commentedon Nov 2, 2020
Discord
The issue appears, but they fixed (made a workaround) an oversized server/channel indications on the left when window is maximized! Meaning, now if window is maximized the indicators are not hidden (off-screen) like they were before.
serious-angel commentedon Nov 3, 2020
Discord
The issue doesn't appear anymore. The maximized window correctly fits the screen.
RichardTea commentedon Nov 23, 2020
It's broken again in Discord:
Still exists in Teams, never fixed
It exists in all monitor layouts, but is particularly heinous on mixed-dpi as the "1 pixel" wide overlap onto the hi-dpi screen is extremely large.
serious-angel commentedon Nov 24, 2020
What do you mean by it's broken in Discord?
Screen 1080p, 100% scaled, maximized Discord Canary window -> no overlap.
Screen 2160p, 150% scaled, maximized Discord Canary window -> no overlap.
PseudoResonance commentedon Nov 24, 2020
In my case, it definitely extends onto the adjacent monitor by 1px on Discord.
Primary: 1920x1080
Secondary: 1280x1024 (Discord maximized on secondary)
serious-angel commentedon Nov 24, 2020
Do you have the same issue in
Discord Canary?PseudoResonance commentedon Nov 24, 2020
Is it also running Electron 7.3.2? I really, really doubt the issue has been fixed, given that Electron has not made any changes to address this issue in version 7. You can check the electron version in the console from the variable
process.versions.electronif you would like to verify, but I think canary is running 7.3.2 as well.Aha, never mind, I was wrong. Electron 7 is being discontinued, so Discord Canary 72170 (49589ec) has finally updated to Electron 10.1.5, and it appears the issue has actually been fixed in this later version. Excited to finally be able to maximize Discord when it moves down into stable lol!
serious-angel commentedon Nov 24, 2020
The
process.versions.electronreturned:Heh. Yet, another update between our recent messages:
PseudoResonance commentedon Nov 24, 2020
Yes, Electron normally doesn't set the process variable for security reasons, but you can modify Discord to cause it to set it, as described in /issues/18139 and SimulatedGREG/electron-vue/issues/871. BetterDiscord will also make that modification for you, as it is necessary for it to work, which is what I did to check.
Alipoodle commentedon Dec 4, 2020
I should note that using Better Discord is against Discord ToS for Modify of the client.
Latest information for Canary:
Canary 72828 (05bcb5a) Host 0.0.291is running on Discord's Custom Electron/9.3.5Code & Release of which seen here https://github.com/discord/electron.
The issue has been reported on Discord's Bug Hunting Server (Discord Testers) a few times and this has been the default reason of rejecting the report implying this isn't a Discord issue and a known issue on Electron side.
This might explain the reason for people coming here regarding the issue still existing for Discord.
Please note I am simply one of the members of Discord Bug Hunting Community and not speaking on behalf of them
serious-angel commentedon Dec 4, 2020
Thank you for pointing out. Is that related?
PseudoResonance commentedon Dec 8, 2020
As Alipoodle noted, Discord Canary reverted to 9.3.5 and is no longer using 10.1.5 as I had stated, however Discord Stable has updated to 9.3.5, and as such, this overflowing bug is no longer present on Discord Stable 72915 (cac681d).
Ah nevermind, I take it back. It reverted back to Electron 7.3.2 the next day, but still reports version Stable 72915 (cac681d). Perhaps this will take some more time.