-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add modal window treatment to macOS #116
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
os/osx/window.mm
Outdated
if (spec->floating()) { | ||
self.level = NSFloatingWindowLevel; | ||
self.hidesOnDeactivate = true; | ||
if (spec->modal()) | ||
[self setLevel:NSModalPanelWindowLevel]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already setting the level property if it's floating, probably we can have a modal / not floating (this is not the case of Aseprite which sets the "floating" property for all non-main windows):
if (spec->floating()) { | |
self.level = NSFloatingWindowLevel; | |
self.hidesOnDeactivate = true; | |
if (spec->modal()) | |
[self setLevel:NSModalPanelWindowLevel]; | |
} | |
if (spec->floating()) { | |
self.level = NSFloatingWindowLevel; | |
self.hidesOnDeactivate = true; | |
} | |
if (spec->modal()) | |
self.level = NSModalPanelWindowLevel; |
69bd5cc
to
7ea68e2
Compare
clang-tidy review says "All clean, LGTM! 👍" |
os/osx/window.mm
Outdated
@@ -122,6 +122,9 @@ - (WindowOSXObjc*)initWithImpl:(os::WindowOSX*)impl | |||
self.hidesOnDeactivate = true; | |||
} | |||
|
|||
if (spec->modal()) | |||
[self setLevel:NSModalPanelWindowLevel]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[self setLevel:NSModalPanelWindowLevel]; | |
self.level = NSModalPanelWindowLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry!
Before this addition, when a modal window was active, it was allowed to bring other windows to the front (which should be prohibited). This addition is part of the solution for the issue aseprite/aseprite#4561 'Inactive windows in multiple-window UI mode pass events to below windows'
7ea68e2
to
8840009
Compare
clang-tidy review says "All clean, LGTM! 👍" |
I'll merge this, it would be nice to block the whole hierarchy of parent's floating windows when a modal is displayed, but at the moment this works better than the current |
Great! Remember to approve aseprite/aseprite#4835 so that issue aseprite/aseprite#4561 is resolved in Aseprite. |
This fix is the first step to solve issue aseprite/aseprite#4561