[gnome-shell] st/viewport: Don't trigger relayout when picking



commit 4e57119f40259ab5ecfd013256ac9fc81f234646
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Dec 9 19:02:55 2020 +0100

    st/viewport: Don't trigger relayout when picking
    
    Calling clutter_actor_get_allocation_box() might still implicitly
    trigger a full relayout, which has many side effects not expected to
    occur during picking. Avoid a particular case which caused a reentry
    issue by using the current allocation instead of forcing a relayout when
    picking in StViewport.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1436
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1527>

 src/st/st-viewport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-viewport.c b/src/st/st-viewport.c
index 3ed2d89e13..c663ae4cd3 100644
--- a/src/st/st-viewport.c
+++ b/src/st/st-viewport.c
@@ -431,7 +431,7 @@ st_viewport_pick (ClutterActor       *actor,
   StViewportPrivate *priv = st_viewport_get_instance_private (viewport);
   StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
   double x, y;
-  ClutterActorBox allocation_box;
+  g_autoptr (ClutterActorBox) allocation_box = NULL;
   ClutterActorBox content_box;
   ClutterActor *child;
 
@@ -440,8 +440,8 @@ st_viewport_pick (ClutterActor       *actor,
   if (clutter_actor_get_n_children (actor) == 0)
     return;
 
-  clutter_actor_get_allocation_box (actor, &allocation_box);
-  st_theme_node_get_content_box (theme_node, &allocation_box, &content_box);
+  g_object_get (actor, "allocation", &allocation_box, NULL);
+  st_theme_node_get_content_box (theme_node, allocation_box, &content_box);
 
   get_border_paint_offsets (viewport, &x, &y);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]