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
This commit is contained in:
Michael Catanzaro 2016-02-22 20:46:00 -06:00 committed by Michael Catanzaro
parent 674454621f
commit 508668107b

View File

@ -566,6 +566,7 @@ clutter_text_button_press_event (ClutterActor *actor,
ClutterButtonEvent *event, ClutterButtonEvent *event,
gpointer user_data) gpointer user_data)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (user_data);
GtkSettings *settings = gtk_settings_get_default (); GtkSettings *settings = gtk_settings_get_default ();
gboolean primary_paste_enabled; gboolean primary_paste_enabled;
@ -573,7 +574,8 @@ clutter_text_button_press_event (ClutterActor *actor,
"gtk-enable-primary-paste", &primary_paste_enabled, "gtk-enable-primary-paste", &primary_paste_enabled,
NULL); 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; StClipboard *clipboard;