Add a new parameter `--landscape-layers` as well as an environment
variable `WVKBD_LANDSCAPE_LAYERS` that allows the user to override the
default set of layers in landscape mode. This complements the existing
`-l` parameter and `WVKBD_LAYERS` environment variable, which do the
equivalent for non-landscape mode.
Furthermore, add documentation for the new switch. Move the `-l`
parameter to the bottom so we don't have to realign all parameters and
so all layer-related parameters are grouped together.
The user can optionally override the list of keyboard layers compiled
into the executable. Right now this only works for non-landscape mode
though.
Pull out the logic to parse the list of keyboard layers so that we can
reuse it to also optionally override layers in landscape mode.
To get a list of available layers for the -l option.
Signed-off-by: Emmanuel LE TRONG <emmanuel.le-trong@cnrs-orleans.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
- shift (or capslock) switch to the previous layer in the defined order
- control, alt or compose resets the view to the first layer
related fix: compose key resets on layer switch (doesn't stick now)
Previously wvkbd would commit an (usually) unchanged surface at the
framerate of the compositor, this only commits the buffer when we render
something new.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Switch to using signalfds because using the signal syscall was causing
problems without the frame callbacks (the change in the next commit), I
think this is because it would end up with multiple tasks polling the
same wayland file descriptor.
Previously this would exit after the second SIGPIPE signal. I checked
with earboxer on irc, and confirmed that handling all occurrences is the
correct behavior.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
If there are more layers in one orientation than the other this can
cause wvkbd to overshoot the end of the layer list when switching
layers. It also means that switching layers after rotating will jump to
the next layer in the list, which is somewhat unexpected.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Since layer_surface_configure was changed to only call kbd_resize when
an output dimension changed, kbd_resize doesn't get called if the
keyboard was hidden and is being shown again, meaning it doesn't tell
the compositor about the scale.
This causes it to only output the top-right quarter of the keybaord
stretched to the entire window size after a SIGUSR1 + SIGUSR2 cycle with
the display scale set to 2.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Most displays are in landscape mode by default, so checking to see if
it's rotated will produce the exact opposite of the expected results.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Previously it was only possible to either show or hide the keyboard.
When you want to control the keyboard with a single button in, i.e.
a window manager, this requires a separate script to keep track of
state. This solves this by only needing one signal to toggle.
Since there are only 2 USR signals, I had to use real-time signals,
which are in the [POSIX
standard](https://standards.ieee.org/standard/1003_1b-1993.html) and
available in the [Linux kernel since
2.2](https://www.man7.org/linux/man-pages/man7/signal.7.html).
While working on packageing wvkbd for the aur, I got a warning from
namcap (an arch package verification tool) that RELRO wasn't enabled.
From what I can tell, this is because make was ignoring the LDFLAGS set
by makepkg.