diff --git a/ChangeLog b/ChangeLog index 266a553356..68ac0c3335 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-15 Matthias Clasen + + * gdk/x11/gdmain-x11.c (_gdk_xgrab_check_button_event): Be more + careful when checking for ButtonRelease events that end implicit + grabs. (#386618, Christof Krüger) + 2007-02-15 Matthias Clasen * gtk/gtktextbtree.c (_gtk_text_btree_delete): Free the lines diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 36b51ec242..60746458de 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -504,6 +504,12 @@ _gdk_xgrab_check_destroy (GdkWindow *window) } } +#define GDK_ANY_BUTTON_MASK (GDK_BUTTON1_MASK | \ + GDK_BUTTON2_MASK | \ + GDK_BUTTON3_MASK | \ + GDK_BUTTON4_MASK | \ + GDK_BUTTON5_MASK) + /** * _gdk_xgrab_check_button_event: * @window: a #GdkWindow @@ -533,7 +539,7 @@ _gdk_xgrab_check_button_event (GdkWindow *window, case ButtonRelease: if (display_x11->pointer_xgrab_window && display_x11->pointer_xgrab_implicit && - (xevent->xbutton.state & ~(GDK_BUTTON1_MASK << (xevent->xbutton.button - 1))) == 0) + (xevent->xbutton.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (xevent->xbutton.button - 1))) == 0) { display_x11->pointer_xgrab_window = NULL; }