[gtk/wip/chergert/quartz4u] macos: show surface when presenting toplevel
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/quartz4u] macos: show surface when presenting toplevel
- Date: Tue, 5 May 2020 21:51:26 +0000 (UTC)
commit b0b2a70b3d3f745af72996818d60fd70a3f1627c
Author: Christian Hergert <chergert redhat com>
Date: Tue May 5 14:47:29 2020 -0700
macos: show surface when presenting toplevel
gdk/macos/gdkmacossurface-private.h | 1 +
gdk/macos/gdkmacossurface.c | 24 ++++++++++++++++++++++++
gdk/macos/gdkmacostoplevelsurface.c | 4 +---
3 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/gdk/macos/gdkmacossurface-private.h b/gdk/macos/gdkmacossurface-private.h
index 6a2f08183d..466cb13a99 100644
--- a/gdk/macos/gdkmacossurface-private.h
+++ b/gdk/macos/gdkmacossurface-private.h
@@ -81,6 +81,7 @@ void _gdk_macos_surface_damage_cairo (GdkMacosSurface
cairo_region_t *painted);
void _gdk_macos_surface_set_is_key (GdkMacosSurface *self,
gboolean is_key);
+void _gdk_macos_surface_show (GdkMacosSurface *self);
void _gdk_macos_surface_thaw (GdkMacosSurface *self,
gint64
predicted_presentation_time,
gint64 refresh_interval);
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 3e367c2d5f..880cf6c0b0 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -762,3 +762,27 @@ _gdk_macos_surface_thaw (GdkMacosSurface *self,
timings->predicted_presentation_time = presentation_time;
}
}
+
+void
+_gdk_macos_surface_show (GdkMacosSurface *self)
+{
+ gboolean was_mapped;
+
+ g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
+
+ if (GDK_SURFACE_DESTROYED (self))
+ return;
+
+ was_mapped = GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self));
+
+ if (!was_mapped)
+ gdk_synthesize_surface_state (GDK_SURFACE (self), GDK_SURFACE_STATE_WITHDRAWN, 0);
+
+ _gdk_surface_update_viewable (GDK_SURFACE (self));
+
+ if (!was_mapped)
+ {
+ if (gdk_surface_is_viewable (GDK_SURFACE (self)))
+ gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
+ }
+}
diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c
index 2c28a5f538..90374ca23e 100644
--- a/gdk/macos/gdkmacostoplevelsurface.c
+++ b/gdk/macos/gdkmacostoplevelsurface.c
@@ -140,9 +140,7 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
/* Now present the window */
[(GdkMacosWindow *)window showAndMakeKey:YES];
- gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
-
- g_print ("Made window key\n");
+ _gdk_macos_surface_show (GDK_MACOS_SURFACE (self));
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]