-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deck): Use super + 1/2 for Overlay/QAM (#1724)
* fix(deck): Use super 1/2 for overlay/qam * fix(deck): fix filename in spec files * fix(deck): fix filename in spec files * fix(deck): keep ctrl modifier as an option, default on
- Loading branch information
Showing
5 changed files
with
49 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
spec_files/gamescope/v2-0001-always-send-ctrl-1-2-to-steam-s-wayland-session.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/src/wlserver.cpp b/src/wlserver.cpp | ||
index 3535c9b..d29a3d5 100644 | ||
--- a/src/wlserver.cpp | ||
+++ b/src/wlserver.cpp | ||
@@ -290,6 +290,9 @@ static void wlserver_handle_modifiers(struct wl_listener *listener, void *data) | ||
bump_input_counter(); | ||
} | ||
|
||
+// false if GS_ENABLE_CTRL_12 exists and is 0, true otherwise | ||
+bool env_gs_enable_ctrl_12 = getenv("GS_ENABLE_CTRL_12") ? (getenv("GS_ENABLE_CTRL_12")[0] != '0') : true; | ||
+ | ||
static void wlserver_handle_key(struct wl_listener *listener, void *data) | ||
{ | ||
struct wlserver_keyboard *keyboard = wl_container_of( listener, keyboard, key ); | ||
@@ -310,7 +313,14 @@ static void wlserver_handle_key(struct wl_listener *listener, void *data) | ||
keysym == XKB_KEY_XF86AudioLowerVolume || | ||
keysym == XKB_KEY_XF86AudioRaiseVolume || | ||
keysym == XKB_KEY_XF86PowerOff; | ||
- if ( ( event->state == WL_KEYBOARD_KEY_STATE_PRESSED || event->state == WL_KEYBOARD_KEY_STATE_RELEASED ) && forbidden_key ) | ||
+ | ||
+ // Check for steam overlay key (ctrl/super + 1/2) | ||
+ bool is_steamshortcut = | ||
+ ((env_gs_enable_ctrl_12 && (keyboard->wlr->modifiers.depressed & WLR_MODIFIER_CTRL)) || | ||
+ (keyboard->wlr->modifiers.depressed & WLR_MODIFIER_LOGO)) && | ||
+ (keysym == XKB_KEY_1 || keysym == XKB_KEY_2); | ||
+ | ||
+ if ( ( event->state == WL_KEYBOARD_KEY_STATE_PRESSED || event->state == WL_KEYBOARD_KEY_STATE_RELEASED ) && (forbidden_key || is_steamshortcut) ) | ||
{ | ||
// Always send volume+/- to root server only, to avoid it reaching the game. | ||
struct wlr_surface *old_kb_surf = wlserver.kb_focus_surface; | ||
@@ -319,6 +329,13 @@ static void wlserver_handle_key(struct wl_listener *listener, void *data) | ||
{ | ||
wlserver_keyboardfocus( new_kb_surf, false ); | ||
wlr_seat_set_keyboard( wlserver.wlr.seat, keyboard->wlr ); | ||
+ if (is_steamshortcut) | ||
+ { | ||
+ // send ctrl down modifier to trigger the overlay | ||
+ wlr_keyboard_modifiers ctrl_down_modifier; | ||
+ ctrl_down_modifier.depressed = WLR_MODIFIER_CTRL; | ||
+ wlr_seat_keyboard_notify_modifiers(wlserver.wlr.seat, &ctrl_down_modifier); | ||
+ } | ||
wlr_seat_keyboard_notify_key( wlserver.wlr.seat, event->time_msec, event->keycode, event->state ); | ||
wlserver_keyboardfocus( old_kb_surf, false ); | ||
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters