[gtk/wip/otte/listview: 301/327] main: Report correct target for button release events
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 301/327] main: Report correct target for button release events
- Date: Fri, 4 Jan 2019 23:35:56 +0000 (UTC)
commit f1c34aefe0ef2e388bf7f2dbbe489f271d98785b
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 eff0d62ed3..91caefe243 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1633,11 +1633,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]