searchController: Adjust to Clutter.Stage.get_key_focus() change

The method is now a plain getter of the `key-focus` property,
so handle the case where it returns null.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4256

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3633>
This commit is contained in:
Florian Müllner 2025-02-08 02:23:23 +01:00
parent 33ea672605
commit a8d4c679eb

View File

@ -186,9 +186,10 @@ export const SearchController = GObject.registerClass({
}
_onStageKeyFocusChanged() {
let focus = global.stage.get_key_focus();
let appearFocused = this._entry.contains(focus) ||
this._searchResults.contains(focus);
const focus = global.stage.get_key_focus();
const appearFocused = focus != null &&
(this._entry.contains(focus) ||
this._searchResults.contains(focus));
this._text.set_cursor_visible(appearFocused);