Repository navigation
Fix unresponsive app after fullscreen->normal state toggle (Windows) - #9645
kevinsawicki merged 5 commits into
Conversation
723c69e to
ce27507
Compare
|
Hmmm, Travis is being funky. All tests passed, yet Job #11868.1 build script still exited with 1. Care to take a look anyone ? /ping @kevinsawicki |
ce27507 to
aeb68c2
Compare
|
Never mind, re-ran tests and all green now! |
kevinsawicki
left a comment
There was a problem hiding this comment.
Thanks for figuring this one out, awesome to see the fix for it 👍
Left a few minor comments, let me know what you think.
|
|
||
| #if defined(OS_WIN) | ||
| // There is no native fullscreen state on Windows. | ||
| bool fullscreen_to_normal_detected = IsFullscreen() && !fullscreen; |
There was a problem hiding this comment.
What do you think about calling this leaving_fullscreen instead?
| if (fullscreen_to_normal_detected && !IsVisible()) { | ||
| LONG frame_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE); | ||
| frame_style |= WS_VISIBLE; | ||
| ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style); |
There was a problem hiding this comment.
This could just be:
FlipWindowStyle(GetAcceleratedWidget(), true, WS_VISIBLE);| assert.equal(w.isVisible(), false) | ||
| assert.equal(w.isFullScreen(), false) | ||
| done() | ||
| }, 1000) |
There was a problem hiding this comment.
Instead of a setTimeout, could this just wait for the leave-full-screen event and verify the state after that fires:
w.once('leave-full-screen', () => {
assert.equal(w.isVisible(), false)
assert.equal(w.isFullScreen(), false)
done()
})
w.setFullScreen(false)00aad74 to
112f465
Compare
|
Changes made, as requested. ping @kevinsawicki |
|
Thanks for fixing this @dharders 👍 |
|
FYI: Released in |
Fixes #6036
Summary
In Windows only, starting an app in the fullscreen state i.e. with the BrowserWindow options
{ fullscreen: true }produces an unresponsive window after toggling to the normal window state. e.g. Pressing F11 orsetFullScreen(false). See issue #6036The window visibility flag
WS_VISIBLEis never set for theGWL_STYLEwhen we start in fullscreen mode. This fix simply detects the fullscreen->normal window state transition and checks if the window is visible (which it always should be). If it isn't, it sets the visibility to true. i.e. :Includes tests (this branch passes, old behavior fails)
Fixes #6036