Running bemenu-run while an application is in full screen makes the keyboard unusable for applications
Here are the steps, which will explain the issue.
If you are going to reproduce this issue, first open a process manager or run bemenu-run in a terminal to kill bemenu afterwards.
-
Put an application in full screen.
-
Run
bemenu-run. -
This makes the keyboard input unusable for applications. Making it not possible to send keyboard input events to the application, for example, you won't be able to type anything if you have a text editor open
labwc keybinds seem to work, but Window Switcher won't switch to the next window instantly, you need to hold down Window Switcher for a few seconds and press a key to switch to the next window.
Pressing Esc will close the bemenu normally and the keyboard input will return (previously it didn't close. so I'm not sure about this). Also running bemenu-run with the --no-overlap option will avoid this issue.
There is also another undesirable behavior, the bemenu prompt always stays behind the application in full screen. However, this seems to be a problem with the protocols and/or bemenu itself. Here's more information: https://github.com/Cloudef/bemenu/issues/81
I've already looked a bit into bemenu and discovered some issues with its wayland backend:
- its using version 2 of the layershell protocol (but ships with a version 4 of the protocol xml)
- thus it is always using the
EXCLUSIVEkeyboard interactivity rather than the "newish"ON_DEMANDone (which would likely be preferable here) - it is using the
TOPlayer rather than theOVERLAYlayer with no user facing configuration - the wlr-layershell protocol spec is somewhat non-deterministic in the description of the layers and says that fullscreen windows are rendered
in the top layerwhich doesn't really make any sense. The "new" ext-layershell protocol that is trying to get into the wayland-protocols repo instead usesbetween the top and overlay layersand that is what labwc is doing as well
I can open up a PR to bemenu to fix these issues but maybe we should also try to be a bit more resilient and prevent giving keyboard exclusive focus to a layershell client that is currently hidden.
I am also not sure about the keybind interaction here, even an exclusive layershell client should not prevent the keybinds to function as usual.
Edit:
- https://github.com/Cloudef/bemenu/pull/376
Should be fixed in the latest bemenu master branch. However we should still try to make labwc a bit more resilient here in regards to exclusive keyboard focus from non-visible layershell clients.