From 0cda47fdfd64b97db9fa2f8585be9dafe595faf8 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Mon, 14 Jul 2025 19:58:05 +0500 Subject: [PATCH] fix(input_manager): disable fullscreen toggle from keyboard/gamepad in gamescope session Signed-off-by: Boris Yumankulov --- portprotonqt/input_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/portprotonqt/input_manager.py b/portprotonqt/input_manager.py index 0f64552..f3040df 100644 --- a/portprotonqt/input_manager.py +++ b/portprotonqt/input_manager.py @@ -111,6 +111,8 @@ class InputManager(QObject): self.stick_value = 0 # Текущее значение стика (для плавности) self.dead_zone = 8000 # Мертвая зона стика + self._is_gamescope_session = 'gamescope' in os.environ.get('DESKTOP_SESSION', '').lower() + # Add variables for continuous D-pad movement self.dpad_timer = QTimer(self) self.dpad_timer.timeout.connect(self.handle_dpad_repeat) @@ -849,7 +851,7 @@ class InputManager(QObject): return True # Toggle fullscreen with F11 - if key == Qt.Key.Key_F11: + if key == Qt.Key.Key_F11 and not self._is_gamescope_session: self.toggle_fullscreen.emit(not self._is_fullscreen) return True @@ -946,7 +948,7 @@ class InputManager(QObject): continue now = time.time() if event.type == ecodes.EV_KEY and event.value == 1: - if event.code in BUTTONS['menu']: + if event.code in BUTTONS['menu'] and not self._is_gamescope_session: self.toggle_fullscreen.emit(not self._is_fullscreen) else: self.button_pressed.emit(event.code)