main: Report correct target for button release events

Button release events should not go to the widget below the pointer, but
to the widget that received the original button press.

Fixes #24
This commit is contained in:
Benjamin Otte 2018-10-04 13:08:14 +02:00 committed by Timm Bäder
parent 20429f4764
commit bde2332a1a

View File

@ -1651,11 +1651,11 @@ handle_pointing_event (GdkEvent *event)
if (event->any.type == GDK_BUTTON_RELEASE)
{
old_target = target;
target = gtk_widget_pick (GTK_WIDGET (toplevel), x, y);
if (target == NULL)
target = GTK_WIDGET (toplevel);
gtk_synthesize_crossing_events (toplevel, old_target, target, event,
GtkWidget *new_target;
new_target = gtk_widget_pick (GTK_WIDGET (toplevel), x, y);
if (new_target == NULL)
new_target = GTK_WIDGET (toplevel);
gtk_synthesize_crossing_events (toplevel, target, new_target, event,
GDK_CROSSING_UNGRAB);
gtk_window_maybe_update_cursor (toplevel, NULL, device);
}