# HG changeset patch # User Bram Moolenaar # Date 1623701702 -7200 # Node ID 0d411646a366924457dcb8302dce87d40d2cd731 # Parent 98a551814ae5ca1659bb6e33319acfd01838129e patch 8.2.2999: balloon sometimes does not hide with GTK 3 Commit: https://github.com/vim/vim/commit/47f6db90895c01259e90108caae9517e894e1f95 Author: Bram Moolenaar Date: Mon Jun 14 22:08:46 2021 +0200 patch 8.2.2999: balloon sometimes does not hide with GTK 3 Problem: Balloon sometimes does not hide with GTK 3. Solution: Also listen to GDK_LEAVE_NOTIFY. (Johannes Stezenbach) diff --git a/src/gui_beval.c b/src/gui_beval.c --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -253,6 +253,9 @@ addEventHandler(GtkWidget *target, Ballo if (gtk_socket_id == 0 && gui.mainwin != NULL && gtk_widget_is_ancestor(target, gui.mainwin)) { + gtk_widget_add_events(gui.mainwin, + GDK_LEAVE_NOTIFY_MASK); + g_signal_connect(G_OBJECT(gui.mainwin), "event", G_CALLBACK(mainwin_event_cb), beval); @@ -360,6 +363,12 @@ mainwin_event_cb(GtkWidget *widget UNUSE case GDK_KEY_RELEASE: key_event(beval, event->key.keyval, FALSE); break; + case GDK_LEAVE_NOTIFY: + // Ignore LeaveNotify events that are not "normal". + // Apparently we also get it when somebody else grabs focus. + if (event->crossing.mode == GDK_CROSSING_NORMAL) + cancelBalloon(beval); + break; default: break; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2999, +/**/ 2998, /**/ 2997,