[gtk/wip/chergert/gdk-macos-for-master] macos: resign main/key when hiding window
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-for-master] macos: resign main/key when hiding window
- Date: Wed, 2 Dec 2020 19:32:00 +0000 (UTC)
commit b38d0d7d9e4343aff03754b4ef1e86b2d3cc831a
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 2 11:35:22 2020 -0800
macos: resign main/key when hiding window
This isn't done automatically for us, so we need to synthesize it in
our hide helper.
With this commit, we properly re-focus the new main/key window after
we have closed a transient-for window.
gdk/macos/GdkMacosWindow.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index 92cfa622eb..46a97adcfc 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -320,11 +320,20 @@
-(void)hide
{
+ BOOL wasKey = [self isKeyWindow];
+ BOOL wasMain = [self isMainWindow];
+
inShowOrHide = YES;
[self orderOut:nil];
inShowOrHide = NO;
initialPositionKnown = NO;
+
+ if (wasMain)
+ [self windowDidResignMain:nil];
+
+ if (wasKey)
+ [self windowDidResignKey:nil];
}
-(BOOL)trackManualMove
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]