summaryrefslogtreecommitdiff
path: root/gtk/gtkroot.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-26 07:57:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-27 16:01:45 -0400
commit5b5d2665d373c35f1792d8d73fa3141100cb9705 (patch)
tree59f59a5f4d2fef7c07f95943b5153946b96672e6 /gtk/gtkroot.c
parent78134fc6d3265e733dadba237397cc0eb7a19c5d (diff)
downloadgtk+-5b5d2665d373c35f1792d8d73fa3141100cb9705.tar.gz
idle sizer: Request a motion event after layout
When we are reallocating widgets, make sure that we get a motion event in the next frame cycle, so the hover state gets updated.
Diffstat (limited to 'gtk/gtkroot.c')
-rw-r--r--gtk/gtkroot.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
index 24d3860b1d..33000c28fc 100644
--- a/gtk/gtkroot.c
+++ b/gtk/gtkroot.c
@@ -199,7 +199,25 @@ gtk_root_layout_cb (GdkFrameClock *clock,
* since it doesn't cause any actual harm.
*/
if (gtk_widget_needs_allocate (widget))
- gtk_native_check_resize (GTK_NATIVE (self));
+ {
+ gtk_native_check_resize (GTK_NATIVE (self));
+ if (GTK_IS_WINDOW (widget))
+ {
+ GdkSeat *seat;
+
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
+ if (seat)
+ {
+ GdkDevice *device;
+ GtkWidget *focus;
+
+ device = gdk_seat_get_pointer (seat);
+ focus = gtk_window_lookup_pointer_focus_widget (GTK_WINDOW (widget), device, NULL);
+ if (focus)
+ gdk_surface_request_motion (gtk_native_get_surface (gtk_widget_get_native (focus)));
+ }
+ }
+ }
if (!gtk_root_needs_layout (self))
gtk_root_stop_layout (self);