Because the directory timestamp depends on the file insise, this rule
cause a second rebuild. Let's just silently create the directory
when we require it.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
At the moment, packaging multiple layout is a bit of a mess, because
there is no easy way to build multiple layouts binary in a row. The
clean task also drop the binary outpus. And the dependency checking is
somehow incorrect. It reuses the same config.h while building the
following layout.
To solve this, we now build config.h and %.o outputs in a builddir,
one per layout.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
At the moment we just use keyboard.modifiers to maintain our clients
modifiers states. But we should also send the associated key codes.
Clients like wlvncc need them to actually send the keys to the remote
compositor.
We got no clear way to map our modifier enums to key codes. So I added
this zwp_virtual_keyboard_v1_key_mods method.
I think I tried most of the use-cases. The hardest part was arround the
Shift+Space that send Tab. We have to depress the Shift key, reset the
modifiers, send the Tab key, and finally depress back Shift and its
modifier.
I've tested a bit the Code with .code_mod (and .reset_mod), but I'm not
that sure what their behavior should be.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This applies one of the improvements in the pull request
"Fix bug complying with wlr-layer-shell-unstable-v1 which causes crashes" to the overhauled codebase.
Reference: https://github.com/jjsullivan5196/wvkbd/pull/114
Co-authored-by: Armando DiCianno <armando@dicianno.org>
Recently I've opened a ticket on the Wayland protocol to discuss
on how to determine the very first dimension a client must use, before
receiving the very first actual wl_surface events:
https://gitlab.freedesktop.org/wayland/wayland/-/issues/576
This is a issue I had on wvkbd, but also on bemenu. Here we need the
dimension to determine which layout and height to use.
This implement another approach, recommended by the Wayland folks:
The wl_output object is currently being slowly deprecated, because it is
mostly unusable for the unprivileged clients. In our context, using this
value to determine the available geometry is actually wrong. Other
layer_shell surfaces might prevent us to use the full width or height.
This explain the most recent addition of the two preferred_buffer_scale
and preferred_scale events to the protocols.
The recommended way is to first ask for a layer_shell surface anchored
to the four anchors (top, right, bottom, left). The received configure
event would then give us the whole available geometry. We now can
prepare our future keyboard, and then we make sure we receive the
expected widht and height with its configure event.
This patch drop all of our wl_output management. To receive the surface
scale value, we upgrade the used Wayland protocol version to 6, to
receive the event wl_surface.preferred_buffer_scale. This drop lot of
code.
This repurpose the function show(), hide(), flip_landscape() (renamed
to redimension_keyboard()), because their behavior was too much
intricated.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Because the deskintl layout set is for desktop, laptop, and tablet devices with
a larger touchscreen. The default font size can be larger than the mobintl
layout set's default font size.
We created the config.deskintl.h based on config.mobintl.h, which is
for mobile devices. However, the current font "Sans 14" is a bit small in my
environment, Framework Laptop 12 (a 2-in-1 laptop with a 12.2-inch touchscreen).
Signed-off-by: Jun Aruga <jun.aruga@gmail.com>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is to update the README.md for layout-specific config.h
at the commit <49975e78ee437c6fb4a5f6ea3ccf8bc90dc65536>, and
deskintl layout set the commit <90ac0454cda3e376147c49abbb6b2fa0022211f0>.
Signed-off-by: Jun Aruga <jun.aruga@gmail.com>
for the mobile layout, we want shift+space to produce tab , which needed
to be implemented in the main code. For the desktop layout, we don't want
this though, a config parameter now handles this at compile time.
Ref: https://github.com/jjsullivan5196/wvkbd/pull/103
In a multi-monitor setup, the keyboard didn't appear correctly since
commit 9cc8931b46 . This affected only
landscape mode and only on multi-monitor setups where wvkbd is launched
on anything but the first output (and perhaps even only in
multi-monitor setups where one is portrait mode and one landscape like
mine, I'm not sure).
In the mentioned commit Willow commented:
> On situation where multiple screens are present, it will eventually need
> a second loop (roundtrip)
It seems that second loop never really made it all the way to drawing.
Adding an explicit drwsurf_attach() unconditionally in
layer_surface_configure fixes this.
I'm not sure if this is the best way but this fixes this bug, and as far
as I know doesn't cause extra redraws/resizes in the normal
single-monitor scenario.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Add a layout set aimed at desktop, laptop, and tablet devices with a larger
touchscreen. The layout is the US-International English, adding a compose key.
https://en.wikipedia.org/wiki/QWERTY#US-International
This layout set was created based on the layout set by the user nine7nine
(Jordan Johnston) <https://github.com/nine7nine>.
Note I copied the keymap.mobintl.h into the keymap.deskintl.h, and modified the
keymap.deskintl.h as follows to fix "<" (comma+shift), ">" (period+shift), "?"
(slash+shift) keys.
The following commit changed the key codes in the keymap.h for mobile. I
reverted the change for the keymap.deskintl.h.
9e4cf69137
Below is the difference between the keymap.mobintl.h and keymap.deskintl.h now.
```
$ diff -u keymap.mobintl.h keymap.deskintl.h
...
@@ -1226,9 +1225,9 @@
key <AB05> { [ b, B, equal ] };\
key <AB06> { [ n, N, question ] };\
key <AB07> { [ m, M, exclam ] };\
- key <AB08> { [ comma, apostrophe, less, U00AB] };\
- key <AB09> { [ period, question, greater, U00BB] };\
- key <AB10> { [ slash, greater ] };\
+ key <AB08> { [ comma, less, backslash] };\
+ key <AB09> { [ period, greater, bar ] };\
+ key <AB10> { [ slash, question ] };\
key <I147> { [ exclamdown, questiondown, exclamdown ] };\
key <RTSH> { [ Shift_R ] };\
key <KPMU> {\
...
```
Co-authored-by: Jordan Johnston <johnstonljordan@gmail.com>
Signed-off-by: Jun Aruga <jun.aruga@gmail.com>
* Rename config.def.h to config.mobintl.h.
* config.mobintl.h:
* Rename the macro config_def_h_INCLUDED to config_h_INCLUDED.
* Remove a tailing space as a refactoring.
* Makefile: Add config.h to the clean task.
Signed-off-by: Jun Aruga <jun.aruga@gmail.com>
Hyprland recently added a layerrule to allow certain layers to appear on the lockscreen,
but layers only identify themselves by the namespace.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
We have those fields on the drwbuf struct, but we always use the
same ones. Let's deduplicate those fields by moving them on the drwsurf.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
At the moment we flip the two buffers, and we backport the damaged
area on every frame callback. We completely ignore the compositor
sent event buffer->release. This event means that the compositor
finished reading the buffer pixels, and will never read them again. So
we can keep using the same buffer instead of fliping, if we receive the
event before asking for a new frame callback.
The change is not complicated, but we have to distinguish
drwsurf_attach, and drwsurf_flip. We try to flip before trying to
draw anything. And if the buffer has already been released, we don't
flip.
We also have to track the backport_damage separately than the buffer
current damage.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Until this point we was using one single buffer. This cause tearing when
they are scanned while we are drawing.
This refactorize our buffer and damage tracking to use two buffers. One
buffer, the back_buffer, is our dirty area. The other one, the
display_buffer, is left untouched.
Now we only flip buffers on adequate moments, indicated by the
compositor sending the frame callback event. We can draw multiple
time between those events, and we store all damaged areas. We only
schedule frame callbacks when needed, after storing a new damaged area.
Once flipped, we backport the damaged area from the new display_buffer
to the new back_buffer. Which generally means, for wvkbd, one rectangle
for each one of the surf and popup_surf.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
wvkbd adapt its height, and layout depending on if the screen
is in landscape mode or not.
The only realiable way to know which outputs our surface is
rendered on is the wl_surface->enter(wl_output) event. But we receive
this event very late in the flow. After the first frame rendering, and
commit to the surface.
There already is some code to guess the best initial tentative, on the
most simple situations, to try to avoid an immediate re-creation of the
Wayland objects, buffer, and re-rendering of the layout.
But two issues was present:
First, we need a second roundtrip of the events, after the global
handle. This make the compositor to send the wl_outputs events earlier,
giving their geometry before our first show().
Then, the code that loop on them, if we don't already know the
current_output, was wrong. Because we changed the default state to
landscaped a while ago.
We also change how this code behave, we use the very first wl_output we
know about. Every behaviors are somehow wrong at this point, this one is
the simplest.
Now when starting wvkbd with only one screen, we don't need a second
loop anymore.
On situation where multiple screens are present, it will eventually need
a second one.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Cairo is properly restored when not rounding, but in the codepath for
rounding it is not. Call cairo_restore() in both cases, otherwise
artefacts appear when using transparent fonts.
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>