feat: Settings expose settings to use wl-clipboard backend. Disable clipboard on wayland if this settings is disabled
This commit is contained in:
parent
90e7d475f8
commit
d157713a85
11 changed files with 93 additions and 11 deletions
|
|
@ -54,6 +54,7 @@ public:
|
||||||
inline static const auto Display = QStringLiteral("core/display");
|
inline static const auto Display = QStringLiteral("core/display");
|
||||||
inline static const auto UseHooks = QStringLiteral("core/useHooks");
|
inline static const auto UseHooks = QStringLiteral("core/useHooks");
|
||||||
inline static const auto Language = QStringLiteral("core/language");
|
inline static const auto Language = QStringLiteral("core/language");
|
||||||
|
inline static const auto useWlClipboard = QStringLiteral("core/wlClipboard");
|
||||||
};
|
};
|
||||||
struct Daemon
|
struct Daemon
|
||||||
{
|
{
|
||||||
|
|
@ -194,6 +195,7 @@ private:
|
||||||
, Settings::Core::UpdateUrl
|
, Settings::Core::UpdateUrl
|
||||||
, Settings::Core::Display
|
, Settings::Core::Display
|
||||||
, Settings::Core::UseHooks
|
, Settings::Core::UseHooks
|
||||||
|
, Settings::Core::useWlClipboard
|
||||||
, Settings::Core::Language
|
, Settings::Core::Language
|
||||||
, Settings::Daemon::Command
|
, Settings::Daemon::Command
|
||||||
, Settings::Daemon::Elevate
|
, Settings::Daemon::Elevate
|
||||||
|
|
@ -223,6 +225,7 @@ private:
|
||||||
Settings::Gui::Autohide
|
Settings::Gui::Autohide
|
||||||
, Settings::Core::StartedBefore
|
, Settings::Core::StartedBefore
|
||||||
, Settings::Core::PreventSleep
|
, Settings::Core::PreventSleep
|
||||||
|
, Settings::Core::useWlClipboard
|
||||||
, Settings::Server::ExternalConfig
|
, Settings::Server::ExternalConfig
|
||||||
, Settings::Client::InvertScrollDirection
|
, Settings::Client::InvertScrollDirection
|
||||||
, Settings::Log::ToFile
|
, Settings::Log::ToFile
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ void SettingsDialog::accept()
|
||||||
Settings::setValue(Settings::Client::ScrollSpeed, ui->sbScrollSpeed->value());
|
Settings::setValue(Settings::Client::ScrollSpeed, ui->sbScrollSpeed->value());
|
||||||
Settings::setValue(Settings::Core::Language, ui->comboLanguage->currentText());
|
Settings::setValue(Settings::Core::Language, ui->comboLanguage->currentText());
|
||||||
Settings::setValue(Settings::Log::GuiDebug, ui->cbGuiDebug->isChecked());
|
Settings::setValue(Settings::Log::GuiDebug, ui->cbGuiDebug->isChecked());
|
||||||
|
Settings::setValue(Settings::Core::useWlClipboard, ui->cbUseWlClipboard->isChecked());
|
||||||
|
|
||||||
Settings::ProcessMode mode;
|
Settings::ProcessMode mode;
|
||||||
if (ui->groupService->isChecked())
|
if (ui->groupService->isChecked())
|
||||||
|
|
@ -205,6 +206,7 @@ void SettingsDialog::loadFromConfig()
|
||||||
ui->cbAutoUpdate->setChecked(Settings::value(Settings::Gui::AutoUpdateCheck).toBool());
|
ui->cbAutoUpdate->setChecked(Settings::value(Settings::Gui::AutoUpdateCheck).toBool());
|
||||||
ui->sbScrollSpeed->setValue(Settings::value(Settings::Client::ScrollSpeed).toInt());
|
ui->sbScrollSpeed->setValue(Settings::value(Settings::Client::ScrollSpeed).toInt());
|
||||||
ui->cbGuiDebug->setChecked(Settings::value(Settings::Log::GuiDebug).toBool());
|
ui->cbGuiDebug->setChecked(Settings::value(Settings::Log::GuiDebug).toBool());
|
||||||
|
ui->cbUseWlClipboard->setChecked(Settings::value(Settings::Core::useWlClipboard).toBool());
|
||||||
|
|
||||||
const auto processMode = Settings::value(Settings::Core::ProcessMode).value<Settings::ProcessMode>();
|
const auto processMode = Settings::value(Settings::Core::ProcessMode).value<Settings::ProcessMode>();
|
||||||
ui->groupService->setChecked(processMode == Settings::ProcessMode::Service);
|
ui->groupService->setChecked(processMode == Settings::ProcessMode::Service);
|
||||||
|
|
@ -308,6 +310,14 @@ void SettingsDialog::updateControls()
|
||||||
ui->groupService->setVisible(false);
|
ui->groupService->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wl-clipboard support only works on wayland.
|
||||||
|
// options should only be available when we are *not* running on wayland.
|
||||||
|
if (deskflow::platform::isWayland()) {
|
||||||
|
ui->cbUseWlClipboard->setEnabled(writable);
|
||||||
|
} else if (ui->widgetWlClipboard->isVisibleTo(ui->tabAdvanced)) {
|
||||||
|
ui->widgetWlClipboard->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
ui->groupClientOptions->setEnabled(writable && isClientMode());
|
ui->groupClientOptions->setEnabled(writable && isClientMode());
|
||||||
|
|
||||||
ui->widgetLogFilename->setEnabled(writable && logToFile);
|
ui->widgetLogFilename->setEnabled(writable && logToFile);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>549</width>
|
<width>549</width>
|
||||||
<height>628</height>
|
<height>755</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -661,6 +661,35 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widgetWlClipboard" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="cbUseWlClipboard">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable wl-clipboard support</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblWlClipboard">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
@ -674,11 +703,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widgetLangControls" native="true">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <common/Settings.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
@ -211,6 +212,11 @@ bool WlClipboard::checkCommandExists(const char *command)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WlClipboard::isEnabled()
|
||||||
|
{
|
||||||
|
return Settings::value(Settings::Core::useWlClipboard).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
void WlClipboard::startMonitoring()
|
void WlClipboard::startMonitoring()
|
||||||
{
|
{
|
||||||
if (m_monitoring) {
|
if (m_monitoring) {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ public:
|
||||||
//! Check if wl-clipboard tools are available
|
//! Check if wl-clipboard tools are available
|
||||||
static bool isAvailable();
|
static bool isAvailable();
|
||||||
|
|
||||||
|
//! Check if WlClipboard is enabled
|
||||||
|
static bool isEnabled();
|
||||||
|
|
||||||
//! Start monitoring clipboard changes
|
//! Start monitoring clipboard changes
|
||||||
void startMonitoring();
|
void startMonitoring();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,11 @@ void WlClipboardCollection::resetChanged() const
|
||||||
|
|
||||||
void WlClipboardCollection::initialize()
|
void WlClipboardCollection::initialize()
|
||||||
{
|
{
|
||||||
// Check if Wayland clipboard is available
|
if (!WlClipboard::isEnabled()) {
|
||||||
|
LOG_DEBUG("wl-clipboard setting disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!WlClipboard::isAvailable()) {
|
if (!WlClipboard::isAvailable()) {
|
||||||
LOG_WARN("wl-clipboard tools not found, clipboard functionality disabled");
|
LOG_WARN("wl-clipboard tools not found, clipboard functionality disabled");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1248,6 +1248,14 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
|
||||||
<source>Enable GUI debug messages</source>
|
<source>Enable GUI debug messages</source>
|
||||||
<translation type="unfinished">Habilitar mensajes de depuración de la interfaz gráfica de usuario</translation>
|
<translation type="unfinished">Habilitar mensajes de depuración de la interfaz gráfica de usuario</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Enable wl-clipboard support</source>
|
||||||
|
<translation type="unfinished">Habilitar la compatibilidad con wl-clipboard</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></source>
|
||||||
|
<translation type="unfinished"><html><head/><body><p>Requiere el paquete wl-clipboard</p><p>Al usar wl-clipboard v2.2.1, existe un error que provoca la pérdida del foco y que puede dificultar el uso de Deskflow. Este error se ha corregido al usar la rama principal de wl-clipboard, a menos que su Compositor no sea compatible con el protocolo wlroots-data-control.</p></body></html></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TlsCertificate</name>
|
<name>TlsCertificate</name>
|
||||||
|
|
|
||||||
|
|
@ -1248,6 +1248,14 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf
|
||||||
<source>Enable GUI debug messages</source>
|
<source>Enable GUI debug messages</source>
|
||||||
<translation>Abilita i messaggi di debug della GUI</translation>
|
<translation>Abilita i messaggi di debug della GUI</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Enable wl-clipboard support</source>
|
||||||
|
<translation>Abilita il supporto wl-clipboard</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>Richiede il pacchetto wl-clipboard</p><p>Quando si utilizza wl-clipboard v2.2.1, si verifica un bug di furto del focus che potrebbe rendere Deskflow più difficile da usare. Questo problema è stato risolto quando si utilizza il ramo master di wl-clipboard, a meno che il proprio compositore non supporti il protocollo wlroots-data-control.</p></body></html></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TlsCertificate</name>
|
<name>TlsCertificate</name>
|
||||||
|
|
|
||||||
|
|
@ -1249,6 +1249,14 @@ Enabling this setting will disable the server config GUI.</source>
|
||||||
<source>Verbose debug output</source>
|
<source>Verbose debug output</source>
|
||||||
<translation>詳細なデバッグ出力</translation>
|
<translation>詳細なデバッグ出力</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Enable wl-clipboard support</source>
|
||||||
|
<translation>wl-clipboard によるクリップボード対応を有効にする</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>wl-clipboard パッケージが必要です。</p><p>wl-clipboard v2.2.1 を使用すると、フォーカス盗用のバグにより Deskflow の使い勝手が悪くなる可能性があります。この問題は wl-clipboard のマスターブランチで修正されていますが、使用しているコンポジターが wlroots-data-control プロトコルに対応している必要があります。</p></body></html></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TlsCertificate</name>
|
<name>TlsCertificate</name>
|
||||||
|
|
|
||||||
|
|
@ -1209,10 +1209,6 @@ Enabling this setting will disable the server config GUI.</source>
|
||||||
<source>Enable wl-clipboard support</source>
|
<source>Enable wl-clipboard support</source>
|
||||||
<translation>Врубить поддержку буфера обмена</translation>
|
<translation>Врубить поддержку буфера обмена</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source><html><head/><body><p>Requires the wl-clipboard package.</p><p>When using wl-clipboard v2.2.1. There is a focus stealing bug that may make deskflow harder to use. This has been fixed when using wl-clipboard's master branch.</p></body></html></source>
|
|
||||||
<translation><html><head/><body><p>Дляя этого нужен пакет wl-clipboard.</p><p>Когда ты используешь wl-clipboard v2.2.1. Возникает ошибка перехвата фокуса, которая мешает использовать deskflowю. Это фиксется если использовать wl-clipboard из ветки master .</p></body></html></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>TLS Certificate Regenerated</source>
|
<source>TLS Certificate Regenerated</source>
|
||||||
<translation>Перегенерировать TLS Сертификат</translation>
|
<translation>Перегенерировать TLS Сертификат</translation>
|
||||||
|
|
@ -1261,6 +1257,10 @@ Enabling this setting will disable the server config GUI.</source>
|
||||||
<source>Verbose debug output</source>
|
<source>Verbose debug output</source>
|
||||||
<translation>Подробный отладочный вывод</translation>
|
<translation>Подробный отладочный вывод</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>Для этого необходим пакет wl-clipboard.</p><p>Когда ты используешь wl-clipboard v2.2.1. Возникает ошибка перехвата фокуса, которая мешает использовать deskflowю. Это фиксется если использовать wl-clipboard из ветки master, если только ваш Compositor не поддерживает протокол wlroots-data-control.</p></body></html></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TlsCertificate</name>
|
<name>TlsCertificate</name>
|
||||||
|
|
|
||||||
|
|
@ -1249,6 +1249,14 @@ Enabling this setting will disable the server config GUI.</source>
|
||||||
<source>Verbose debug output</source>
|
<source>Verbose debug output</source>
|
||||||
<translation>详细调试输出</translation>
|
<translation>详细调试输出</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Enable wl-clipboard support</source>
|
||||||
|
<translation>启用 wl-clipboard 支持</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p>Requires the wl-clipboard package</p><p>When using wl-clipboard v2.2.1, there is a focus stealing bug that may make Deskflow harder to use. This has been fixed when using the wl-clipboard master branch, unless your Compositor lacks wlroots-data-control protocol support.</p></body></html></source>
|
||||||
|
<translation><html><head/><body><p>需要 wl-clipboard 包</p><p>使用 wl-clipboard v2.2.1 时存在一个焦点抢夺 Bug,可能导致 Deskflow 使用不便。该问题已在 wl-clipboard 的 master 分支中修复,除非您的合成器不支持 wlroots-data-control 协议。</p></body></html></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TlsCertificate</name>
|
<name>TlsCertificate</name>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue