Skip to content

Commit 47f6db9

Browse files
committed
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)
1 parent 1b0a9dd commit 47f6db9

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/gui_beval.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ addEventHandler(GtkWidget *target, BalloonEval *beval)
253253
if (gtk_socket_id == 0 && gui.mainwin != NULL
254254
&& gtk_widget_is_ancestor(target, gui.mainwin))
255255
{
256+
gtk_widget_add_events(gui.mainwin,
257+
GDK_LEAVE_NOTIFY_MASK);
258+
256259
g_signal_connect(G_OBJECT(gui.mainwin), "event",
257260
G_CALLBACK(mainwin_event_cb),
258261
beval);
@@ -360,6 +363,12 @@ mainwin_event_cb(GtkWidget *widget UNUSED, GdkEvent *event, gpointer data)
360363
case GDK_KEY_RELEASE:
361364
key_event(beval, event->key.keyval, FALSE);
362365
break;
366+
case GDK_LEAVE_NOTIFY:
367+
// Ignore LeaveNotify events that are not "normal".
368+
// Apparently we also get it when somebody else grabs focus.
369+
if (event->crossing.mode == GDK_CROSSING_NORMAL)
370+
cancelBalloon(beval);
371+
break;
363372
default:
364373
break;
365374
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2999,
753755
/**/
754756
2998,
755757
/**/

0 commit comments

Comments
 (0)