From 1583cd82bd31dd493c125eb42a48624427683e4d Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 11 May 2015 09:53:45 -0300 Subject: [PATCH] Avoid using ESC key to close non-foreground windows --- src/app/ui/skin/skin_theme.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index b297044c6..95f194288 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -80,14 +80,16 @@ protected: return true; case kKeyDownMessage: - if (static_cast(msg)->scancode() == kKeyEsc) { + if (getRoot()->isForeground() && + static_cast(msg)->scancode() == kKeyEsc) { setSelected(true); return true; } break; case kKeyUpMessage: - if (static_cast(msg)->scancode() == kKeyEsc) { + if (getRoot()->isForeground() && + static_cast(msg)->scancode() == kKeyEsc) { if (isSelected()) { setSelected(false); closeWindow();