summaryrefslogtreecommitdiff
path: root/src/utils/copynpaste.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-22 02:20:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-22 02:20:43 +0300
commite71376322cbe85d59ca7d1a9d7f2a3db9ae9b914 (patch)
tree4e9f65c3ef67e6e06e1e1dca140e2d7ef6a22ff7 /src/utils/copynpaste.cpp
parentb6eb53b9abdf48b88cb1978b9af97f2a879d2717 (diff)
parentacc25a7dffefb8b8b4e8022af918794d26048453 (diff)
downloadplus-e71376322cbe85d59ca7d1a9d7f2a3db9ae9b914.tar.gz
plus-e71376322cbe85d59ca7d1a9d7f2a3db9ae9b914.tar.bz2
plus-e71376322cbe85d59ca7d1a9d7f2a3db9ae9b914.tar.xz
plus-e71376322cbe85d59ca7d1a9d7f2a3db9ae9b914.zip
Merge commit 'v1.2.1.22' into stripped
Conflicts: data/fonts/mplus-1p-bold.ttf data/fonts/mplus-1p-regular.ttf src/CMakeLists.txt src/Makefile.am src/guichan/gui.cpp
Diffstat (limited to 'src/utils/copynpaste.cpp')
-rw-r--r--src/utils/copynpaste.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 3e37afd9d..3e9e09a5c 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -407,8 +407,17 @@ bool retrieveBuffer(std::string& text, std::string::size_type& pos)
return false;
}
+bool runxsel(std::string& text, const char *p1, const char *p2 = nullptr);
+
bool sendBuffer(std::string& text)
{
+ runxsel(text, "-i");
+ runxsel(text, "-b", "-i");
+ return true;
+}
+
+bool runxsel(std::string& text, const char *p1, const char *p2)
+{
pid_t pid;
int fd[2];
@@ -432,7 +441,11 @@ bool sendBuffer(std::string& text)
}
close(fd[0]);
}
- execl("/usr/bin/xsel", "xsel", "-i", (char *)nullptr);
+ if (p2)
+ execl("/usr/bin/xsel", "xsel", p1, p2, (char *)nullptr);
+ else
+ execl("/usr/bin/xsel", "xsel", p1, (char *)nullptr);
+
exit(1);
}