[gnome-shell] st-entry: Disable middle-click-paste when entry is not editable



commit 508668107bf4bba46ac73419c5829c53008d47f6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Feb 22 20:46:00 2016 -0600

    st-entry: Disable middle-click-paste when entry is not editable
    
    Should only allow pasting the primary selection when the entry is
    editable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762507

 src/st/st-entry.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index c1a648d..77fabc8 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -566,6 +566,7 @@ clutter_text_button_press_event (ClutterActor       *actor,
                                  ClutterButtonEvent *event,
                                  gpointer            user_data)
 {
+  StEntryPrivate *priv = ST_ENTRY_PRIV (user_data);
   GtkSettings *settings = gtk_settings_get_default ();
   gboolean primary_paste_enabled;
 
@@ -573,7 +574,8 @@ clutter_text_button_press_event (ClutterActor       *actor,
                 "gtk-enable-primary-paste", &primary_paste_enabled,
                 NULL);
 
-  if (primary_paste_enabled && event->button == 2)
+  if (primary_paste_enabled && event->button == 2
+      && clutter_text_get_editable (CLUTTER_TEXT (priv->entry)))
     {
       StClipboard *clipboard;
 


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