Skip to content
Permalink
Browse files

pluma-view: Fix: Don't loss the PRIMARY clipboard

Fixes #179
  • Loading branch information...
sc0w authored and lukefromdc committed Aug 23, 2018
1 parent 4a74dc6 commit 4d26225d475b16de3de4aca3b6e0587d0ded3984
Showing with 12 additions and 0 deletions.
  1. +12 −0 pluma/pluma-view.c
@@ -2137,6 +2137,18 @@ show_line_numbers_menu (GtkWidget *view,
static gboolean
pluma_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
{
static gchar *primtxt = "";

gchar *txt_clip = gtk_clipboard_wait_for_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY));

if (txt_clip)
{
primtxt = g_strdup (txt_clip);
g_free (txt_clip);
}
else
gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY), primtxt, strlen (primtxt));

if ((event->type == GDK_BUTTON_PRESS) &&
(event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget),
GTK_TEXT_WINDOW_LEFT)))

0 comments on commit 4d26225

Please sign in to comment.
You can’t perform that action at this time.