246 Commits

Author SHA1 Message Date
Jun Aruga
74667dc2e8 Adjust the deskintl layout set's default font size.
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>
2025-08-10 14:17:39 +02:00
Jun Aruga
cf60305a61 Update README for layout-specific config.h and deskintl layout set
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>
2025-08-10 00:31:03 +02:00
Maarten van Gompel
915a881111 README: fixed typo in git send-email instructions 2025-08-10 00:29:06 +02:00
Maarten van Gompel
5318ee9256 updated man page
mentioned desktop layout and documented --non-exclusive parameter
2025-08-09 21:56:48 +02:00
Maarten van Gompel
3a44beac1f Added --non-exclusive parameter to skip requesting exclusive zone from compositor
This allows wvkbd to show on top of existing windows, not pushing them
out of the way.

Ref: https://github.com/jjsullivan5196/wvkbd/issues/102
Ref: https://github.com/jjsullivan5196/wvkbd/issues/93
2025-08-09 21:44:01 +02:00
Maarten van Gompel
b3a7e95c69 added SHIFT_SPACE_IS_TAB as compile time parameter
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
2025-08-09 21:19:08 +02:00
Maarten van Gompel
5689b6bd33 Fix landscape appearance bug in multi-monitor setup
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>
2025-08-09 20:54:28 +02:00
Jun Aruga
90ac0454cd Add deskintl (desktop international) layout set.
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>
2025-08-09 20:52:27 +02:00
Jun Aruga
49975e78ee Support a layout-specific config.h.
* 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>
2025-08-09 20:52:27 +02:00
Zach DeCook
b0fd6777fc namespace: change to wvkbd
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>
v0.17
2025-04-26 23:43:55 +02:00
Willow Barraco
3142271882 Do not expose drwsurf_flip 2025-04-18 07:51:19 +02:00
Willow Barraco
ace77b2aaa Tie the damage tracking to the drawing methods
So that keyboard.c just need to draw things, and stop worring about
damaging.
2025-04-18 07:51:19 +02:00
Willow Barraco
47d27e48d5 gitignore man page 2025-04-18 07:41:27 +02:00
Maarten van Gompel
3826cd6050 version bump 2025-04-17 22:02:29 +02:00
Willow Barraco
73caeee513 Deduplicate some drwbuf fields
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>
2025-04-17 19:48:53 +02:00
Willow Barraco
55b88bc14f Optimize the backporting condition
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>
2025-04-17 19:48:50 +02:00
Willow Barraco
686b27a72d Implement double buffering
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>
2025-04-17 19:48:43 +02:00
Maarten van Gompel
646d47d072 fixup: spacing 2025-04-15 23:44:51 +02:00
Viacheslav Gagara
e0ecf38853 add missing cyrillic letter from ukrainian alphabet
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2025-04-15 23:44:28 +02:00
Maarten van Gompel
ca53099c9d version bump after release 2024-11-25 13:40:36 +01:00
Maarten van Gompel
29639c28d5 Makefile: minor update to make clean v0.16 2024-11-25 13:18:53 +01:00
Maarten van Gompel
745a0b6f53 documentation: added section on compose button to man page 2024-11-25 13:11:50 +01:00
Maarten van Gompel
c742b58f51 documentation: updated man page
Using scdoc to make editing a bit more comfortable.
2024-11-25 13:01:20 +01:00
Maarten van Gompel
97efb1de74 README: fixed image links 2024-11-25 12:35:59 +01:00
Maarten van Gompel
125664afd5 use OVERLAY so keyboard is visible over fullscreen windows as well
Ref: https://github.com/jjsullivan5196/wvkbd/issues/73
2024-11-25 12:31:19 +01:00
Maarten van Gompel
6041473421 Only draw caps-lock upper-case labels for alphabetical keys
Fixes an issue introduced in 9d130e7fd2
2024-11-25 12:19:11 +01:00
Willow Barraco
9cc8931b46 Fix the initial output geometry guessing
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>
2024-11-05 10:14:12 +01:00
Willow Barraco
7d195c8217 Skip the first resize when landscaped while starting
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2024-11-02 21:27:31 +01:00
Frank Oltmanns
d5db545dcc Restore cairo also when using rounding
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>
2024-10-26 20:49:11 +02:00
Jami Kettunen
7d677d23b7 Makefile: accomodate cross-build pkg-config 2024-10-02 23:26:24 +02:00
Maarten van Gompel
fe3257450a version bump 2024-09-01 18:23:07 +02:00
Paul Rimmer
1852b3ab06 Don't forget the obscure AltGr modifier key 2024-09-01 18:21:53 +02:00
Paul Rimmer
9d130e7fd2 Make all modifiers except capslock one shot and redraw keyboard when capslock pressed 2024-09-01 18:21:53 +02:00
Maarten van Gompel
2f72b176cb version bump v0.15 2024-05-04 19:42:12 +02:00
Maarten van Gompel
ba778478e6 added -R parameter to configure rounding 2024-04-15 20:38:02 +02:00
Amir Dahan
d423720553 Add basic rounding
There's probably a better way of doing this, But this will do for now.

