summaryrefslogtreecommitdiff
path: root/src/gui_beval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-14 22:08:46 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-14 22:08:46 +0200
commit47f6db90895c01259e90108caae9517e894e1f95 (patch)
tree303d5fc7ece76998f09282cf1e0452293aabfeaf /src/gui_beval.c
parent1b0a9dd413c03054f461a01531e010ad739617a7 (diff)
downloadvim-git-47f6db90895c01259e90108caae9517e894e1f95.tar.gz
patch 8.2.2999: balloon sometimes does not hide with GTK 3v8.2.2999
Problem: Balloon sometimes does not hide with GTK 3. Solution: Also listen to GDK_LEAVE_NOTIFY. (Johannes Stezenbach)
Diffstat (limited to 'src/gui_beval.c')
-rw-r--r--src/gui_beval.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui_beval.c b/src/gui_beval.c
index 10478c677..9e461e687 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -253,6 +253,9 @@ addEventHandler(GtkWidget *target, BalloonEval *beval)
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 UNUSED, GdkEvent *event, gpointer data)
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;
}