result = OK;
#else
# ifdef FEAT_GUI_GTK
+ gui.is_x11 = false;
+# ifdef FEAT_GUI_DIALOG
+ gui.dialogs_active = 0;
+ gui.dialog_focus_pending = 0;
+# endif
# ifdef GDK_WINDOWING_WAYLAND
gui.is_wayland = false;
# endif
// Put events in the input queue only when allowed.
// ui_focus_change() isn't called directly, because it invokes
// autocommands and that must not happen asynchronously.
- if (!hold_gui_events)
+ if (!hold_gui_events
+# if defined(FEAT_GUI_GTK) && defined(FEAT_GUI_DIALOG)
+ && gui.dialogs_active == 0
+# endif
+ )
{
char_u bytes[3];
char_u *browse_fname; // file name from filedlg
guint32 event_time;
+# ifdef FEAT_GUI_DIALOG
+ // Multiple dialogs not allowed, just tracked for future use.
+ int dialogs_active; // number of active GUI dialogs
+
+ // X11 focus_in_event() by dialogs, ignored to match wayland.
+ int dialog_focus_pending;
+# endif
+ bool is_x11; // active gdk backend in gtk is x11
# ifdef GDK_WINDOWING_WAYLAND
bool is_wayland; // active gdk backend in gtk is wayland
# endif
int response;
DialogInfo dialoginfo;
+ ++gui.dialogs_active;
+ if (gui.is_x11)
+ ++gui.dialog_focus_pending;
+
dialog = create_message_dialog(type, title, message);
dialoginfo.dialog = GTK_DIALOG(dialog);
dialog_add_buttons(GTK_DIALOG(dialog), buttons);
gtk_widget_destroy(dialog);
}
+ --gui.dialogs_active;
return response > 0 ? response : 0;
}
GdkEventFocus *event UNUSED,
gpointer data UNUSED)
{
- gui_focus_change(TRUE);
+#ifdef FEAT_GUI_DIALOG
+ if (gui.is_x11 && gui.dialog_focus_pending > 0)
+ --gui.dialog_focus_pending;
+ else
+#endif
+ gui_focus_change(TRUE);
if (blink_state == BLINK_NONE)
gui_mch_start_blink();
#if GTK_CHECK_VERSION(3,4,0)
if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
{
+ gui.is_x11 = true;
// for X11, if we were using smooth scroll events, we
// would get an scroll without deltas on the very first user scroll* and
// get both "unsmooth" scroll and smooth scroll events after
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 851,
/**/
850,
/**/