Skip to content

Strange overflowing window when maximizing a frameless window #5267

Closed

Description

@MarshallOfSound
  • Electron version: 0.37.4
  • Operating system: Windows

When I maximize my frameless electron window a small part of the window in an unmaximized state is visible on a secondary monitor.

Screenshot
electronbug

You can visibly see the "line between the monitors" and you can see some really strange overhanging content that is over that line.

Steps to reproduce

  1. Open an electron app
  2. Maximize the app on your secondary display
  3. Look closely for the overflow onto your primary display

This might take a few times to trigger, it appears to do it about 70% of the time 😕

Activity

  1. fancyydk commented on Oct 6, 2016

    @fancyydk

    Is any work being done on this issue?

  2. odensc commented on Jan 1, 2017

    @odensc

    What is this blocked on?

  3. zhenchaoli commented on Jan 14, 2017

    @zhenchaoli

    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

    image 1
    image 2

  4. bsclifton commented on Jan 14, 2017

    @bsclifton
    Contributor

    @fantasticsid what is your DPI set to? I may have a fix for this. See #8404

    cc: @MarshallOfSound

  5. bsclifton commented on Jan 14, 2017

    @bsclifton
    Contributor

    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:

    1. 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.
    2. 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.
  6. MarshallOfSound commented on Jan 14, 2017

    @MarshallOfSound
    MemberAuthor

    @bsclifton My DPI is 100% / the default. I'm running a triple 1080p monitor setup (at least where this issue occurs)

  7. xela-zone commented on Feb 21, 2017

    @xela-zone

    issue will also occur on a single screen with the windows task bar on the right or left edge of the screen.

  8. radencode commented on Feb 25, 2017

    @radencode

    Where can I find the native_window_views.cc file?

  9. radencode commented on Feb 25, 2017

    @radencode
  10. MarshallOfSound commented on Feb 25, 2017

    @MarshallOfSound
    MemberAuthor

    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?

  11. radencode commented on Feb 25, 2017

    @radencode
  12. 49 remaining items

  13. emrezorlu commented on Oct 13, 2020

    @emrezorlu

    same problem in "WhatsApp" and "Atom Editor"

  14. TechnicJelle commented on Oct 15, 2020

    @TechnicJelle

    I have the same problem in Discord and Franz/Ferdi.

  15. PseudoResonance commented on Oct 26, 2020

    @PseudoResonance

    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.

  16. serious-angel commented on Nov 2, 2020

    @serious-angel

    Discord

    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.

  17. serious-angel commented on Nov 3, 2020

    @serious-angel

    Discord

    Canary 70913 (a6804b8)
    Host 0.0.285
    Windows 10 64-Bit (10.0.18363)
    

    The issue doesn't appear anymore. The maximized window correctly fits the screen.

  18. RichardTea commented on Nov 23, 2020

    @RichardTea

    It's broken again in Discord:

    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.

  19. serious-angel commented on Nov 24, 2020

    @serious-angel

    It's broken again in Discord:

    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)
    
  20. PseudoResonance commented on Nov 24, 2020

    @PseudoResonance

    In my case, it definitely extends onto the adjacent monitor by 1px on Discord.
    Primary: 1920x1080
    Secondary: 1280x1024 (Discord maximized on secondary)

    Discord: Stable 72071 (6cb1462)
    Electron: 7.3.2
    
  21. serious-angel commented on Nov 24, 2020

    @serious-angel

    In my case, it definitely extends onto the adjacent monitor by 1px on Discord.
    Primary: 1920x1080
    Secondary: 1280x1024 (Discord maximized on secondary)

    Discord: Stable 72071 (6cb1462)
    Electron: 7.3.2
    

    Do you have the same issue in Discord Canary?

  22. PseudoResonance commented on Nov 24, 2020

    @PseudoResonance

    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!

  23. serious-angel commented on Nov 24, 2020

    @serious-angel

    You can check the electron version in the console from the variable process.versions.electron if you would like to verify ...

    The process.versions.electron returned:

    Uncaught ReferenceError: process is not defined
        at <anonymous>:1:1

    Discord Canary 72170 (49589ec)

    Heh. Yet, another update between our recent messages:

    Canary 72172 (2b7cfd7)
    Host 0.0.288
    Windows 10 64-Bit (10.0.18363)
    
  24. PseudoResonance commented on Nov 24, 2020

    @PseudoResonance

    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.

  25. Alipoodle commented on Dec 4, 2020

    @Alipoodle

    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.

    Latest information for Canary: Canary 72828 (05bcb5a) Host 0.0.291 is running on Discord's Custom Electron/9.3.5
    Code & 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

  26. serious-angel commented on Dec 4, 2020

    @serious-angel

    I should note that using Better Discord is against Discord ToS for Modify of the client.

    Thank you for pointing out. Is that related?

  27. PseudoResonance commented on Dec 8, 2020

    @PseudoResonance

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions