From bf84e5d58f8a78e72410f0b0e773dcd5d21eefff Mon Sep 17 00:00:00 2001 From: Daniel Buch Hansen Date: Sun, 13 Apr 2025 21:02:14 +0200 Subject: [PATCH] windowsNavigator: Adjust to get_key_focus() changes in Clutter Clutter.Stage.get_key_focus() now always returns the value of the Clutter.Stage.keyFocus property, whereas previously it would return the stage itself when no explicit focus was set. Adjust the code accordingly. Closes: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/561 Part-of: (cherry picked from commit e06b1e8236d2af4f989bef57e43754a480baa97e) --- extensions/windowsNavigator/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 49dce1e8..600aae79 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -173,7 +173,7 @@ export default class Extension { this._injectionManager.overrideMethod(viewProto, '_hideTooltips', () => { /* eslint-disable no-invalid-this */ return function () { - if (global.stage.get_key_focus() === global.stage) + if (global.stage.get_key_focus() === null) global.stage.set_key_focus(this._prevFocusActor); this._pickWindow = false; for (let i = 0; i < this._workspaces.length; i++) @@ -235,7 +235,7 @@ export default class Extension { return true; } - if (global.stage.get_key_focus() !== global.stage) + if (global.stage.get_key_focus() !== null) return false; // ignore shift presses, they're required to get numerals in azerty keyboards