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

42f94a
From 571706c6fb2142cd1dcad9d21fbf04bfaca66af1 Mon Sep 17 00:00:00 2001
42f94a
From: Ray Strode <rstrode@redhat.com>
42f94a
Date: Wed, 21 Aug 2019 15:01:34 -0400
42f94a
Subject: [PATCH 1/3] shellEntry: Determine if password entry from content
42f94a
 purpose not menu item
42f94a
42f94a
Right now shellEntry decides whether or not it's a password entry based
42f94a
on whether or not it has a "Show Text" context menu.
42f94a
42f94a
That's a little roundabout, and gets in the way off providing lockdown
42f94a
that disables the menu.
42f94a
42f94a
This commit changes shellEntry to base whether or not it's a password
42f94a
entry from it's input content purpose instead of from the presence
42f94a
or absence of a context menu.
42f94a
---
42f94a
 js/ui/shellEntry.js | 2 +-
42f94a
 1 file changed, 1 insertion(+), 1 deletion(-)
42f94a
42f94a
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
42f94a
index 9db5136e6..159357eb3 100644
42f94a
--- a/js/ui/shellEntry.js
42f94a
+++ b/js/ui/shellEntry.js
42f94a
@@ -19,61 +19,61 @@ var EntryMenu = new Lang.Class({
42f94a
 
42f94a
         this._entry = entry;
42f94a
         this._clipboard = St.Clipboard.get_default();
42f94a
 
42f94a
         // Populate menu
42f94a
         let item;
42f94a
         item = new PopupMenu.PopupMenuItem(_("Copy"));
42f94a
         item.connect('activate', this._onCopyActivated.bind(this));
42f94a
         this.addMenuItem(item);
42f94a
         this._copyItem = item;
42f94a
 
42f94a
         item = new PopupMenu.PopupMenuItem(_("Paste"));
42f94a
         item.connect('activate', this._onPasteActivated.bind(this));
42f94a
         this.addMenuItem(item);
42f94a
         this._pasteItem = item;
42f94a
 
42f94a
         this._passwordItem = null;
42f94a
 
42f94a
         Main.uiGroup.add_actor(this.actor);
42f94a
         this.actor.hide();
42f94a
     },
42f94a
 
42f94a
     _makePasswordItem() {
42f94a
         let item = new PopupMenu.PopupMenuItem('');
42f94a
         item.connect('activate', this._onPasswordActivated.bind(this));
42f94a
         this.addMenuItem(item);
42f94a
         this._passwordItem = item;
42f94a
     },
42f94a
 
42f94a
     get isPassword() {
42f94a
-        return this._passwordItem != null;
42f94a
+        return this._entry.input_purpose == Clutter.InputContentPurpose.PASSWORD;
42f94a
     },
42f94a
 
42f94a
     set isPassword(v) {
42f94a
         if (v == this.isPassword)
42f94a
             return;
42f94a
 
42f94a
         if (v) {
42f94a
             this._makePasswordItem();
42f94a
             this._entry.input_purpose = Clutter.InputContentPurpose.PASSWORD;
42f94a
         } else {
42f94a
             this._passwordItem.destroy();
42f94a
             this._passwordItem = null;
42f94a
             this._entry.input_purpose = Clutter.InputContentPurpose.NORMAL;
42f94a
         }
42f94a
     },
42f94a
 
42f94a
     open(animate) {
42f94a
         this._updatePasteItem();
42f94a
         this._updateCopyItem();
42f94a
         if (this._passwordItem)
42f94a
             this._updatePasswordItem();
42f94a
 
42f94a
         this.parent(animate);
42f94a
         this._entry.add_style_pseudo_class('focus');
42f94a
 
42f94a
         let direction = Gtk.DirectionType.TAB_FORWARD;
42f94a
         if (!this.actor.navigate_focus(null, direction, false))
42f94a
             this.actor.grab_key_focus();
42f94a
     },
42f94a
 
42f94a
-- 
42f94a
2.21.0
42f94a