Blame SOURCES/0002-shellEntry-Give-password-menu-item-text-when-it-s-cr.patch

a3db19
From de7df6c7248c39d7cce1c70485df72a398da92a3 Mon Sep 17 00:00:00 2001
a3db19
From: Ray Strode <rstrode@redhat.com>
a3db19
Date: Wed, 21 Aug 2019 15:48:33 -0400
a3db19
Subject: [PATCH 2/4] shellEntry: Give password menu item text when it's
a3db19
 created
a3db19
a3db19
At the moment, the "Show Text" menu item is only given its text
a3db19
at the time the menu is opened.  This is because the text might
a3db19
be "Hide Text" or "Show Text" depending on state, so the text
a3db19
is set up lazily.
a3db19
a3db19
That behavior means the menu item can't get added after the
a3db19
menu is already shown, which is something we'ree going to need
a3db19
in the future to support lockdown of the "Show Text" item.
a3db19
a3db19
This commit ensures the menu item is given text when it's first
a3db19
created, in addition to when the menu is opened.
a3db19
a3db19
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/687
a3db19
---
a3db19
 js/ui/shellEntry.js | 1 +
a3db19
 1 file changed, 1 insertion(+)
a3db19
a3db19
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
a3db19
index cac4ec9c2..603a9c64a 100644
a3db19
--- a/js/ui/shellEntry.js
a3db19
+++ b/js/ui/shellEntry.js
a3db19
@@ -11,60 +11,61 @@ const Tweener = imports.ui.tweener;
a3db19
 var EntryMenu = class extends PopupMenu.PopupMenu {
a3db19
     constructor(entry) {
a3db19
         super(entry, 0, St.Side.TOP);
a3db19
 
a3db19
         this._entry = entry;
a3db19
         this._clipboard = St.Clipboard.get_default();
a3db19
 
a3db19
         // Populate menu
a3db19
         let item;
a3db19
         item = new PopupMenu.PopupMenuItem(_("Copy"));
a3db19
         item.connect('activate', this._onCopyActivated.bind(this));
a3db19
         this.addMenuItem(item);
a3db19
         this._copyItem = item;
a3db19
 
a3db19
         item = new PopupMenu.PopupMenuItem(_("Paste"));
a3db19
         item.connect('activate', this._onPasteActivated.bind(this));
a3db19
         this.addMenuItem(item);
a3db19
         this._pasteItem = item;
a3db19
 
a3db19
         this._passwordItem = null;
a3db19
 
a3db19
         Main.uiGroup.add_actor(this.actor);
a3db19
         this.actor.hide();
a3db19
     }
a3db19
 
a3db19
     _makePasswordItem() {
a3db19
         let item = new PopupMenu.PopupMenuItem('');
a3db19
         item.connect('activate', this._onPasswordActivated.bind(this));
a3db19
         this.addMenuItem(item);
a3db19
         this._passwordItem = item;
a3db19
+        this._updatePasswordItem();
a3db19
     }
a3db19
 
a3db19
     get isPassword() {
a3db19
         return this._entry.input_purpose == Clutter.InputContentPurpose.PASSWORD;
a3db19
     }
a3db19
 
a3db19
     set isPassword(v) {
a3db19
         if (v == this.isPassword)
a3db19
             return;
a3db19
 
a3db19
         if (v) {
a3db19
             this._makePasswordItem();
a3db19
             this._entry.input_purpose = Clutter.InputContentPurpose.PASSWORD;
a3db19
         } else {
a3db19
             this._passwordItem.destroy();
a3db19
             this._passwordItem = null;
a3db19
             this._entry.input_purpose = Clutter.InputContentPurpose.NORMAL;
a3db19
         }
a3db19
     }
a3db19
 
a3db19
     open(animate) {
a3db19
         this._updatePasteItem();
a3db19
         this._updateCopyItem();
a3db19
         if (this._passwordItem)
a3db19
             this._updatePasswordItem();
a3db19
 
a3db19
         super.open(animate);
a3db19
         this._entry.add_style_pseudo_class('focus');
a3db19
 
a3db19
         let direction = St.DirectionType.TAB_FORWARD;
a3db19
-- 
a3db19
2.27.0
a3db19