mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +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;
|
return true;
|
||||||
|
|
||||||
case kMouseDownMessage:
|
case kMouseDownMessage:
|
||||||
|
case kMouseUpMessage:
|
||||||
if (m_hot != NULL) {
|
if (m_hot != NULL) {
|
||||||
|
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
|
||||||
|
|
||||||
if (m_selected != m_hot) {
|
if (m_selected != m_hot) {
|
||||||
m_selected = m_hot;
|
m_selected = m_hot;
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_selected && m_delegate)
|
// Left button is processed in mouse down message, right
|
||||||
m_delegate->clickTab(this,
|
// button is processed in mouse up.
|
||||||
m_selected->view,
|
if (m_selected && m_delegate &&
|
||||||
static_cast<MouseMessage*>(msg)->buttons());
|
((mouseMsg->left() && msg->type() == kMouseDownMessage) ||
|
||||||
|
(!mouseMsg->left() && msg->type() == kMouseUpMessage))) {
|
||||||
|
m_delegate->clickTab(this, m_selected->view, mouseMsg->buttons());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -270,10 +270,6 @@ bool MenuItem::hasSubmenu() const
|
|||||||
|
|
||||||
void Menu::showPopup(int x, int y)
|
void Menu::showPopup(int x, int y)
|
||||||
{
|
{
|
||||||
do {
|
|
||||||
jmouse_poll();
|
|
||||||
} while (jmouse_b(0) != kButtonNone);
|
|
||||||
|
|
||||||
// New window and new menu-box
|
// New window and new menu-box
|
||||||
Window* window = new Window(Window::WithoutTitleBar);
|
Window* window = new Window(Window::WithoutTitleBar);
|
||||||
MenuBox* menubox = new MenuBox();
|
MenuBox* menubox = new MenuBox();
|
||||||
|
Loading…
Reference in New Issue
Block a user