Force a window resize if the content view frame changes.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1029 Should fix most if not all other cases where system-caused changes to the NSWindow result in the Gdk coordinates not mapping correctly to the AppKit coordinates.
This commit is contained in:
parent
0b4e511d05
commit
3a959e984f
@ -33,6 +33,7 @@
|
|||||||
markedRange = NSMakeRange (NSNotFound, 0);
|
markedRange = NSMakeRange (NSNotFound, 0);
|
||||||
selectedRange = NSMakeRange (0, 0);
|
selectedRange = NSMakeRange (0, 0);
|
||||||
}
|
}
|
||||||
|
[self setValue: @(YES) forKey: @"postsFrameChangedNotifications"];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,11 @@ gdk_window_impl_quartz_finalize (GObject *object)
|
|||||||
if (impl->transient_for)
|
if (impl->transient_for)
|
||||||
g_object_unref (impl->transient_for);
|
g_object_unref (impl->transient_for);
|
||||||
|
|
||||||
|
if (impl->view)
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver: impl->toplevel
|
||||||
|
name: @"NSViewFrameDidChangeNotification"
|
||||||
|
object: impl->view];
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -909,6 +914,10 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
|||||||
impl->view = [[GdkQuartzView alloc] initWithFrame:content_rect];
|
impl->view = [[GdkQuartzView alloc] initWithFrame:content_rect];
|
||||||
[impl->view setGdkWindow:window];
|
[impl->view setGdkWindow:window];
|
||||||
[impl->toplevel setContentView:impl->view];
|
[impl->toplevel setContentView:impl->view];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver: impl->toplevel
|
||||||
|
selector: @selector (windowDidResize:)
|
||||||
|
name: @"NSViewFrameDidChangeNotification"
|
||||||
|
object: impl->view];
|
||||||
[impl->view release];
|
[impl->view release];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user