diff options
Diffstat (limited to 'src/gui_beval.c')
-rw-r--r-- | src/gui_beval.c | 9 |
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; } |