Until now, Seat.setFocusRaw sent all pressed keys to the client,
including ones that should be eaten. (Try e.g. changing focus to a
nested wlroots compositor with a terminal open to easily see it.)
However, only filtering out the eaten keys is not enough; they were
eaten only once all mappings had been executed. Therefore, the original
function had to be split into one looking up mappings and another
executing them.
Until now, only the event (press/release) for which a mapping was
present got eaten, and the other was passed to the client. From this
commit, a press mapping eats both events and a release mapping eats
nothing (and a press+release combo eats both).
This fixes behavior of some clients that do not make a difference
between press and release (e.g. Firefox with a fullscreen video
exiting fullscreen even on an Esc release event).
Adding the set_override_redirect listener on creation and removing it
on destruction was missed when implementing override redirect state
change handling.
When checking keys for matching mappings, previously we did two checks:
1. Keysyms translated by xkb.
2. Raw keysyms
This commit removes the first check, so only the second is checked.
We're doing this because of strange behavior that xkb shows for some
layouts and keys. When pressing `Shift Space` on some layouts (Swedish
among others), xkb reports `Shift` as consumed. This leads to the case
that we cannot distinguish between `Space` and `Shift Space` presses
when doing a correct translation with xkb.
e.g. `riverctl map -layout 0 normal Super Y spawn foot`
When this mapping is checked against a pressed key, layout 0 will be used to translate the pressed key instead of the currently active layout.
The number denotes to an index of the layouts set with
`XKB_DEFAULT_LAYOUT`.
Currently when the surface under the hidden cursor changes, we
passthrough() which results in the cursor being made visible and giving
pointer focus to the surface under the cursor if any. Obviously this is
not desirable as the cursor is supposed to remain hidden until moved.
This added check prevents this.
From the riverctl.1 man page:
*hide-cursor* *timeout* _timeout_
Hide the cursor if it wasn't moved in the last _timeout_
milliseconds until it is moved again.
The default value is 0, which disables automatically hiding the
cursor. Show the cursor again on any movement.
*hide-cursor* *when-typing* *enabled*|*disabled*
Hide the cursor when pressing any non-modifier key. Show the cursor
again on any movement.
Remove `.git` suffix from river repo in `sources` section as the
suffix make the ci only clone the repo. Without the suffix the ci
checkout the correct commit to build river.
We don't need to remove the suffix from others sources as cloning
the repo and checkout the tag version we want is enough.
The motivation for this change is to simplify the implementation
and remove a massive footgun that is currently present and causing
UB/crashes. If a layer surface is destroyed in arrangeLayers() then
the code in LayerSurface.handleCommit() after the arrangeLayers()
call accesses free'd memory. This is of course possible to fix,
but it's far simpler to loosen up the protocol implementation a bit.
The new implementation is also in line with what sway and the new
wlroots layer shell helper do and is perfectly valid according to
the protocol.
I have encountered a crash (failing assert) if a view specified a fixed
size less than this minimum, and according to ifreund this behavior was
planned to be removed, anyway.