mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
make sure it doesn't crash if you click the window while nothing is loaded
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
This commit is contained in:
parent
4ba8f330c4
commit
6dc396741f
@ -222,6 +222,7 @@ void ScreenPanel::resizeEvent(QResizeEvent* event)
|
||||
void ScreenPanel::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
event->accept();
|
||||
if (!emuInstance->emuIsActive()) { touching = false; return; }
|
||||
if (event->button() != Qt::LeftButton) return;
|
||||
|
||||
int x = event->pos().x();
|
||||
@ -238,6 +239,7 @@ void ScreenPanel::mousePressEvent(QMouseEvent* event)
|
||||
void ScreenPanel::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
event->accept();
|
||||
if (!emuInstance->emuIsActive()) { touching = false; return; }
|
||||
if (event->button() != Qt::LeftButton) return;
|
||||
|
||||
if (touching)
|
||||
@ -254,6 +256,7 @@ void ScreenPanel::mouseMoveEvent(QMouseEvent* event)
|
||||
|
||||
showCursor();
|
||||
|
||||
if (!emuInstance->emuIsActive()) return;
|
||||
//if (!(event->buttons() & Qt::LeftButton)) return;
|
||||
if (!touching) return;
|
||||
|
||||
@ -270,6 +273,7 @@ void ScreenPanel::mouseMoveEvent(QMouseEvent* event)
|
||||
void ScreenPanel::tabletEvent(QTabletEvent* event)
|
||||
{
|
||||
event->accept();
|
||||
if (!emuInstance->emuIsActive()) { touching = false; return; }
|
||||
|
||||
switch(event->type())
|
||||
{
|
||||
@ -313,6 +317,7 @@ void ScreenPanel::touchEvent(QTouchEvent* event)
|
||||
#endif
|
||||
|
||||
event->accept();
|
||||
if (!emuInstance->emuIsActive()) { touching = false; return; }
|
||||
|
||||
switch(event->type())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user