aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/SDisplay.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win/rfb_win32/SDisplay.cxx')
-rw-r--r--win/rfb_win32/SDisplay.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx
index b930328f..de986ead 100644
--- a/win/rfb_win32/SDisplay.cxx
+++ b/win/rfb_win32/SDisplay.cxx
@@ -27,6 +27,8 @@
#include <assert.h>
+#include <core/LogWriter.h>
+
#include <rfb_win32/SDisplay.h>
#include <rfb_win32/Service.h>
#include <rfb_win32/TsSessions.h>
@@ -35,10 +37,11 @@
#include <rfb_win32/MonitorInfo.h>
#include <rfb_win32/SDisplayCorePolling.h>
#include <rfb_win32/SDisplayCoreWMHooks.h>
-#include <rfb/LogWriter.h>
+#include <rfb/VNCServer.h>
#include <rfb/ledStates.h>
+using namespace core;
using namespace rdr;
using namespace rfb;
using namespace rfb::win32;
@@ -48,11 +51,13 @@ static LogWriter vlog("SDisplay");
// - SDisplay-specific configuration options
IntParameter rfb::win32::SDisplay::updateMethod("UpdateMethod",
- "How to discover desktop updates; 0 - Polling, 1 - Application hooking, 2 - Driver hooking.", 0);
+ "How to discover desktop updates; 0 - Polling, 1 - Application hooking, 2 - Driver hooking.",
+ 0, 0, 2);
BoolParameter rfb::win32::SDisplay::disableLocalInputs("DisableLocalInputs",
"Disable local keyboard and pointer input while the server is in use", false);
-StringParameter rfb::win32::SDisplay::disconnectAction("DisconnectAction",
- "Action to perform when all clients have disconnected. (None, Lock, Logoff)", "None");
+EnumParameter rfb::win32::SDisplay::disconnectAction("DisconnectAction",
+ "Action to perform when all clients have disconnected. (None, Lock, Logoff)",
+ {"None", "Lock", "Logoff"}, "None");
StringParameter displayDevice("DisplayDevice",
"Display device name of the monitor to be remoted, or empty to export the whole desktop.", "");
BoolParameter rfb::win32::SDisplay::removeWallpaper("RemoveWallpaper",
@@ -123,12 +128,12 @@ void SDisplay::stop()
// If we successfully start()ed then perform the DisconnectAction
if (core) {
CurrentUserToken cut;
- if (stricmp(disconnectAction, "Logoff") == 0) {
+ if (disconnectAction == "Logoff") {
if (!cut.h)
vlog.info("Ignoring DisconnectAction=Logoff - no current user");
else
ExitWindowsEx(EWX_LOGOFF, 0);
- } else if (stricmp(disconnectAction, "Lock") == 0) {
+ } else if (disconnectAction == "Lock") {
if (!cut.h) {
vlog.info("Ignoring DisconnectAction=Lock - no current user");
} else {
@@ -460,8 +465,8 @@ SDisplay::recreatePixelBuffer(bool force) {
Rect newScreenRect;
if (strlen(displayDevice) > 0) {
MonitorInfo info(displayDevice);
- newScreenRect = Rect(info.rcMonitor.left, info.rcMonitor.top,
- info.rcMonitor.right, info.rcMonitor.bottom);
+ newScreenRect = {info.rcMonitor.left, info.rcMonitor.top,
+ info.rcMonitor.right, info.rcMonitor.bottom};
} else {
newScreenRect = new_device->getClipBox();
}