Added basic rounding to buttons.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2024-04-14 18:18:34 +02:00
rdbo
e3081fb6e9 fixed malfunctioning theme at random 2024-04-12 22:07:35 +02:00
mojyack
8106d7606d Check if popup surf configured on callbacks
In some situations, wl_touch_* events come between layer_surface_configure and xdg_popup_surface_configure.
It causes the keyboard to be drawn before the popup surf is configured, leading to "error 3: xdg_surface has never been configured".
This commit fixes this.
2024-03-29 23:16:53 +01:00
Willow Barraco
bb237f5afa Re-open the keyboard on the same output it was
Even if the user is focusing another output while the geometry change.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
v0.14.4
2024-03-03 11:33:58 +01:00
Willow Barraco
b083169ee4 Minimise visual glitches when starting
Most of the time, the first frame have to be rendered without knowing
which output is the current one. It means the first window could have
incorrect dimensions. This cause other program surface to shrink,
then grow back.

Let's try a smoother approach:

If we don't know the current output, we could check if one of them is
landscaped. If this is the case, we start landscaped to minimise the
visual glitch.

Also, the compositor might choose to not send any output geometry
information before the first surface role is assigned (sway master
829c75b9). Meaning after our initial set_size request. So we have to start
landscaped, and eventually flip to horizontal.

Thanks to the patch "Skip the first resize when landscaped while
starting", we do not draw multiple time on the buffer when we switch to vertical
mode.

This should cover most of the cases, and produce a more discrete
start.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2024-03-01 22:54:34 +01:00
Willow Barraco
538b48d08d fix fractional scalled buffer missing one pixel
Before 1920*1080 scaled 1.40 was giving a buffer width of 1919 pixels.

The buffer dimensions have to be ceiled here, instead of rounded.

The rest of the dimensions have to stay the same, here 1371x120.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2024-01-30 18:44:05 +01:00
Zach DeCook
de3b9a77e4 event loop: exit if the wayland socket disappears
(prevents infinite loop when your compositor crashes)

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2024-01-30 18:42:17 +01:00
Maarten van Gompel
77c6cf4fe6 implemented a stub wl_surface_leave
This fixes "listener function for opcode 1 of wl_surface is NULL" error in wayfire 0.8.0

Ref: https://github.com/jjsullivan5196/wvkbd/issues/52
2023-11-10 20:27:40 +01:00
Maarten van Gompel
927918ccc5 version bump v0.14.3 2023-11-04 14:33:44 +01:00
Maarten van Gompel
9f8e73b315 fixup: re-add flip_landscape() to wl_surface_enter (needed for landscape detection) 2023-11-04 14:33:30 +01:00
mojyack
0e17680041 do not refresh on wl_surface_enter
there is no need to do so, because this event is followed by layer_surface_configure.
sway-HEAD(020a572) complains "A configure is scheduled for an uninitialized xdg_surface",
but it works anyway.

fix #50
2023-11-04 14:32:04 +01:00
Maarten van Gompel
3cccdab2e8 version bump v0.14.2 2023-11-03 20:53:14 +01:00
mojyack
2d01b8963b fix hyprland crashes when creating a surface multiple times 2023-11-03 20:47:29 +01:00
mojyack
c457d697aa optimize output iteration 2023-11-03 20:47:29 +01:00
mojyack
5471e2ea0e resize keyboard only when entered to different output
the keyboard layout is saved even when hide/show (if output is same).
this is old behavior.
2023-11-03 20:47:29 +01:00