[gtk/wip/chergert/quartz4u] make window closing work



commit bc6d3af8f853106d4306cd090f0e9f9590d61d9f
Author: Christian Hergert <chergert redhat com>
Date:   Thu Apr 30 12:28:09 2020 -0700

    make window closing work

 gdk/macos/GdkMacosWindow.c  | 12 ++++--------
 gdk/macos/gdkmacossurface.c |  2 --
 2 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index c1ba37b0ec..5e125b5b70 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -42,17 +42,13 @@
 
 -(BOOL)windowShouldClose:(id)sender
 {
-#if 0
-  GdkSurface *window = [[self contentView] gdkSurface];
+  GdkDisplay *display;
   GdkEvent *event;
 
-  event = gdk_event_new (GDK_DELETE);
-
-  event->any.surface = g_object_ref (window);
-  event->any.send_event = FALSE;
+  display = gdk_surface_get_display (GDK_SURFACE (self->gdkSurface));
+  event = gdk_delete_event_new (GDK_SURFACE (self->gdkSurface));
 
-  _gdk_event_queue_append (gdk_display_get_default (), event);
-#endif
+  _gdk_event_queue_append (display, event);
 
   return NO;
 }
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 5ba6ff4e94..eb64bf47be 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -108,8 +108,6 @@ gdk_macos_surface_destroy (GdkSurface *surface,
   if (window != NULL)
     [window close];
 
-  GDK_SURFACE_CLASS (gdk_macos_surface_parent_class)->destroy (surface, foreign_destroy);
-
   GDK_END_MACOS_ALLOC_POOL;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]