Commit Graph

216 Commits

Author SHA1 Message Date
fe3257450a version bump 2024-09-01 18:23:07 +02:00
1852b3ab06 Don't forget the obscure AltGr modifier key 2024-09-01 18:21:53 +02:00
9d130e7fd2 Make all modifiers except capslock one shot and redraw keyboard when capslock pressed 2024-09-01 18:21:53 +02:00
2f72b176cb version bump v0.15 2024-05-04 19:42:12 +02:00
ba778478e6 added -R parameter to configure rounding 2024-04-15 20:38:02 +02:00
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
e3081fb6e9 fixed malfunctioning theme at random 2024-04-12 22:07:35 +02:00
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
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
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
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
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
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
927918ccc5 version bump v0.14.3 2023-11-04 14:33:44 +01:00
9f8e73b315 fixup: re-add flip_landscape() to wl_surface_enter (needed for landscape detection) 2023-11-04 14:33:30 +01:00
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
3cccdab2e8 version bump v0.14.2 2023-11-03 20:53:14 +01:00
2d01b8963b fix hyprland crashes when creating a surface multiple times 2023-11-03 20:47:29 +01:00
c457d697aa optimize output iteration 2023-11-03 20:47:29 +01:00
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
a126945401 handle screen resize and redraw in layer_surface_configure 2023-11-03 20:47:29 +01:00
aa9e8ab7ab avoid using "wl_output" literal 2023-10-29 16:42:19 +01:00
d6439afcb9 Make font selection scheme specific
Add the members font and font_descriptor to struct clr_scheme, so that
it is possible to specify a font for each scheme.

During initialization create the font descriptors for each scheme.

Instead of initially setting the font descriptor when setting up the
buffer, set the font descriptor when drawing the text.

Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-10-29 13:07:57 +01:00
6e52be343d Add support for multiple schemes
Allow to use more than two color schemes.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-10-13 21:20:18 +02:00
aaff22a105 set preferred scale default to 1
Ref: https://github.com/jjsullivan5196/wvkbd/issues/43
v0.14.1
2023-09-22 18:42:27 +02:00
ab56a2748b Add missing include 2023-09-18 17:14:04 +02:00
7ff5605303 version bump 2023-09-18 17:07:38 +02:00
02027621af Cleanups
This cleanup a bit how we store and use the preferred_scale and
preferred_fractional_scale.

This rename some methods to make their behavior more explicit.
2023-09-18 12:13:43 +02:00
63c209ec7f Regression fix: keyboard didn't re-show on SIGUSR2 anymore
When triggering show() on kill USR2, everything works as expected, but
the keyboard attributes are the same as before. So in
layer_surface_configure, we don't match the condition.

Checking hidden, and resetting it from inside this scope is enough to
solve the problem.
2023-09-18 12:13:34 +02:00
eefd08f431 version bump v0.14 2023-09-16 12:36:04 +02:00
76b64f6a85 Fix builds 2023-09-08 23:26:42 +02:00
a152fd036f Break on function definitions 2023-09-08 23:14:40 +02:00
1a36f6d5f2 Add an editor config 2023-09-08 23:14:40 +02:00
fbbf563d70 Simplest clang-format 2023-09-08 22:57:14 +02:00
2747980a4e clang-format 2023-09-08 22:42:49 +02:00
34d6ce5566 Cleanup output management
The goal is to minimize startup redraws.

It looks like the surface must enter the output for us to finaly know
which one it is. We need this to use the correct scale value. It make
the surface to be blurry at first, but I can not find a better way.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-08 21:17:36 +02:00
7af5410235 Disable cairo antialiasing
This is unoticeable without fractional scaling, but becore a real
problem with it. It add transparency arround rectangles, and so cause
drawing problems.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-08 21:17:34 +02:00
730e97038c Support fractional-scale-v1
This make text less blurry. It continues to works without.

before:
https://dav.missbanal.net/00bd0fd5-e22f-4a60-87f8-ce6f400d33c9.png

after:
https://dav.missbanal.net/a3f02f1e-d6ce-4378-a141-e2093ba87eed.png
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-08 21:17:31 +02:00
50296daa46 fix missing initializations in previous commit
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-06 23:19:31 +02:00
21045044ba fix seat_handle_capabilities
seat_handle_capabilities may be called more than once with different caps.
In the current implementation, wl_{pointer,touch}_add_listener can be
called multiple times for the same seat, causing the buttons to be pressed
more than once in a single tap.
This commit implements seat_handle_capabilities correctly and
avoids setting duplicate handlers, and also handles the removal of capabilities.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-06 23:19:31 +02:00
9e03e120c3 switch layers: fix crash
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2023-09-06 23:14:30 +02:00
24e354ce9e Add popup to display pressed keys 2023-09-06 15:29:07 +02:00
b1890848d5 Remove surface commits where it is unecessary and wrong 2023-09-06 14:25:40 +02:00
8bdc761d9b Bump protocols 2023-09-06 11:35:34 +02:00
fa659b4584 Remove black boxes
This isn't a good way to solve this, and cause restrictions and
breakages.

We should find a better way to enforce text inside of keys, probably
using a second buffer to write into.
2023-09-01 08:11:31 +02:00
3752d0e392 Fix remaining too long text cases 2023-08-31 22:25:11 +02:00
4444c6e664 Prevent writing outside of key without ellipsize 2023-08-31 22:03:51 +02:00
8f7142b171 Remove ellipsize now that we crop text outside of keys 2023-08-31 21:27:02 +02:00
975bd2ec32 Fix Ctrl feedback while being clicked 2023-08-31 18:41:41 +02:00
47a45d557b Fix black box on Shift press
Drawing key will redraw the bg at the right side. As we already
propagated the surface damage, this cause a rewrite of the right side of
the layout.
2023-08-31 18:37:58 +02:00