From: Pierre Ossman Date: Wed, 14 Jun 2023 15:07:17 +0000 (+0200) Subject: Fix missing XTest build X-Git-Tag: v1.13.90~74^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=057c512379cf1a14f856daf76baaf82bd8f40a93;p=tigervnc.git Fix missing XTest build Make sure we can actually build without XTest libraries. --- 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(); };