diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-04-14 14:10:57 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-04-14 14:10:57 +0000 |
commit | 9d368d6ba22f9bbe27e873bde92f8f970fd197d4 (patch) | |
tree | 0e103edfa90e553f6144cfabdfb6f2af7eb5cc93 /vncviewer/DesktopWindow.cxx | |
parent | d7c5b048cd82f899e276ef1428362ae868a18f5b (diff) | |
download | tigervnc-9d368d6ba22f9bbe27e873bde92f8f970fd197d4.tar.gz tigervnc-9d368d6ba22f9bbe27e873bde92f8f970fd197d4.zip |
Release all pressed keys when we lose focus. This is how we've always done it
and it has been the most sane approach.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4369 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 4c1775fc..189b5210 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -185,6 +185,7 @@ void DesktopWindow::draw() int DesktopWindow::handle(int event) { int buttonMask, wheelMask; + DownMap::const_iterator iter; switch (event) { case FL_PUSH: @@ -219,6 +220,14 @@ int DesktopWindow::handle(int event) // Yes, we would like some focus please! return 1; + case FL_UNFOCUS: + // Release all keys that were pressed as that generally makes most + // sense (e.g. Alt+Tab where we only see the Alt press) + for (iter = downKeySym.begin();iter != downKeySym.end();++iter) + cc->writer()->keyEvent(iter->second, false); + downKeySym.clear(); + return 1; + case FL_KEYDOWN: handleKeyEvent(Fl::event_key(), Fl::event_compose_symbol(), true); return 1; |