2022-02-17 11:42:51 +01:00
|
|
|
Index: tigervnc-1.12.0/vncviewer/DesktopWindow.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2022-02-17 11:42:51 +01:00
|
|
|
--- tigervnc-1.12.0.orig/vncviewer/DesktopWindow.cxx
|
|
|
|
+++ tigervnc-1.12.0/vncviewer/DesktopWindow.cxx
|
|
|
|
@@ -236,6 +236,8 @@ DesktopWindow::~DesktopWindow()
|
2013-12-03 16:35:36 +01:00
|
|
|
|
2017-05-31 13:59:52 +02:00
|
|
|
delete statsGraph;
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
+ delete viewport;
|
|
|
|
+
|
2022-02-17 11:42:51 +01:00
|
|
|
instances.erase(this);
|
|
|
|
|
|
|
|
if (instances.size() == 0)
|
|
|
|
Index: tigervnc-1.12.0/vncviewer/Viewport.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2022-02-17 11:42:51 +01:00
|
|
|
--- tigervnc-1.12.0.orig/vncviewer/Viewport.cxx
|
|
|
|
+++ tigervnc-1.12.0/vncviewer/Viewport.cxx
|
|
|
|
@@ -192,6 +192,18 @@ Viewport::Viewport(int w, int h, const r
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
Viewport::~Viewport()
|
|
|
|
{
|
|
|
|
+ // Send release for every pressed key
|
|
|
|
+ for(DownMap::iterator iter = downKeySym.begin(); iter != downKeySym.end(); ++iter) {
|
2018-08-02 11:24:03 +02:00
|
|
|
+ try {
|
|
|
|
+ if (iter->first > 0xff)
|
|
|
|
+ cc->writer()->writeKeyEvent(iter->second, 0, false);
|
|
|
|
+ else
|
|
|
|
+ cc->writer()->writeKeyEvent(iter->second, iter->first, false);
|
|
|
|
+ } catch (rdr::Exception& e) {
|
|
|
|
+ // ignore
|
|
|
|
+ }
|
2013-12-03 16:35:36 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// Unregister all timeouts in case they get a change tro trigger
|
|
|
|
// again later when this object is already gone.
|
2015-01-09 14:08:09 +01:00
|
|
|
Fl::remove_timeout(handlePointerTimeout, this);
|
2022-02-17 11:42:51 +01:00
|
|
|
Index: tigervnc-1.12.0/vncviewer/vncviewer.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2022-02-17 11:42:51 +01:00
|
|
|
--- tigervnc-1.12.0.orig/vncviewer/vncviewer.cxx
|
|
|
|
+++ tigervnc-1.12.0/vncviewer/vncviewer.cxx
|
|
|
|
@@ -113,6 +113,7 @@ static const char *about_text()
|
2015-07-15 16:13:40 +02:00
|
|
|
return buffer;
|
|
|
|
}
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
+static CConn *cc;
|
2022-02-17 11:42:51 +01:00
|
|
|
|
|
|
|
void abort_vncviewer(const char *error, ...)
|
2013-12-03 16:35:36 +01:00
|
|
|
{
|
2022-02-17 11:42:51 +01:00
|
|
|
@@ -176,8 +177,6 @@ void about_vncviewer()
|
|
|
|
static void mainloop(const char* vncserver, network::Socket* sock)
|
|
|
|
{
|
|
|
|
while (true) {
|
|
|
|
- CConn *cc;
|
|
|
|
-
|
|
|
|
exitMainloop = false;
|
|
|
|
|
|
|
|
cc = new CConn(vncServerName, sock);
|
|
|
|
@@ -262,6 +261,16 @@ static void CleanupSignalHandler(int sig
|
2013-12-03 16:35:36 +01:00
|
|
|
// CleanupSignalHandler allows C++ object cleanup to happen because it calls
|
|
|
|
// exit() rather than the default which is to abort.
|
2015-07-15 16:13:40 +02:00
|
|
|
vlog.info(_("Termination signal %d has been received. TigerVNC Viewer will now exit."), sig);
|
2013-12-03 16:35:36 +01:00
|
|
|
+ delete cc;
|
|
|
|
+ exit(1);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int CleanupXIOErrorHandler(Display *dpy)
|
|
|
|
+{
|
|
|
|
+ // CleanupSignalHandler allows C++ object cleanup to happen because it calls
|
|
|
|
+ // exit() rather than the default which is to abort.
|
|
|
|
+ vlog.info("XErrorHandler called");
|
|
|
|
+ delete cc;
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2022-02-17 11:42:51 +01:00
|
|
|
@@ -744,6 +753,9 @@ int main(int argc, char** argv)
|
2015-01-09 14:08:09 +01:00
|
|
|
XkbSetDetectableAutoRepeat(fl_display, True, NULL);
|
|
|
|
#endif
|
|
|
|
|
2013-12-03 16:35:36 +01:00
|
|
|
+ fl_open_display();
|
|
|
|
+ XSetIOErrorHandler(CleanupXIOErrorHandler);
|
|
|
|
+
|
2022-02-17 11:42:51 +01:00
|
|
|
init_fltk();
|
|
|
|
enable_touch();
|
2013-12-03 16:35:36 +01:00
|
|
|
|