changeset 18296:3f8406230feb draft

(svn r23132) -Fix: when any keys on te on-screen keyboard were pressed the text cursor disappeared
author yexo <yexo@openttd.org>
date Tue, 08 Nov 2011 15:10:39 +0000
parents cdd65f9bad88
children f5edb136b5c4
files src/osk_gui.cpp
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -157,16 +157,13 @@
 				this->GetWidget<NWidgetCore>(OSK_WIDGET_SHIFT)->colour = HasBit(_keystate, KEYS_SHIFT) ? COLOUR_WHITE : COLOUR_GREY;
 				this->SetDirty();
 			}
+			/* Return focus to the parent widget and window. */
+			this->parent->SetFocusedWidget(this->text_btn);
+			SetFocusedWindow(this->parent);
 			return;
 		}
 
 		switch (widget) {
-			case OSK_WIDGET_TEXT:
-				/* Return focus to the parent widget and window. */
-				this->parent->SetFocusedWidget(this->text_btn);
-				SetFocusedWindow(this->parent);
-				break;
-
 			case OSK_WIDGET_BACKSPACE:
 				if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateParent();
 				break;
@@ -229,6 +226,9 @@
 				}
 				break;
 		}
+		/* Return focus to the parent widget and window. */
+		this->parent->SetFocusedWidget(this->text_btn);
+		SetFocusedWindow(this->parent);
 	}
 
 	void InvalidateParent()