[mutter/wip/carlosg/undo-grabs-harder: 2/2] clutter: Only allow grabs to be created on realized actors




commit 9c79c723411625e62904a77c65a83afcc1fdbb5b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 18 12:11:03 2022 +0200

    clutter: Only allow grabs to be created on realized actors
    
    The bare minimum that we can ask to an actor before creating a grab
    on it is that it is realized (and thus, attached to the stage). Bail
    out if that is not the case when creating a grab.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2669>

 clutter/clutter/clutter-stage.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 56919c827a..2b3c03ae2c 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -3790,6 +3790,7 @@ clutter_stage_grab (ClutterStage *stage,
 
   g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
   g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
+  g_return_val_if_fail (clutter_actor_is_realized (actor), NULL);
 
   priv = stage->priv;
 


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