summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-19 04:08:17 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-19 04:08:17 (GMT)
commit3c2b347da556dc5d88df3a36813dfa733f5a9d20 (patch)
treea872832fd1e38d3fea923bb41599d2352e9181a7
parent9bb732fcaa6db14aa7289169a4e6802cfb2a7853 (diff)
downloadeeshow-3c2b347da556dc5d88df3a36813dfa733f5a9d20.zip
eeshow-3c2b347da556dc5d88df3a36813dfa733f5a9d20.tar.gz
eeshow-3c2b347da556dc5d88df3a36813dfa733f5a9d20.tar.bz2
gui/sheet.c (sheet_click): send text to the clipboard (uses xsel)
Copy & paste in Gtk/Gdk seems to have issues in a multi-head setup. xsel works fine, so we just use that for now.
-rw-r--r--Makefile2
-rw-r--r--README2
-rw-r--r--gui/sheet.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 605152d..237b6f7 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ EESHOW_OBJS = main/eeshow.o main/common.o \
gui/gui.o gui/over.o gui/style.o gui/aoi.o gui/fmt-pango.o gui/input.o \
gui/progress.o gui/glabel.o gui/sheet.o gui/history.o gui/render.o \
gui/help.o gui/icons.o gui/index.o gui/timer.o gui/pop.o gui/comp.o \
- gui/viewer.o \
+ gui/viewer.o gui/clipboard.o \
$(OBJS_FILE) \
gfx/style.o gfx/fig.o gfx/record.o gfx/cro.o gfx/diff.o gfx/gfx.o \
gfx/text.o gfx/misc.o gfx/pdftoc.o \
diff --git a/README b/README
index 398ebd3..b2ed6a6 100644
--- a/README
+++ b/README
@@ -46,6 +46,8 @@ If building with USE_WEBKIT=y:
libwebkit2gtk-4.0-dev
+Furthermore, the xsel command-line utility is required for copy & paste.
+
Development status
------------------
diff --git a/gui/sheet.c b/gui/sheet.c
index 0f2a63d..15bec46 100644
--- a/gui/sheet.c
+++ b/gui/sheet.c
@@ -30,6 +30,7 @@
#include "gui/help.h"
#include "gui/icons.h"
#include "gui/timer.h"
+#include "gui/clipboard.h"
#include "gui/common.h"
@@ -442,7 +443,7 @@ static bool sheet_click(void *user, int x, int y)
s = record_find_text(gfx_user(curr_sheet->gfx), show_extra, ex, ey);
if (s)
- fprintf(stderr, "%s\n", s);
+ copy_to_clipboard(s);
return 1;
}