From 057c512379cf1a14f856daf76baaf82bd8f40a93 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 14 Jun 2023 17:07:17 +0200 Subject: [PATCH] Fix missing XTest build Make sure we can actually build without XTest libraries. --- unix/x0vncserver/XDesktop.cxx | 11 ++++++++++- unix/x0vncserver/XDesktop.h | 12 ++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index e562c6ff..43819f06 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -276,8 +276,10 @@ void XDesktop::start(VNCServer* vs) { void XDesktop::stop() { running = false; +#ifdef HAVE_XTEST // Delete added keycodes deleteAddedKeysyms(dpy); +#endif #ifdef HAVE_XDAMAGE if (haveDamage) @@ -355,6 +357,9 @@ void XDesktop::pointerEvent(const Point& pos, int buttonMask) { } } oldButtonMask = buttonMask; +#else + (void)pos; + (void)buttonMask; #endif } @@ -396,7 +401,6 @@ KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) { return keycode; } -#endif KeyCode XDesktop::addKeysym(Display* dpy, KeySym keysym) { @@ -512,6 +516,7 @@ KeyCode XDesktop::keysymToKeycode(Display* dpy, KeySym keysym) { return keycode; } +#endif void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { @@ -546,6 +551,10 @@ void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { vlog.debug("%d %s", keycode, down ? "down" : "up"); XTestFakeKeyEvent(dpy, keycode, down, CurrentTime); +#else + (void)keysym; + (void)xtcode; + (void)down; #endif } diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index 02217496..99d18065 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -54,10 +54,6 @@ public: virtual void queryConnection(network::Socket* sock, const char* userName); virtual void pointerEvent(const rfb::Point& pos, int buttonMask); - KeyCode XkbKeysymToKeycode(Display* dpy, KeySym keysym); - KeyCode addKeysym(Display* dpy, KeySym keysym); - void deleteAddedKeysyms(Display* dpy); - KeyCode keysymToKeycode(Display* dpy, KeySym keysym); virtual void keyEvent(uint32_t keysym, uint32_t xtcode, bool down); virtual void clientCutText(const char* str); virtual unsigned int setScreenLayout(int fb_width, int fb_height, @@ -101,6 +97,14 @@ protected: unsigned ledState; const unsigned short *codeMap; unsigned codeMapLen; + +protected: +#ifdef HAVE_XTEST + KeyCode XkbKeysymToKeycode(Display* dpy, KeySym keysym); + KeyCode addKeysym(Display* dpy, KeySym keysym); + void deleteAddedKeysyms(Display* dpy); + KeyCode keysymToKeycode(Display* dpy, KeySym keysym); +#endif bool setCursor(); rfb::ScreenSet computeScreenLayout(); }; -- 2.39.5