diff options
author | rubidium <rubidium@openttd.org> | 2008-12-16 17:58:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-16 17:58:27 +0000 |
commit | 1599ade7caf73fbb49409644357062ef95fc04ad (patch) | |
tree | 7f6e9a1062fc5034eb21ca5b1895d24cae43f965 /src/window.cpp | |
parent | bfe9743f2025adefdf4926a370e5dee6b28ac0b8 (diff) | |
download | openttd-1599ade7caf73fbb49409644357062ef95fc04ad.tar.xz |
(svn r14679) -Fix [FS#2431]: opening the OSK on the chatbox did disable map scrolling (with keyboard) until another window with editbox was opened and closed. Just "refcount" the open edit boxes instead of setting/clearing a bit when opening/closing a window.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp index f12cd573f..f28d4dbdd 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -461,7 +461,13 @@ Window::~Window() if (this->viewport != NULL) DeleteWindowViewport(this); this->SetDirty(); - free(this->widget); + + if (this->widget != NULL) { + for (const Widget *wi = this->widget; wi->type != WWT_LAST; wi++) { + if (wi->type == WWT_EDITBOX) _no_scroll--; + } + free(this->widget); + } } /** @@ -690,6 +696,10 @@ static void AssignWidgetToWindow(Window *w, const Widget *widget) w->widget = MallocT<Widget>(index); memcpy(w->widget, widget, sizeof(*w->widget) * index); w->widget_count = index - 1; + + for (const Widget *wi = w->widget; wi->type != WWT_LAST; wi++) { + if (wi->type == WWT_EDITBOX) _no_scroll++; + } } else { w->widget = NULL; w->widget_count = 0; |