From 6880b03c046f41c595965556f271bb72b10fce44 Mon Sep 17 00:00:00 2001 From: Matt McClaskey Date: Thu, 21 May 2026 09:34:00 +0000 Subject: [PATCH] address DLP region clicks --- unix/xserver/hw/vnc/XserverDesktop.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 3598a74..8ecfec8 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -546,7 +546,23 @@ rfb::Point XserverDesktop::directMouseEventWithPosition(int dx, int dy, cursorY = maxY; vncPointerMoveRelative(dx, dy, cursorX, cursorY); - vncPointerButtonAction(buttonMask, false, false); + + bool skipclick = false, skiprelease = false; + if (server->DLPRegion.enabled) { + rdr::U16 x1, y1, x2, y2; + server->translateDLPRegion(x1, y1, x2, y2); + + rfb::Point cursorPos(cursorX - screenX, cursorY - screenY); + if (cursorPos.x < x1 || cursorPos.x >= x2 || + cursorPos.y < y1 || cursorPos.y >= y2) { + if (!rfb::Server::DLP_RegionAllowClick) + skipclick = true; + if (!rfb::Server::DLP_RegionAllowRelease) + skiprelease = true; + } + } + + vncPointerButtonAction(buttonMask, skipclick, skiprelease); } else { vncScroll(scrollX, scrollY); }