[gnome-shell] st-entry: Disable cut/copy actions in password entries



commit b52f4ed25b00b91264bce6658c1004ad31651689
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 4 16:21:57 2013 +0100

    st-entry: Disable cut/copy actions in password entries
    
    Curently it is possible to copy the content of password entries,
    and paste it elsewhere in clear text. This is undesirable, so
    follow GTK+'s behavior and disable the cut/copy actions for
    password entries.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695104

 src/st/st-entry.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index 103b8f5..e3c684d 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -602,7 +602,8 @@ st_entry_key_press_event (ClutterActor    *actor,
 
   /* copy */
   if ((event->modifier_state & CLUTTER_CONTROL_MASK)
-      && event->keyval == CLUTTER_c)
+      && event->keyval == CLUTTER_c &&
+      clutter_text_get_password_char ((ClutterText*) priv->entry) == 0)
     {
       StClipboard *clipboard;
       gchar *text;
@@ -622,7 +623,8 @@ st_entry_key_press_event (ClutterActor    *actor,
 
   /* cut */
   if ((event->modifier_state & CLUTTER_CONTROL_MASK)
-      && event->keyval == CLUTTER_x)
+      && event->keyval == CLUTTER_x &&
+      clutter_text_get_password_char ((ClutterText*) priv->entry) == 0)
     {
       StClipboard *clipboard;
       gchar *text;


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