New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: child window alwaysOnTop level persistence #29813
Conversation
f644f62
to
44cbc42
Compare
should we make a getter to make this testable? |
@nornagon i considered that but i wasn't sure if we wanted to pursue that given that if we modify the existing |
I think it could make sense to add another getter for I've also been considering a class of tests that could make use of |
Another choice would be wrapping it in |
@zcbenz @nornagon i added a new undocumented method
My goal for the new method i added here is to enable minimum viable testability more than anything else but I'm happy to modify this or take on item(s) numbered above if you all think that does fall within scope of this PR! |
cbbfc77
to
fb9131b
Compare
fb9131b
to
fd6b251
Compare
Release Notes Persisted
|
I was unable to backport this PR to "12-x-y" cleanly; |
I was unable to backport this PR to "13-x-y" cleanly; |
I have automatically backported this PR to "14-x-y", please check out #29855 |
@codebytere has manually backported this PR to "13-x-y", please check out #29956 |
@codebytere has manually backported this PR to "12-x-y", please check out #29957 |
* fix: child window alwaysOnTop level * chore: add undocumented getAlwaysOnTopLevel * test: add test for level persistence * Address feedback from review
Description of Change
Fixes an issue found while debugging #29732 - when a child window is attached to a parent
NSWindow
, the child window's level will be reset. E.g if one callschildWindow.setAlwaysOnTop(true, 'screen-saver')
, this will not be honored. This fixes that by preserving the window level before it's attached to the parent and then restoring it.Tested with https://gist.github.com/f2a3a5e8d9130223f18b8ddade390f20.
A test can't be added here because
isAlwaysOnTop
is true for all child windows, and whilesetAlwaysOnTop
differentiates between different window levels the getter does not, and so it's not possible at present to tell whether or not a window level is for ex.screen-saver
orpop-up-menu
sinceisAlwaysOnTop
would be true for both.Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where the
setAlwaysOnTop
value would sometimes not be preserved for child windows on macOS.