From f7fef928f910ac4a7bff869567d250e956b9edbc Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 10 Dec 2015 21:24:08 +0100 Subject: [PATCH] Only show sendPrimary on X11 platforms Primary selection is inherently a X11 concept so there is no point showing the settings related to it on other platforms. --- vncviewer/OptionsDialog.cxx | 6 ++++++ vncviewer/OptionsDialog.h | 2 ++ vncviewer/Viewport.cxx | 2 ++ vncviewer/parameters.cxx | 4 ++++ vncviewer/parameters.h | 2 ++ 5 files changed, 16 insertions(+) diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index 3c8fcb48..f112a529 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -264,7 +264,9 @@ void OptionsDialog::loadOptions(void) viewOnlyCheckbox->value(viewOnly); acceptClipboardCheckbox->value(acceptClipboard); sendClipboardCheckbox->value(sendClipboard); +#if !defined(WIN32) && !defined(__APPLE__) sendPrimaryCheckbox->value(sendPrimary); +#endif systemKeysCheckbox->value(fullscreenSystemKeys); menuKeyChoice->value(0); @@ -372,7 +374,9 @@ void OptionsDialog::storeOptions(void) viewOnly.setParam(viewOnlyCheckbox->value()); acceptClipboard.setParam(acceptClipboardCheckbox->value()); sendClipboard.setParam(sendClipboardCheckbox->value()); +#if !defined(WIN32) && !defined(__APPLE__) sendPrimary.setParam(sendPrimaryCheckbox->value()); +#endif fullscreenSystemKeys.setParam(systemKeysCheckbox->value()); if (menuKeyChoice->value() == 0) @@ -698,11 +702,13 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) _("Send clipboard to server"))); ty += CHECK_HEIGHT + TIGHT_MARGIN; +#if !defined(WIN32) && !defined(__APPLE__) sendPrimaryCheckbox = new Fl_Check_Button(LBLRIGHT(tx, ty, CHECK_MIN_WIDTH, CHECK_HEIGHT, _("Send primary selection and cut buffer as clipboard"))); ty += CHECK_HEIGHT + TIGHT_MARGIN; +#endif systemKeysCheckbox = new Fl_Check_Button(LBLRIGHT(tx, ty, CHECK_MIN_WIDTH, diff --git a/vncviewer/OptionsDialog.h b/vncviewer/OptionsDialog.h index a6b504e9..39bd7afa 100644 --- a/vncviewer/OptionsDialog.h +++ b/vncviewer/OptionsDialog.h @@ -107,7 +107,9 @@ protected: Fl_Check_Button *viewOnlyCheckbox; Fl_Check_Button *acceptClipboardCheckbox; Fl_Check_Button *sendClipboardCheckbox; +#if !defined(WIN32) && !defined(__APPLE__) Fl_Check_Button *sendPrimaryCheckbox; +#endif Fl_Check_Button *systemKeysCheckbox; Fl_Choice *menuKeyChoice; diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 1bc0b821..a12f783b 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -403,8 +403,10 @@ void Viewport::handleClipboardChange(int source, void *data) assert(self); +#if !defined(WIN32) && !defined(__APPLE__) if (!sendPrimary && (source == 0)) return; +#endif Fl::paste(*self, source); } diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index 7cce1cd7..9a9b9fd7 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -122,10 +122,12 @@ BoolParameter acceptClipboard("AcceptClipboard", true); BoolParameter sendClipboard("SendClipboard", "Send clipboard changes to the server", true); +#if !defined(WIN32) && !defined(__APPLE__) BoolParameter sendPrimary("SendPrimary", "Send the primary selection and cut buffer to the " "server as well as the clipboard selection", true); +#endif StringParameter menuKey("MenuKey", "The key which brings up the popup menu", "F8"); @@ -165,7 +167,9 @@ static VoidParameter* parameterArray[] = { &shared, &acceptClipboard, &sendClipboard, +#if !defined(WIN32) && !defined(__APPLE__) &sendPrimary, +#endif &menuKey, &fullscreenSystemKeys }; diff --git a/vncviewer/parameters.h b/vncviewer/parameters.h index 0de61d2f..e4378c85 100644 --- a/vncviewer/parameters.h +++ b/vncviewer/parameters.h @@ -52,7 +52,9 @@ extern rfb::BoolParameter shared; extern rfb::BoolParameter acceptClipboard; extern rfb::BoolParameter sendClipboard; +#if !defined(WIN32) && !defined(__APPLE__) extern rfb::BoolParameter sendPrimary; +#endif extern rfb::StringParameter menuKey; -- 2.39.5