ActivateWindow to gain input focus

This commit is contained in:
Milan Nikolic 2024-10-16 14:47:44 +02:00
parent 76ebf56666
commit c96d16b6d6
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
2 changed files with 3 additions and 1 deletions

View file

@ -268,6 +268,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.stack.setCurrentIndex(1)
elif mode == M64P_RENDER_VULKAN:
self.stack.setCurrentIndex(2)
self.stack.currentWidget().activateWindow()
def on_vidext_set_mode(self, context):
context.doneCurrent()
@ -289,6 +290,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if state == Qt.ApplicationState.ApplicationInactive:
self.worker.core.pause()
elif state == Qt.ApplicationState.ApplicationActive:
self.stack.currentWidget().activateWindow()
self.worker.core.resume()
def on_toggle_fs(self):

View file

@ -249,7 +249,7 @@ class Settings(QDialog, Ui_Settings):
bool(self.get_int_safe("enable_vidext", 1)))
self.checkDisableScreenSaver.setChecked(bool(self.get_int_safe("disable_screensaver", 1)))
self.checkPauseOnFocusLoss.setChecked(bool(self.get_int_safe("pause_on_focus_loss", 1)))
self.checkPauseOnFocusLoss.setChecked(bool(self.get_int_safe("pause_on_focus_loss", 0)))
def set_core(self):
self.core.config.open_section("Core")