[gtk] main: Report correct target for button release events
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] main: Report correct target for button release events
- Date: Tue, 29 Jan 2019 06:25:47 +0000 (UTC)
commit bde2332a1aeaf2944ab7bb1523296b816421bdd3
Author: Benjamin Otte <otte redhat com>
Date: Thu Oct 4 13:08:14 2018 +0200
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
gtk/gtkmain.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 25d39d785d..8222f5774b 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]