all repos — mgba @ b3cf9ec162885dbdcf5aa6e4e5abbcd112d9ed5b

mGBA Game Boy Advance Emulator

Qt: Only hide cursor if the display is the top widget
Jeffrey Pfau jeffrey@endrift.com
Mon, 13 Jul 2015 22:09:20 -0700
commit

b3cf9ec162885dbdcf5aa6e4e5abbcd112d9ed5b

parent

f50f98416bc9e5455b71732a6727eda9bf8d6064

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -129,7 +129,9 @@ connect(this, SIGNAL(audioBufferSamplesChanged(int)), m_controller, SLOT(setAudioBufferSamples(int)));

connect(this, SIGNAL(fpsTargetChanged(float)), m_controller, SLOT(setFPSTarget(float))); connect(&m_fpsTimer, SIGNAL(timeout()), this, SLOT(showFPS())); connect(m_display, &Display::hideCursor, [this]() { - setCursor(Qt::BlankCursor); + if (static_cast<QStackedLayout*>(m_screenWidget->layout())->currentWidget() == m_display) { + setCursor(Qt::BlankCursor); + } }); connect(m_display, &Display::showCursor, [this]() { unsetCursor();

@@ -1122,6 +1124,7 @@ }

void Window::attachWidget(QWidget* widget) { m_screenWidget->layout()->addWidget(widget); + unsetCursor(); static_cast<QStackedLayout*>(m_screenWidget->layout())->setCurrentWidget(widget); }