Synchronize Clipboard with Primary Selection on Linux when copying (#1502)

* Introduce crossPlatformCopy()

It sets the text of the clipboard and also syncs it with the selection
clipboard if it is supported. Such behaviour is pretty common for X11
application on Unix-like Operating Systems.

* Fix clang-format remarks

* Fix weird clang-format config discrepancy between my machine and CI

* Remove clipboard argument from crossPlatformCopy

* Fix clang-format remarks
This commit is contained in:
Alexey Kutepov
2020-01-25 03:36:51 +07:00
committed by fourtf
parent 809b63bb5e
commit 00414eb779
5 changed files with 41 additions and 17 deletions
+2 -1
View File
@@ -10,6 +10,7 @@
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "util/Clipboard.hpp"
#include "util/Shortcut.hpp"
#include "util/StreamLink.hpp"
#include "widgets/Notebook.hpp"
@@ -659,7 +660,7 @@ void Split::openSubPage()
void Split::copyToClipboard()
{
QApplication::clipboard()->setText(this->view_->getSelectedText());
crossPlatformCopy(this->view_->getSelectedText());
}
void Split::showSearch()