aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/Viewport.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-07-11 13:05:11 +0200
committerPierre Ossman <ossman@cendio.se>2018-07-11 13:05:11 +0200
commite370e1c8675dc68552162db3036c3e2e8f89bbf0 (patch)
tree0d401433a7f953ecd7c5fe27d67ac6983b845786 /vncviewer/Viewport.cxx
parent6f9589f7b25f835e10fe84b136369073e0089d54 (diff)
downloadtigervnc-e370e1c8675dc68552162db3036c3e2e8f89bbf0.tar.gz
tigervnc-e370e1c8675dc68552162db3036c3e2e8f89bbf0.zip
Fix try/catch for flushPendingClipboard()
We put the try/catch as close as possible to the writes in all other case, so make sure this code also follows that pattern.
Diffstat (limited to 'vncviewer/Viewport.cxx')
-rw-r--r--vncviewer/Viewport.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 317f06b2..ff27f7bf 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -624,16 +624,11 @@ int Viewport::handle(int event)
case FL_FOCUS:
Fl::disable_im();
- try {
- flushPendingClipboard();
+ flushPendingClipboard();
- // We may have gotten our lock keys out of sync with the server
- // whilst we didn't have focus. Try to sort this out.
- pushLEDState();
- } catch (rdr::Exception& e) {
- vlog.error("%s", e.str());
- exit_vncviewer(e.str());
- }
+ // We may have gotten our lock keys out of sync with the server
+ // whilst we didn't have focus. Try to sort this out.
+ pushLEDState();
// Resend Ctrl/Alt if needed
if (menuCtrlKey)
@@ -759,7 +754,12 @@ void Viewport::flushPendingClipboard()
if (pendingClientCutText) {
size_t len = strlen(pendingClientCutText);
vlog.debug("Sending pending clipboard data (%d bytes)", (int)len);
- cc->writer()->writeClientCutText(pendingClientCutText, len);
+ try {
+ cc->writer()->writeClientCutText(pendingClientCutText, len);
+ } catch (rdr::Exception& e) {
+ vlog.error("%s", e.str());
+ exit_vncviewer(e.str());
+ }
}
clearPendingClipboard();