2016-09-13 16:12:30 +02:00
|
|
|
Index: tigervnc-1.7.0/vncviewer/DesktopWindow.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2016-09-13 16:12:30 +02:00
|
|
|
--- tigervnc-1.7.0.orig/vncviewer/DesktopWindow.cxx
|
|
|
|
+++ tigervnc-1.7.0/vncviewer/DesktopWindow.cxx
|
2015-07-15 16:13:40 +02:00
|
|
|
@@ -177,6 +177,8 @@ DesktopWindow::~DesktopWindow()
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
OptionsDialog::removeCallback(handleOptions);
|
|
|
|
|
|
|
|
+ delete viewport;
|
|
|
|
+
|
|
|
|
// FLTK automatically deletes all child widgets, so we shouldn't touch
|
|
|
|
// them ourselves here
|
|
|
|
}
|
2016-09-13 16:12:30 +02:00
|
|
|
Index: tigervnc-1.7.0/vncviewer/Viewport.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2016-09-13 16:12:30 +02:00
|
|
|
--- tigervnc-1.7.0.orig/vncviewer/Viewport.cxx
|
|
|
|
+++ tigervnc-1.7.0/vncviewer/Viewport.cxx
|
|
|
|
@@ -140,6 +140,11 @@ 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) {
|
|
|
|
+ cc->writer()->keyEvent(iter->second, false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// 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);
|
2016-09-13 16:12:30 +02:00
|
|
|
Index: tigervnc-1.7.0/vncviewer/vncviewer.cxx
|
2015-01-09 14:08:09 +01:00
|
|
|
===================================================================
|
2016-09-13 16:12:30 +02:00
|
|
|
--- tigervnc-1.7.0.orig/vncviewer/vncviewer.cxx
|
|
|
|
+++ tigervnc-1.7.0/vncviewer/vncviewer.cxx
|
2015-07-15 16:13:40 +02:00
|
|
|
@@ -107,6 +107,8 @@ static const char *about_text()
|
|
|
|
return buffer;
|
|
|
|
}
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
+static CConn *cc;
|
|
|
|
+
|
|
|
|
void exit_vncviewer(const char *error)
|
|
|
|
{
|
|
|
|
// Prioritise the first error we get as that is probably the most
|
2016-09-13 16:12:30 +02:00
|
|
|
@@ -177,6 +179,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);
|
|
|
|
}
|
|
|
|
|
2016-09-13 16:12:30 +02:00
|
|
|
@@ -481,11 +493,19 @@ int main(int argc, char** argv)
|
2013-12-03 16:35:36 +01:00
|
|
|
|
|
|
|
init_fltk();
|
|
|
|
|
2015-01-09 14:08:09 +01:00
|
|
|
+ fl_open_display();
|
|
|
|
+
|
|
|
|
+ XSetIOErrorHandler(CleanupXIOErrorHandler);
|
|
|
|
+
|
|
|
|
#if !defined(WIN32) && !defined(__APPLE__)
|
|
|
|
fl_open_display();
|
|
|
|
XkbSetDetectableAutoRepeat(fl_display, True, NULL);
|
|
|
|
#endif
|
|
|
|
|
2013-12-03 16:35:36 +01:00
|
|
|
+ fl_open_display();
|
|
|
|
+
|
|
|
|
+ XSetIOErrorHandler(CleanupXIOErrorHandler);
|
|
|
|
+
|
|
|
|
Configuration::enableViewerParams();
|
|
|
|
|
|
|
|
/* Load the default parameter settings */
|
2016-09-13 16:12:30 +02:00
|
|
|
@@ -602,7 +622,7 @@ int main(int argc, char** argv)
|
2013-12-03 16:35:36 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
- CConn *cc = new CConn(vncServerName, sock);
|
|
|
|
+ cc = new CConn(vncServerName, sock);
|
|
|
|
|
2016-09-13 16:12:30 +02:00
|
|
|
while (!exitMainloop)
|
|
|
|
run_mainloop();
|