macos: clear sorted surfaces when showing file chooser
authorChristian Hergert <christian@hergert.me>
Sat, 12 Mar 2022 02:19:44 +0000 (18:19 -0800)
committerChristian Hergert <christian@hergert.me>
Sat, 12 Mar 2022 02:19:44 +0000 (18:19 -0800)
When showing the native file chooser, we need to ensure we clear the
sorted surfaces in the display so that we don't risk delivering events
correctly on the next frame.

gtk/gtkfilechoosernativequartz.c

index 3854937c0d5415382766f820ba6b46df6ceeece2..05ff830b9c3fff7c3e3e52b0d552ebb717798d42 100644 (file)
@@ -39,6 +39,7 @@
 #include "gtkfilefilterprivate.h"
 
 #include "macos/gdkmacos.h"
+#include "macos/gdkmacosdisplay-private.h"
 #include "macos/gdkmacossurface-private.h"
 
 typedef struct {
@@ -368,6 +369,9 @@ filechooser_quartz_launch (FileChooserQuartzData *data)
         [data->key_window makeKeyAndOrderFront:nil];
       }
 
+    /* Need to clear our cached copy of ordered windows */
+    _gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (gdk_display_get_default ()));
+
     if (!data->skip_response)
       {
         g_slist_free_full (self->custom_files, g_object_unref);