all repos — mgba @ d4721cb30d3087ccf68ee61e66e33d77e2ebdd14

mGBA Game Boy Advance Emulator

Qt: Force redraw when window gets focus
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Aug 2015 19:59:59 -0700
commit

d4721cb30d3087ccf68ee61e66e33d77e2ebdd14

parent

071fe7ff2dc0a7cc396408f6558b4ad2d430a909

2 files changed, 5 insertions(+), 0 deletions(-)

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

@@ -441,6 +441,10 @@ saveConfig();

QMainWindow::closeEvent(event); } +void Window::focusInEvent(QFocusEvent*) { + m_display->forceDraw(); +} + void Window::focusOutEvent(QFocusEvent*) { m_controller->setTurbo(false, false); m_controller->stopRewinding();
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -105,6 +105,7 @@ virtual void keyPressEvent(QKeyEvent* event) override;

virtual void keyReleaseEvent(QKeyEvent* event) override; virtual void resizeEvent(QResizeEvent*) override; virtual void closeEvent(QCloseEvent*) override; + virtual void focusInEvent(QFocusEvent*) override; virtual void focusOutEvent(QFocusEvent*) override; virtual void dragEnterEvent(QDragEnterEvent*) override; virtual void dropEvent(QDropEvent*) override;