1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

(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.

This commit is contained in:
rubidium
2008-12-16 17:58:27 +00:00
parent bfe9743f20
commit 1599ade7ca
7 changed files with 15 additions and 27 deletions

View File

@@ -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;