From: Christian Hergert Date: Sat, 12 Mar 2022 02:19:44 +0000 (-0800) Subject: macos: clear sorted surfaces when showing file chooser X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~318^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9e2357d5f3e028089dd106050a3a07d4fa510c20;p=gtk4.git 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. --- 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);