changeset 24924:0d411646a366 v8.2.2999

patch 8.2.2999: balloon sometimes does not hide with GTK 3 Commit: https://github.com/vim/vim/commit/47f6db90895c01259e90108caae9517e894e1f95 Author: Bram Moolenaar <Bram@vim.org> 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Jun 2021 22:15:02 +0200
parents 98a551814ae5
children bba7260bd00b
files src/gui_beval.c src/version.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
--- 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,