From: Pierre Ossman Date: Mon, 23 Sep 2024 14:17:39 +0000 (+0200) Subject: Explicitly clean up grabs on disconnect X-Git-Tag: v1.14.1~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c6c22d00ad0eba438506eeb2a73ebab9feac6b9d;p=tigervnc.git 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. (cherry picked from commit 43ce674dfbd2576fe5b382ad9f87e5beebc72812) --- diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 7d7ae7c3..33dd2dd0 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);