From 147cb531408677295137706ccb8253790b858400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 11 Sep 2019 20:09:08 +0200 Subject: [PATCH] renameFolderMenu: Set the entry as menu focus actor When the rename folder menu is opened the text entry is expected to be focused and selected for a quick editing. While this is required it doesn't actually happens since PopupMenu by default gives the key focus to the source actor, that is then free to pass the key focus to the menu if there's an user interaction. In this case however, we want the text entry to be focused once we prompt the menu, so just use the PopupMenu's focusActor property to ensure it will handle it for us. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1604 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/720 --- js/ui/appDisplay.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 39fa99e7e..b1f9a122c 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1732,6 +1732,9 @@ var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu { }); box.add_child(this._entry); + // Focus the text entry on menu pop-up + this.focusActor = this._entry.clutter_text; + this._entry.clutter_text.connect('notify::text', this._validate.bind(this)); this._entry.clutter_text.connect('activate',