mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Don't block Menu::showPopup() with a customized event loop
We must call Menu::showPopup() in ui::kMouseUpMessage message.
This commit is contained in:
parent
67f9354b3d
commit
b1b4ed8b39
@ -273,16 +273,22 @@ bool Tabs::onProcessMessage(Message* msg)
|
||||
return true;
|
||||
|
||||
case kMouseDownMessage:
|
||||
case kMouseUpMessage:
|
||||
if (m_hot != NULL) {
|
||||
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
|
||||
|
||||
if (m_selected != m_hot) {
|
||||
m_selected = m_hot;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
if (m_selected && m_delegate)
|
||||
m_delegate->clickTab(this,
|
||||
m_selected->view,
|
||||
static_cast<MouseMessage*>(msg)->buttons());
|
||||
// Left button is processed in mouse down message, right
|
||||
// button is processed in mouse up.
|
||||
if (m_selected && m_delegate &&
|
||||
((mouseMsg->left() && msg->type() == kMouseDownMessage) ||
|
||||
(!mouseMsg->left() && msg->type() == kMouseUpMessage))) {
|
||||
m_delegate->clickTab(this, m_selected->view, mouseMsg->buttons());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -270,10 +270,6 @@ bool MenuItem::hasSubmenu() const
|
||||
|
||||
void Menu::showPopup(int x, int y)
|
||||
{
|
||||
do {
|
||||
jmouse_poll();
|
||||
} while (jmouse_b(0) != kButtonNone);
|
||||
|
||||
// New window and new menu-box
|
||||
Window* window = new Window(Window::WithoutTitleBar);
|
||||
MenuBox* menubox = new MenuBox();
|
||||
|
Loading…
Reference in New Issue
Block a user