diff options
Diffstat (limited to 'src/client/vnc/vncwindow.cpp')
-rw-r--r-- | src/client/vnc/vncwindow.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp index 818b22f..8cd7534 100644 --- a/src/client/vnc/vncwindow.cpp +++ b/src/client/vnc/vncwindow.cpp @@ -17,6 +17,7 @@ #include "vncwindow.h" #include "vncthread.h" +#include "../clientapp/clientapp.h" VncWindow::VncWindow(QWidget *parent) : QWidget(parent), _vncWorker(NULL), _viewOnly(true), _clientId(0), _redrawTimer(0), _tcpTimeoutTimer(0) @@ -109,7 +110,10 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool _remoteThumb.loadFromData(rawThumb); if (fullscreen) { - setWindowFlags(Qt::WindowStaysOnTopHint); + setWindowFlags(Qt::WindowStaysOnTopHint); // | Qt::X11BypassWindowManagerHint); <- better, but window won't get any keyboard input + QDesktopWidget *desktop = QApplication::desktop(); + QRect size = desktop->screenGeometry(this); + resize(size.size()); showFullScreen(); activateWindow(); raise(); @@ -258,3 +262,15 @@ void VncWindow::resizeEvent(QResizeEvent* event) this->repaint(); } +/** + * Called when user releases a pressed key and the window has focus + */ +void VncWindow::keyReleaseEvent(QKeyEvent* event) +{ + if (event->modifiers() == 0 && event->key() == Qt::Key_Escape && !clientApp->isConnectedToLocalManager()) { + this->close(); + } else { + QWidget::keyReleaseEvent(event); + } +} + |