clutter/stage: Warn when setting stage key focus to stage
While the `get_key_focus()` method returned the stage itself when no explicit focus was set, it made sense for the corresponding setter to accept the stage as synonym for NULL. But now that the getter always returns the property value, it makes more sense to expect NULL to unset the key focus. Keep the current behavior of normalizing the key focus to NULL in that case to minimize breakage, but print a warning to use NULL instead. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4256>
This commit is contained in:
parent
897cc303cb
commit
33761eb2af
@ -2110,7 +2110,11 @@ clutter_stage_set_key_focus (ClutterStage *stage,
|
||||
|
||||
/* normalize the key focus. NULL == stage */
|
||||
if (actor == CLUTTER_ACTOR (stage))
|
||||
actor = NULL;
|
||||
{
|
||||
g_warning ("Stage key focus was set to stage itself, "
|
||||
"unsetting focus instead");
|
||||
actor = NULL;
|
||||
}
|
||||
|
||||
/* avoid emitting signals and notifications if we're setting the same
|
||||
* actor as the key focus
|
||||
|
Loading…
x
Reference in New Issue
Block a user