Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic hot key combo for client control #1375

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion common/rfb/ClientParams.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
#include <rfb/ledStates.h>
#include <rfb/clipboardTypes.h>
#include <rfb/ClientParams.h>
#include <rfb/LogWriter.h>
#include <rfb/util.h>

using namespace rfb;

static LogWriter vlog("ClientParams");

ClientParams::ClientParams()
: majorVersion(0), minorVersion(0),
compressLevel(2), qualityLevel(-1), fineQualityLevel(-1),
Expand Down Expand Up @@ -63,8 +66,14 @@ void ClientParams::setDimensions(int width, int height)

void ClientParams::setDimensions(int width, int height, const ScreenSet& layout)
{
if (!layout.validate(width, height))
if (!layout.validate(width, height)) {
char buffer[2048];
vlog.debug("Invalid screen layout for %dx%d:", width, height);
layout.print(buffer, sizeof(buffer));
vlog.debug("%s", buffer);

throw std::invalid_argument("Attempted to configure an invalid screen layout");
}

width_ = width;
height_ = height;
Expand Down
11 changes: 10 additions & 1 deletion common/rfb/ServerParams.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
#include <stdexcept>

#include <rfb/ledStates.h>
#include <rfb/LogWriter.h>
#include <rfb/ServerParams.h>
#include <rfb/util.h>

using namespace rfb;

static LogWriter vlog("ServerParams");

ServerParams::ServerParams()
: majorVersion(0), minorVersion(0),
supportsQEMUKeyEvent(false),
Expand Down Expand Up @@ -60,8 +63,14 @@ void ServerParams::setDimensions(int width, int height)

void ServerParams::setDimensions(int width, int height, const ScreenSet& layout)
{
if (!layout.validate(width, height))
if (!layout.validate(width, height)) {
char buffer[2048];
vlog.debug("Invalid screen layout for %dx%d:", width, height);
layout.print(buffer, sizeof(buffer));
vlog.debug("%s", buffer);

throw std::invalid_argument("Attempted to configure an invalid screen layout");
}

width_ = width;
height_ = height;
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ target_link_libraries(gesturehandler rfb)
add_executable(hostport hostport.cxx)
target_link_libraries(hostport rfb)

add_executable(hotkeyhandler hotkeyhandler.cxx ../../vncviewer/HotKeyHandler.cxx)
target_link_libraries(hotkeyhandler rfb ${GETTEXT_LIBRARIES})

add_executable(pixelformat pixelformat.cxx)
target_link_libraries(pixelformat rfb)

Expand Down
Loading
Loading