fix: ensure maximize is emitted when reduce motion is enabled on macOS (#46465)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
This commit is contained in:
parent
71150ffe56
commit
3343975488
1 changed files with 13 additions and 3 deletions
|
@ -221,6 +221,12 @@ using FullScreenTransitionState =
|
|||
[super windowDidResize:notification];
|
||||
shell_->NotifyWindowResize();
|
||||
shell_->RedrawTrafficLights();
|
||||
// When reduce motion is enabled windowDidResize is only called once after
|
||||
// a resize and windowDidEndLiveResize is not called. So we need to call
|
||||
// handleZoomEnd here as well.
|
||||
if (NSWorkspace.sharedWorkspace.accessibilityDisplayShouldReduceMotion) {
|
||||
[self handleZoomEnd];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowWillMove:(NSNotification*)notification {
|
||||
|
@ -276,9 +282,7 @@ using FullScreenTransitionState =
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)windowDidEndLiveResize:(NSNotification*)notification {
|
||||
resizingHorizontally_.reset();
|
||||
shell_->NotifyWindowResized();
|
||||
- (void)handleZoomEnd {
|
||||
if (is_zooming_) {
|
||||
if (shell_->IsMaximized())
|
||||
shell_->NotifyWindowMaximize();
|
||||
|
@ -288,6 +292,12 @@ using FullScreenTransitionState =
|
|||
}
|
||||
}
|
||||
|
||||
- (void)windowDidEndLiveResize:(NSNotification*)notification {
|
||||
resizingHorizontally_.reset();
|
||||
shell_->NotifyWindowResized();
|
||||
[self handleZoomEnd];
|
||||
}
|
||||
|
||||
- (void)windowWillEnterFullScreen:(NSNotification*)notification {
|
||||
// Store resizable mask so it can be restored after exiting fullscreen.
|
||||
is_resizable_ = shell_->HasStyleMask(NSWindowStyleMaskResizable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue