st: Use StSettings for primary-paste setting
If middle-click happens, check whether the setting is enabled and paste primary selection if so. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
This commit is contained in:
parent
df3068d9ca
commit
8647922df9
@ -56,6 +56,7 @@
|
||||
|
||||
#include "st-icon.h"
|
||||
#include "st-label.h"
|
||||
#include "st-settings.h"
|
||||
#include "st-widget.h"
|
||||
#include "st-texture-cache.h"
|
||||
#include "st-clipboard.h"
|
||||
@ -644,15 +645,17 @@ clutter_text_button_press_event (ClutterActor *actor,
|
||||
gpointer user_data)
|
||||
{
|
||||
StEntryPrivate *priv = ST_ENTRY_PRIV (user_data);
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
|
||||
if (event->button == 2 &&
|
||||
clutter_text_get_editable (CLUTTER_TEXT (priv->entry)))
|
||||
{
|
||||
StSettings *settings;
|
||||
gboolean primary_paste_enabled;
|
||||
|
||||
g_object_get (settings,
|
||||
"gtk-enable-primary-paste", &primary_paste_enabled,
|
||||
NULL);
|
||||
settings = st_settings_get ();
|
||||
g_object_get (settings, "primary-paste", &primary_paste_enabled, NULL);
|
||||
|
||||
if (primary_paste_enabled && event->button == 2
|
||||
&& clutter_text_get_editable (CLUTTER_TEXT (priv->entry)))
|
||||
if (primary_paste_enabled)
|
||||
{
|
||||
StClipboard *clipboard;
|
||||
|
||||
@ -668,6 +671,7 @@ clutter_text_button_press_event (ClutterActor *actor,
|
||||
st_entry_clipboard_callback,
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user