[gnome-shell] renameFolderMenu: Set the entry as menu focus actor



commit 147cb531408677295137706ccb8253790b858400
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Wed Sep 11 20:09:08 2019 +0200

    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 39fa99e7ed..b1f9a122c7 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',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]