[gtk/synthetic-motion: 11/11] idle sizer: Request a motion event after layout
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/synthetic-motion: 11/11] idle sizer: Request a motion event after layout
- Date: Thu, 27 Aug 2020 16:37:52 +0000 (UTC)
commit 1bcb8752d4f8a75feb7a348ed76b6e6d828b0c8e
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 26 07:57:07 2020 -0400
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.
gtk/gtkroot.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
index 24d3860b1d..93f6e7c5fd 100644
--- a/gtk/gtkroot.c
+++ b/gtk/gtkroot.c
@@ -199,7 +199,21 @@ 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))
+ {
+ GtkWidget *focus;
+ GdkSeat *seat;
+ GdkDevice *device;
+
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]