Fix closing multiple tabs with middle-click without moving mouse (fix #826)

This commit is contained in:
David Capello 2015-10-13 12:13:13 -03:00
parent 8c97bb1ffa
commit 615e369cc4
2 changed files with 11 additions and 3 deletions

View File

@ -180,6 +180,8 @@ void Tabs::updateTabs()
x += tabWidth;
++i;
}
calculateHot();
invalidate();
}

View File

@ -931,13 +931,13 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
}
// Free all widgets of special states.
if (capture_widget != NULL && capture_widget->getRoot() == window)
if (capture_widget && capture_widget->getRoot() == window)
freeCapture();
if (mouse_widget != NULL && mouse_widget->getRoot() == window)
if (mouse_widget && mouse_widget->getRoot() == window)
freeMouse();
if (focus_widget != NULL && focus_widget->getRoot() == window)
if (focus_widget && focus_widget->getRoot() == window)
freeFocus();
// Hide window.
@ -959,6 +959,12 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
std::find(new_windows.begin(), new_windows.end(), window);
if (it != new_windows.end())
new_windows.erase(it);
// Update mouse widget (as it can be a widget below the
// recently closed window).
Widget* widget = pick(ui::get_mouse_position());
if (widget)
setMouse(widget);
}
bool Manager::onProcessMessage(Message* msg)