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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user