From 9e2357d5f3e028089dd106050a3a07d4fa510c20 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 11 Mar 2022 18:19:44 -0800 Subject: [PATCH] macos: clear sorted surfaces when showing file chooser 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkfilechoosernativequartz.c b/gtk/gtkfilechoosernativequartz.c index 3854937c0d..05ff830b9c 100644 --- a/gtk/gtkfilechoosernativequartz.c +++ b/gtk/gtkfilechoosernativequartz.c @@ -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); -- 2.30.2