Properly update the entire mouse state.

When a window closes, not only update the mouse position but also the
button status.
This commit is contained in:
Mark de Wever 2010-12-26 20:54:31 +00:00
parent db4ff78b99
commit 84f3d21f18
2 changed files with 3 additions and 1 deletions

View file

@ -662,6 +662,8 @@ void tdistributor::initialize_state()
tmouse_button_left::initialize_state(button_state & SDL_BUTTON(1));
tmouse_button_middle::initialize_state(button_state & SDL_BUTTON(2));
tmouse_button_right::initialize_state(button_state & SDL_BUTTON(3));
init_mouse_location();
}
void tdistributor::keyboard_capture(twidget* widget)

View file

@ -386,7 +386,7 @@ void thandler::disconnect(tdispatcher* dispatcher)
dynamic_cast<twidget&>(*dispatcher).set_dirty();
}
init_mouse_location();
activate();
/***** Validate post conditions. *****/
assert(std::find(dispatchers_.begin(), dispatchers_.end(), dispatcher)