Skip to content

Some window operations not working when window is in fullscreen state #6033

Closed

Description

@CharlieHess
  • Electron version: 1.2.2
  • Operating system: OS X 10.11.5

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.

Video: http://cl.ly/182Z2Z1L3C1c

Activity

  1. changed the title [-]Black screen after closing window in full-screen[/-] [+]Black screen after hiding window in full-screen[/+] on Jun 14, 2016
  2. kevinsawicki commented on Jun 14, 2016

    @kevinsawicki
    Contributor

    @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?

  3. CharlieHess commented on Jun 21, 2016

    @CharlieHess
    ContributorAuthor

    @kevinsawicki yeah, that makes sense (tried some other apps and they exhibit the same behavior).

  4. liusy182 commented on Jul 21, 2016

    @liusy182
    Contributor

    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.

  5. kevinlims commented on Aug 19, 2016

    @kevinlims

    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?

  6. smithalan92 commented on Aug 24, 2016

    @smithalan92

    @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

    window.on('close', function (e) {
        e.preventDefault();
        if(window.isFullScreen()){
            window.once('leave-full-screen', function () {
                window.hide();
            })
            window.setFullScreen(false);
        }
        else{
            window.hide();
        }
    });
  7. 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
  8. codebytere commented on Sep 27, 2017

    @codebytere
    Member

    closing due to abandonment.

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