The `eek/layersurface.c` file should be excluded because it's an imported, "foreign" source, but clang-tidy doesn't seem to have an annotation for that.
An alternative would have been to exclude it in Meson and do the check there, but that requires clang-tidy, raising the barrier to contribute of Squeekboard even more (it already requires libfeedback, which isn't packaged widely).
Even though proper size management is being worked on, this patch
proposes a simple and easily revertable solution to device-dependent
sizing issues.
First, it provides different calculations based on the display
orientation. In landscape mode, this allows us to have a sensible
keyboard size while leaving enough screen estate for apps to be able to
display useful information.
Then, it gets rid of the weird calculation for display widths between
360 and 540px. While having some continuity is a pleasant idea, in the
real world in doesn't work, as shown by port attempts to other devices:
a 480x800 display (scale 1) would show an unusable 190px-high keyboard
(about half the size of the Librem 5 on-screen keyboard on a device I
own).
Finally, this commit makes sure we never use a hardcoded size.
Tested on the PinePhone, PineTab and Librem 5.
Note: Current behavior is preserved on the L5 in portrait mode, but
keyboard is a bit smaller in landscape mode; this is deliberate, as it
was previously using too much space (causing some apps, such as chatty,
to be unusable).
If the corresponding a11y settings is disbaled don't unfold
the keyboad at all.
This helps e.g. running the same session on laptops or when
an external keyboard is attached.
Closes: #222
This makes sure 'self' comes first. While at that fix the
function signatures and use ServerContextService directly
and add type checks so it's easy to notice when we messed up.
Phoc sends output information *after* changing keyboard surface size. Squeekboard adjusts size on surface events, but not on output in this revision, making it unaware of display size at the time of adjustment, resulting in bad adjustment.
This change hardcodes the proportions again to make it work at least on the Librem5.
The manager is used for sizing the layer surface. It promises never to exceed half the output height.
The selection of the current layout is not being done here, leading to worse behaviour in 1:1 scaling.
In the future, it could be used for sizing the keyboard itself and the suggestion box, as well as decide which layout to use, because layouts should have some sizing hints.
Layout management was pointlessly bound with the EekboardContextService with inheritance. Splitting it out will make it easier to further break apart layout state management, settings, and input method in the future.
instead keep it around for 200ms. This reduces flicker a lot since
the keyboard will not hide when switching through input fields in
e.g. contacts or chatty.
This allows us to remove a lot of #ifdef's. Either we want to use
a config.h or we don't. Since we'll want it for e.g. optional gsound
support later on let's have it.
- remove bounds it is not used.
- remove the g_clear_pointer, it does the same thing as the if-block
above, the were both there as the result of the merge, and it is
apparently easily overlooked
- cleanup after myself (FIXMEs)