From 3ec76bd5eb9d70ba3dde7dcfd5c5e0aa3d7d3617 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20=C3=85strand=20=28astrand=29?= Date: Mon, 29 Jan 2018 10:42:44 +0100 Subject: [PATCH] Don't parse FLTK arguments using Fl::arg; handle -display as other options Fl::arg accepts several arguments which we are not documenting. Also, it accepts a -geometry argument, which clashes with our own -geometry option. --- vncviewer/parameters.cxx | 3 +++ vncviewer/parameters.h | 1 + vncviewer/vncviewer.cxx | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index 39a7f075..d24e5bcc 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -134,6 +134,9 @@ BoolParameter sendPrimary("SendPrimary", "Send the primary selection to the " "server as well as the clipboard selection", true); +StringParameter display("display", + "Specifies the X display on which the VNC viewer window should appear.", + ""); #endif StringParameter menuKey("MenuKey", "The key which brings up the popup menu", diff --git a/vncviewer/parameters.h b/vncviewer/parameters.h index 9ce56b97..2ccd9287 100644 --- a/vncviewer/parameters.h +++ b/vncviewer/parameters.h @@ -55,6 +55,7 @@ extern rfb::BoolParameter setPrimary; extern rfb::BoolParameter sendClipboard; #if !defined(WIN32) && !defined(__APPLE__) extern rfb::BoolParameter sendPrimary; +extern rfb::StringParameter display; #endif extern rfb::StringParameter menuKey; diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 426be27b..bd3a562d 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -495,9 +495,6 @@ int main(int argc, char** argv) } for (int i = 1; i < argc;) { - if (Fl::arg(argc, argv, i)) - continue; - if (Configuration::setParam(argv[i])) { i++; continue; @@ -522,6 +519,9 @@ int main(int argc, char** argv) mkvnchomedir(); #if !defined(WIN32) && !defined(__APPLE__) + if (strcmp(display, "") != 0) { + Fl::display(display); + } fl_open_display(); XkbSetDetectableAutoRepeat(fl_display, True, NULL); #endif -- 2.39.5