summaryrefslogtreecommitdiffstats
path: root/vncviewer/vncviewer.cxx
diff options
context:
space:
mode:
authorHugo Lundin <hugo@lundin.dev>2021-07-15 12:52:56 +0200
committerHugo Lundin <hugo@lundin.dev>2021-07-16 16:08:19 +0200
commitc084e586927ff040014d6a8ea8c519b3a9a368d2 (patch)
treef7e29ef1cfb3065dc6297a26b1e8dd6f5f8ddfe9 /vncviewer/vncviewer.cxx
parente2200c2456220c4dcc45024050d36fae6213f894 (diff)
downloadtigervnc-c084e586927ff040014d6a8ea8c519b3a9a368d2.tar.gz
tigervnc-c084e586927ff040014d6a8ea8c519b3a9a368d2.zip
Add fullscreen mode parameter
Before this commit, `FullScreen` and `FullScreenAllMonitors` could be used to configure whether to use the current monitor in fullscreen, or all monitors in fullscreen. This commit deprecates `FullScreenAllMonitors` in favour of `FullScreenMode` (which can either be `current` or `all`). This allows for additional modes to be added, without the risk of having invalid states (for example two activate two different fullscreen modes at the same time). A new concept has been added; read-only parameters. They are parameters that will be read, but never written back. This allows for migration paths to be constructed, where a parameter can be taken to consideration but then for example be discarded, logged or changed into something else. This has been used for `FullScreenAllMonitors` to provide a migration path. On startup of vncviewer, if `FullScreenAllMonitors` is enabled, `FullScreenMode=all` will be automatically enabled instead. The next time the configuration file is written to disk, `FullScreenAllMonitors` will then be removed.
Diffstat (limited to 'vncviewer/vncviewer.cxx')
-rw-r--r--vncviewer/vncviewer.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index bb41a2f7..6a84c7cb 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -435,6 +435,16 @@ potentiallyLoadConfigurationFile(char *vncServerName)
}
}
+static void
+migrateDeprecatedOptions()
+{
+ if (fullScreenAllMonitors) {
+ vlog.info(_("FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead."));
+
+ fullScreenMode.setParam("all");
+ }
+}
+
#ifndef WIN32
static int
interpretViaParam(char *remoteHost, int *remotePort, int localPort)
@@ -613,6 +623,8 @@ int main(int argc, char** argv)
// Check if the server name in reality is a configuration file
potentiallyLoadConfigurationFile(vncServerName);
+ migrateDeprecatedOptions();
+
mkvnchomedir();
CSecurity::upg = &dlg;