[gtk/fix-hover-tracking] main: Update pointer focus state for button releases
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-hover-tracking] main: Update pointer focus state for button releases
- Date: Sat, 19 Sep 2020 20:48:44 +0000 (UTC)
commit 661da6baec21f390466c7f59249fe7b2d5027320
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 19 16:45:56 2020 -0400
main: Update pointer focus state for button releases
Failure to do so makes the old pointer focus target
'sticky', because we end up ignoring the result of
picking the pointer focus until a motion event comes
in.
Fixes: #3172
gtk/gtkmain.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index a72801e8dd..10780b7684 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1477,17 +1477,19 @@ handle_pointing_event (GdkEvent *event)
device,
sequence);
gtk_window_set_pointer_focus_grab (toplevel, device, sequence,
- type == GDK_BUTTON_PRESS ?
- target : NULL);
+ type == GDK_BUTTON_PRESS ? target : NULL);
if (type == GDK_BUTTON_RELEASE)
{
GtkWidget *new_target = gtk_widget_pick (native, x, y, GTK_PICK_DEFAULT);
+
if (new_target == NULL)
new_target = GTK_WIDGET (toplevel);
+
gtk_synthesize_crossing_events (GTK_ROOT (toplevel), GTK_CROSSING_POINTER, target, new_target,
event, GDK_CROSSING_UNGRAB, NULL);
gtk_window_maybe_update_cursor (toplevel, NULL, device);
+ update_pointer_focus_state (toplevel, event, new_target);
}
set_widget_active_state (target, type == GDK_BUTTON_RELEASE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]