Dear OmegaPhil, dear Maintainer,
thanks to the debug work of OmegaPhil, it was quite easy to find a
solution for this bug. The framebuffer code in ssvnc uses "XGrab"
events. Every time the mouse is clicked, a "XGrab" event is triggered.
According to the XLib documentation, XGrab events trigger a LeaveNotify
Event with xcrossing.mode set to "NotifyGrab".
The solution is to only execute "releaseAllPressedModifiers();" when
there was a "NotifyNormal" LeaveNotify event. As said, the status of the
Leavenotify event can be found in "ev->xcrossing.mode".
The patch would then look like the following:

--- ssvnc-1.0.29.orig/vnc_unixsrc/vncviewer/desktop.c
+++ ssvnc-1.0.29/vnc_unixsrc/vncviewer/desktop.c
@@ -1652,7 +1652,9 @@ HandleBasicDesktopEvent(Widget w, XtPoin
        break;

   case LeaveNotify:
-       releaseAllPressedModifiers();
+       if (ev->xcrossing.mode == NotifyNormal) {
+           releaseAllPressedModifiers();
+       }
        if (appData.fullScreen) {
                fs_ungrab(1);
        }


Hope we can include that one in the upcoming debian stretch, because it
fixes an annoying thing.


Regards
Tim

-- 
Tim Fischer

--- ssvnc-1.0.29.orig/vnc_unixsrc/vncviewer/desktop.c
+++ ssvnc-1.0.29/vnc_unixsrc/vncviewer/desktop.c
@@ -1652,7 +1652,9 @@ HandleBasicDesktopEvent(Widget w, XtPoin
 	break;
 
   case LeaveNotify:
-	releaseAllPressedModifiers();
+	if (ev->xcrossing.mode == NotifyNormal) {
+	    releaseAllPressedModifiers();
+	}
 	if (appData.fullScreen) {
 		fs_ungrab(1);
 	}

Reply via email to