Blame SOURCES/0001-shellEntry-Determine-if-password-entry-from-content-.patch

a3db19
From e6cd96a9f6a89f77ca0fab72aff8c56354b59f38 Mon Sep 17 00:00:00 2001
a3db19
From: Ray Strode <rstrode@redhat.com>
a3db19
Date: Wed, 21 Aug 2019 15:01:34 -0400
a3db19
Subject: [PATCH 1/4] shellEntry: Determine if password entry from content
a3db19
 purpose not menu item
a3db19
a3db19
Right now shellEntry decides whether or not it's a password entry based
a3db19
on whether or not it has a "Show Text" context menu.
a3db19
a3db19
That's a little roundabout, and gets in the way off providing lockdown
a3db19
that disables the menu.
a3db19
a3db19
This commit changes shellEntry to base whether or not it's a password
a3db19
entry from it's input content purpose instead of from the presence
a3db19
or absence of a context menu.
a3db19
a3db19
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/687
a3db19
---
a3db19
 js/ui/shellEntry.js | 2 +-
a3db19
 1 file changed, 1 insertion(+), 1 deletion(-)
a3db19
a3db19
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
a3db19
index 53bd1daa1..cac4ec9c2 100644
a3db19
--- a/js/ui/shellEntry.js
a3db19
+++ b/js/ui/shellEntry.js
a3db19
@@ -14,61 +14,61 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
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
     }
a3db19
 
a3db19
     get isPassword() {
a3db19
-        return this._passwordItem != null;
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
         if (!this.actor.navigate_focus(null, direction, false))
a3db19
             this.actor.grab_key_focus();
a3db19
     }
a3db19
 
a3db19
-- 
a3db19
2.27.0
a3db19