summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:31:04 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:31:04 +0000
commitee4e68bd5e4882397bc023040a2977047d22ccb7 (patch)
tree79ae645add9d9321b815287a2a68d7850100117f /src/window.cpp
parent5cb174c6b86c58b2ff6ec0d245e546328fae6480 (diff)
downloadopenttd-ee4e68bd5e4882397bc023040a2977047d22ccb7.tar.xz
(svn r25413) -Fix-ish: Suppress focussing editboxes which are not visible.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 297143ebe..4953cefda 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -482,6 +482,8 @@ EventState Window::OnHotkey(int hotkey)
if (nw == NULL || nw->IsDisabled()) return ES_NOT_HANDLED;
if (nw->type == WWT_EDITBOX) {
+ if (this->IsShaded()) return ES_NOT_HANDLED;
+
/* Focus editbox */
this->SetFocusedWidget(hotkey);
SetFocusedWindow(this);
@@ -891,6 +893,7 @@ void Window::SetShaded(bool make_shaded)
int desired = make_shaded ? SZSP_HORIZONTAL : 0;
if (this->shade_select->shown_plane != desired) {
if (make_shaded) {
+ if (this->nested_focus != NULL) this->UnfocusFocusedWidget();
this->unshaded_size.width = this->width;
this->unshaded_size.height = this->height;
this->shade_select->SetDisplayedPlane(desired);