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
Some window operations not working when window is in fullscreen state #6033
Make a BrowserWindow.
Override its close event handler to hide the window and cancel the close event.
After the window is shown, set it to full-screen. Cmd-W or Window > Close if you have a menu item with the close selector.
Expected: the window would be hidden.
Actual: a black screen is rendered instead.
In Mac, if an app is in full screen, the 'hide' function is disabled by default (take Finder for example). 'hide' is available ONLY after the app exits full screen. To me, client code should honour this behaviour by not calling "hide()" when the app is in full screen.
I'm running into a similar issue where calling hide in fullscreen mode renders a black screen. I tried calling setFullScreen(false) right after the hide call, but the setFullScreen call causes the window to be shown again. Is there a way to mimic the "close and leave full screen" behavior, similar to other mac apps, but have it "hide and leave full screen" instead?
@wenkaili , One way to work around this is to listen for the leave-full-screen event once before calling setFullScreen(false); and when that event is triggered then hiding the Window. See example code
Reacted by Adam Lynch, Jakob Lo, Noah Benham, Pierre Laurac, Stanislav Vasilev, Alexander Rusakov, RyotaSUENAGA, Alex Brazier, sqwk, surferway and 11 more
Reacted by Kulbear, Alexander Rusakov, RyotaSUENAGA, surferway, Antoine Duban, Nadine K, Onno Schwanen, Sarfaraz Ansari, Andrey Efimov and Hasan Ali
changed the title [-]Black screen after hiding window in full-screen[/-][+]Some window operations not working when window is in fullscreen state[/+]on May 31, 2017
Activity
[-]Black screen after closing window in full-screen[/-][+]Black screen after hiding window in full-screen[/+]kevinsawicki commentedon Jun 14, 2016
@CharlieHess would you expect it to leave fullscreen mode when the window was hidden? Similar to how when you close a window in a full screen app?
CharlieHess commentedon Jun 21, 2016
@kevinsawicki yeah, that makes sense (tried some other apps and they exhibit the same behavior).
liusy182 commentedon Jul 21, 2016
In Mac, if an app is in full screen, the 'hide' function is disabled by default (take Finder for example). 'hide' is available ONLY after the app exits full screen. To me, client code should honour this behaviour by not calling "hide()" when the app is in full screen.
kevinlims commentedon Aug 19, 2016
I'm running into a similar issue where calling hide in fullscreen mode renders a black screen. I tried calling setFullScreen(false) right after the hide call, but the setFullScreen call causes the window to be shown again. Is there a way to mimic the "close and leave full screen" behavior, similar to other mac apps, but have it "hide and leave full screen" instead?
smithalan92 commentedon Aug 24, 2016
@wenkaili , One way to work around this is to listen for the
leave-full-screenevent once before callingsetFullScreen(false);and when that event is triggered then hiding the Window. See example code🍎 When hiding a window, leave fullscreen
[-]Black screen after hiding window in full-screen[/-][+]Some window operations not working when window is in fullscreen state[/+]codebytere commentedon Sep 27, 2017
closing due to abandonment.
fix(electron): exit fullscreen before closing
fix(desktop): prevent black screen when closing fullscreen window on …
fix(desktop): prevent black screen when closing fullscreen window on …
fix(desktop): prevent black screen when closing fullscreen window on …