The keyboard can be used to select items though.
Menu items can be pseudo "clicked" by hovering the mouse over item and pressing enter. Main menu item seems to be clickable, but not its subsequent menu entries.
Just a tid-bit for others as a workaround
This was annoying me a bit so I traced it out and it arises when the xwayland integration in wlroots resets the input focus after an X client tries to change it: https://github.com/swaywm/wlroots/blob/51bfdd620e70c41e1a9fb4ce7831eddfb1bf893b/xwayland/xwm.c#L1192
Steam's menu system seems to have some really odd focus behavior and when the compositor resets the input focus the menu disappears before handling the selection. Honestly not sure what the correct fix is.
Thanks for investigating. So removing this fixes the issue? What is the value of ev->mode? Does it work in Weston? (not sure Weston has the same behaviour)
Yeah, removing it fixes the issue. ev->mode is XCB_NOTIFY_MODE_NORMAL.
As for what happens in Weston, I get very odd behavior. The pointer tracking doesn't seem to work correctly -- the hover menus appear and disappear when the pointer is at the wrong location (there is an offset), and the items also don't work when selected. gnome-shell --wayland --nested works as expected, though.
Is there any particular problems with removing these lines for now, or is this something that Valve should fix upstream?
It should be fixed in xwm. I see the code stems from weston b18f788e2e747 but it isn't clear from the commit message what case(s) this fixes exactly. I can verify that removing the code fixes the issue with steam.
This commit isn't supposed to fix anything. It just makes the xwm more strict and prevents clients from setting an arbitrary focus.
So… this is a bug on Sway's end? Or on Valve's end? Or both?
Basically I'm wondering what exactly needs to be done to fix this issue. I'd be willing to help out once I know what needs to be done to fix this.
Sway's xwm is strict. Steam is a client that expects to be able to set focus in an arbitrary fashion.
I'd say it's a Valve bug, so I'd report it to them. Since it's closed software I'm not sure this has a chance to get fixed.
Ah, makes sense. This should probably be closed then, considering how there's not really anything that can be done.
Sway's xwm is strict.
Don't you mean wlroots?
Indeed, Sway's xwm is backed by wlroots.
I'm saying if this is ignored, all wlroots compositors will continue to be broken in the same way, right? What might be the consequences of leaving this code out?
X11 clients would be able to steal focus.
(Leaving this open because I'm not yet sure it's worth it to keep this code -- X11 clients are able to sidestep each other in many ways, why bother?)
For what it's worth, I opened up an issue for Steam. It appears that it's had focus problems since the very beginning on X-based window managers, so it does seem like this would be a Steam bug.
I haven't run into this kind of issue on any other program, so, I'm not 100% sure if there's anything that actually would need this. Allowing any client to arbitrarily steal focus seems pretty bad.
@clarfon do you have a link to the issue at steam I could subscribe to?

as a side remark, context menus work on the steam beta leak, as a workaround its avaliable on https://www.reddit.com/r/Steam/comments/bykilq/steam_library_update_work_in_progress_via_steamdb/
as a side remark, context menus work on the steam beta leak, as a workaround its avaliable on https://www.reddit.com/r/Steam/comments/bykilq/steam_library_update_work_in_progress_via_steamdb/
For me it's not working fully even in the beta, maybe this is because I use mixed dpi but I don't know...
It's worth mentioning that some of these menus _still work_ when you open them while keeping LMB pressed and release it on the item you want. This unfortunately doesn't work for all of them, e.g. the username one to access your wallet is broken regardless of whether you try to use den731's workaround or mine.
I also get broken submenus in the steam friends interface unless I set the relevant window to floating.
Most helpful comment
For what it's worth, I opened up an issue for Steam. It appears that it's had focus problems since the very beginning on X-based window managers, so it does seem like this would be a Steam bug.
I haven't run into this kind of issue on any other program, so, I'm not 100% sure if there's anything that actually would need this. Allowing any client to arbitrarily steal focus seems pretty bad.