aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/DesktopWindow.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-23 16:17:39 +0200
committerPierre Ossman <ossman@cendio.se>2024-09-23 16:17:39 +0200
commit43ce674dfbd2576fe5b382ad9f87e5beebc72812 (patch)
tree941558616a3ab44dfd0381a4d25d165ed0c3c4c9 /vncviewer/DesktopWindow.cxx
parent2fe9dca45f7d0a519fef5053ba61e2db7c1ff2b1 (diff)
downloadtigervnc-43ce674dfbd2576fe5b382ad9f87e5beebc72812.tar.gz
tigervnc-43ce674dfbd2576fe5b382ad9f87e5beebc72812.zip
Explicitly clean up grabs on disconnect
They are not automatically cleaned up with the window on Windows, and we might want to reconnect so we cannot rely on the process cleanup either.
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r--vncviewer/DesktopWindow.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 2d363781..584debd1 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -245,6 +245,11 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name,
DesktopWindow::~DesktopWindow()
{
+ // Don't leave any dangling grabs as they are not automatically
+ // cleaned up on all platforms
+ ungrabPointer();
+ ungrabKeyboard();
+
// Unregister all timeouts in case they get a change tro trigger
// again later when this object is already gone.
Fl::remove_timeout(handleGrab, this);