[gtk/wip/synthetic-motion2: 3/3] idle size: Create a synthetic motion after layout




commit a24e746673d694f7ae8dde7c6519d094f7077e6c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 26 07:57:07 2020 -0400

    idle size: Create a synthetic motion after layout

 gtk/gtkroot.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
index 24d3860b1d..123cbd2a61 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_ensure_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]