From: Pierre Ossman Date: Mon, 18 Nov 2024 12:22:13 +0000 (+0100) Subject: Merge branch 'mouse-button-support' of https://github.com/CendioHalim/tigervnc X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=581698685b9cc3155aed5f5c6c1b293dee44144a;p=tigervnc.git Merge branch 'mouse-button-support' of https://github.com/CendioHalim/tigervnc --- 581698685b9cc3155aed5f5c6c1b293dee44144a diff --cc common/rfb/SMsgWriter.cxx index f525d25a,d1218c11..5ee0905b --- a/common/rfb/SMsgWriter.cxx +++ b/common/rfb/SMsgWriter.cxx @@@ -302,6 -303,14 +302,14 @@@ void SMsgWriter::writeQEMUKeyEvent( needQEMUKeyEvent = true; } + void SMsgWriter::writeExtendedMouseButtonsSupport() + { + if (!client->supportsEncoding(pseudoEncodingExtendedMouseButtons)) - throw Exception("Client does not support Extended Mouse Buttons"); ++ throw std::logic_error("Client does not support Extended Mouse Buttons"); + + needExtMouseButtonsEvent = true; + } + bool SMsgWriter::needFakeUpdate() { if (needSetDesktopName) @@@ -733,3 -751,17 +750,17 @@@ void SMsgWriter::writeQEMUKeyEventRect( os->writeU16(0); os->writeU32(pseudoEncodingQEMUKeyEvent); } + + void SMsgWriter::writeExtendedMouseButtonsRect() + { + if (!client->supportsEncoding(pseudoEncodingExtendedMouseButtons)) - throw Exception("Client does not support extended mouse button events"); ++ throw std::logic_error("Client does not support extended mouse button events"); + if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader) - throw Exception("SMsgWriter::writeExtendedMouseButtonsRect: nRects out of sync"); ++ throw std::logic_error("SMsgWriter::writeExtendedMouseButtonsRect: nRects out of sync"); + + os->writeS16(0); + os->writeS16(0); + os->writeU16(0); + os->writeU16(0); + os->writeU32(pseudoEncodingExtendedMouseButtons); + } diff --cc unix/x0vncserver/XDesktop.h index cadc695f,711d6893..a27a1eae --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@@ -89,8 -79,7 +89,8 @@@ protected rfb::VNCServer* server; QueryConnectDialog* queryConnectDialog; network::Socket* queryConnectSock; + XSelection selection; - uint8_t oldButtonMask; + uint16_t oldButtonMask; bool haveXtest; bool haveDamage; int maxButtons;