Fix the not properly drawing glitch.

When a window is closed the other dispatchers need to be set dirty so
they really redraw themselves the next drawing cycle.
This commit is contained in:
Mark de Wever 2009-10-16 19:42:45 +00:00
parent c1634e23d4
commit a6430e08f6
2 changed files with 8 additions and 3 deletions

View File

@ -320,10 +320,12 @@ void thandler::connect(tdispatcher* dispatcher)
void thandler::disconnect(tdispatcher* dispatcher)
{
/***** Validate pre conditions. *****/
std::vector<tdispatcher*>::iterator itor =
std::find(dispatchers_.begin(), dispatchers_.end(), dispatcher);
assert(itor != dispatchers_.end());
/***** Remove dispatcher. *****/
dispatchers_.erase(itor);
if(dispatcher == mouse_focus) {
@ -333,6 +335,12 @@ void thandler::disconnect(tdispatcher* dispatcher)
keyboard_focus_ = NULL;
}
/***** Set proper state for the other dispatchers. *****/
foreach(tdispatcher* dispatcher, dispatchers_) {
dynamic_cast<twidget&>(*dispatcher).set_dirty();
}
/***** Validate post conditions. *****/
assert(std::find(dispatchers_.begin(), dispatchers_.end(), dispatcher)
== dispatchers_.end());
#ifndef GUI2_OLD_EVENT_HANDLING

View File

@ -191,9 +191,6 @@ void tmp_connect::show_server_list(twindow& window)
if(dlg.get_retval() == twindow::OK) {
host_name_->set_widget_value(window, dlg.host_name());
}
/** @todo FIXME hack to force redraw. */
window.invalidate_layout();
}
/*WIKI