sharkcz / rpms / tigervnc

Forked from rpms/tigervnc 4 years ago
Clone
9c672c1
From be88293952175258992c1ed2f5a1b7d8f78fe7cc Mon Sep 17 00:00:00 2001
9c672c1
From: Pierre Ossman <ossman@cendio.se>
9c672c1
Date: Tue, 31 Jul 2018 16:06:59 +0200
9c672c1
Subject: Ignore buttons in mouse leave events
9c672c1
9c672c1
For KDE we can sometimes get a bunch of stray FL_LEAVE events before
9c672c1
gaining focus. Sending their included button information gets things
9c672c1
in the incorrect order with regard to other synchronisation we do on
9c672c1
focus. So just ignore buttons as the only information we want out of
9c672c1
the leave information is a position update.
9c672c1
9c672c1
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
9c672c1
index ff27f7bf..7b5df572 100644
9c672c1
--- a/vncviewer/Viewport.cxx
9c672c1
+++ b/vncviewer/Viewport.cxx
9c672c1
@@ -587,7 +587,10 @@ int Viewport::handle(int event)
9c672c1
 
9c672c1
   case FL_LEAVE:
9c672c1
     window()->cursor(FL_CURSOR_DEFAULT);
9c672c1
-    // Fall through as we want a last move event to help trigger edge stuff
9c672c1
+    // We want a last move event to help trigger edge stuff
9c672c1
+    handlePointerEvent(Point(Fl::event_x() - x(), Fl::event_y() - y()), 0);
9c672c1
+    return 1;
9c672c1
+
9c672c1
   case FL_PUSH:
9c672c1
   case FL_RELEASE:
9c672c1
   case FL_DRAG: