[gtk/wip/chergert/for-main: 6/10] macos: handle transient-for in configure
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main: 6/10] macos: handle transient-for in configure
- Date: Tue, 1 Mar 2022 07:09:57 +0000 (UTC)
commit e47ef9be5b5c165d76b8c3354fc6c3c9a3caa875
Author: Christian Hergert <christian hergert me>
Date: Mon Feb 28 22:42:55 2022 -0800
macos: handle transient-for in configure
We need to specifically handle transient-for and parent, which are not the
same in the parent structure.
gdk/macos/gdkmacossurface.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 15c7de5401..28f5601909 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -844,8 +844,9 @@ _gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
void
_gdk_macos_surface_configure (GdkMacosSurface *self)
{
- GdkMacosDisplay *display;
GdkSurface *surface = (GdkSurface *)self;
+ GdkMacosDisplay *display;
+ GdkMacosSurface *parent;
NSRect frame_rect;
NSRect content_rect;
@@ -854,6 +855,13 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
if (GDK_SURFACE_DESTROYED (self))
return;
+ if (surface->parent != NULL)
+ parent = GDK_MACOS_SURFACE (surface->parent);
+ else if (surface->transient_for != NULL)
+ parent = GDK_MACOS_SURFACE (surface->transient_for);
+ else
+ parent = NULL;
+
display = GDK_MACOS_DISPLAY (GDK_SURFACE (self)->display);
frame_rect = [self->window frame];
content_rect = [self->window contentRectForFrameRect:frame_rect];
@@ -863,10 +871,10 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
content_rect.origin.y + content_rect.size.height,
&self->root_x, &self->root_y);
- if (surface->parent != NULL)
+ if (parent != NULL)
{
- surface->x = self->root_x - GDK_MACOS_SURFACE (surface->parent)->root_x;
- surface->y = self->root_y - GDK_MACOS_SURFACE (surface->parent)->root_y;
+ surface->x = self->root_x - parent->root_x;
+ surface->y = self->root_y - parent->root_y;
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]