ValveSoftware / gamescope

SteamOS session compositing window manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wlserver_open_steam_menu no longer works

antheas opened this issue · comments

Hi,
the aforementioned function (wlserver_open_steam_menu) has stopped working, and we rely on its functionality to open the steam QAM on third party distros and handhelds (esp. gestures on tablets), since steam either requires ctrl + 1/2 or a controller with xbox/xbox+a to open the menus.

gamescope/src/wlserver.cpp

Lines 392 to 405 in 09cb7b4

void wlserver_open_steam_menu( bool qam )
{
gamescope_xwayland_server_t *server = wlserver_get_xwayland_server( 0 );
if (!server)
return;
uint32_t keycode = qam ? XK_2 : XK_1;
XTestFakeKeyEvent(server->get_xdisplay(), XKeysymToKeycode( server->get_xdisplay(), XK_Control_L ), True, CurrentTime);
XTestFakeKeyEvent(server->get_xdisplay(), XKeysymToKeycode( server->get_xdisplay(), keycode ), True, CurrentTime);
XTestFakeKeyEvent(server->get_xdisplay(), XKeysymToKeycode( server->get_xdisplay(), keycode ), False, CurrentTime);
XTestFakeKeyEvent(server->get_xdisplay(), XKeysymToKeycode( server->get_xdisplay(), XK_Control_L ), False, CurrentTime);
}

After this commit, steam has stopped listening to xwayland events about button presses in general when it is in the background, which affects that function or using the xwayland 0 instance to emulate that function.
83fdf46

ctrl+1/2 only work when steam is in the foreground as you know and not in game. Therefore, wlserver_key or libei can not be used as a replacement.

Can you look into restoring this functionality?

EDIT: this function works when steam is in the foreground. It is broken when in game.