From a7f85c8fc4ab2bf8b51442273a02ee9fb9dba438 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Feb 2022 15:46:09 +0100 Subject: [PATCH] cally: Get key focus from stage instead of event Avoid usage of clutter_event_get_source(), and use the stage key focus. Part-of: --- clutter/clutter/cally/cally-util.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clutter/clutter/cally/cally-util.c b/clutter/clutter/cally/cally-util.c index e25a6eeae..533295100 100644 --- a/clutter/clutter/cally/cally-util.c +++ b/clutter/clutter/cally/cally-util.c @@ -282,8 +282,11 @@ insert_hf (gpointer key, gpointer value, gpointer data) static gunichar check_key_visibility (ClutterEvent *event) { - ClutterKeyEvent *key_event = (ClutterKeyEvent *)event; - AtkObject *accessible = clutter_actor_get_accessible (key_event->source); + AtkObject *accessible; + ClutterActor *focus; + + focus = clutter_stage_get_key_focus (clutter_event_get_stage (event)); + accessible = clutter_actor_get_accessible (focus); g_return_val_if_fail (accessible != NULL, 0); @@ -299,8 +302,8 @@ check_key_visibility (ClutterEvent *event) still better fill this with a default unichar that the original one */ - if (CLUTTER_IS_TEXT (key_event->source)) - return clutter_text_get_password_char (CLUTTER_TEXT (key_event->source)); + if (CLUTTER_IS_TEXT (focus)) + return clutter_text_get_password_char (CLUTTER_TEXT (focus)); else return DEFAULT_PASSWORD_CHAR; }