mirror of
https://github.com/86Box/86Box.git
synced 2025-01-23 09:42:47 -05:00
Fix unsolicited mouse captures after a double-click in an file selection dialog
This commit is contained in:
parent
129ffab728
commit
45520768ba
2 changed files with 6 additions and 1 deletions
|
@ -89,26 +89,30 @@ void RendererStack::mousePoll()
|
|||
int ignoreNextMouseEvent = 1;
|
||||
void RendererStack::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture)
|
||||
if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture && (isMouseDown & 1))
|
||||
{
|
||||
plat_mouse_capture(1);
|
||||
this->setCursor(Qt::BlankCursor);
|
||||
if (!ignoreNextMouseEvent) ignoreNextMouseEvent++; // Avoid jumping cursor when moved.
|
||||
isMouseDown &= ~1;
|
||||
return;
|
||||
}
|
||||
if (mouse_capture && event->button() == Qt::MiddleButton && mouse_get_buttons() < 3)
|
||||
{
|
||||
plat_mouse_capture(0);
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
isMouseDown &= ~1;
|
||||
return;
|
||||
}
|
||||
if (mouse_capture)
|
||||
{
|
||||
mousedata.mousebuttons &= ~event->button();
|
||||
}
|
||||
isMouseDown &= ~1;
|
||||
}
|
||||
void RendererStack::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
isMouseDown |= 1;
|
||||
if (mouse_capture)
|
||||
{
|
||||
mousedata.mousebuttons |= event->button();
|
||||
|
|
|
@ -64,6 +64,7 @@ private:
|
|||
int x, y, w, h, sx, sy, sw, sh;
|
||||
|
||||
int currentBuf = 0;
|
||||
int isMouseDown = 0;
|
||||
std::vector<std::tuple<uint8_t*, std::atomic_flag*>> imagebufs;
|
||||
|
||||
std::unique_ptr<QWidget> current;
|
||||
|
|
Loading…
Add table
Reference in a new issue