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
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>
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.
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.
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>
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>
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>
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.
This is a bit hacky. The main problem is that there is no way to tell
cairo to limit the width. It will wrap text accordingly to width and
height, it will add ellipsizes if it overlow the box, but if a word
width is larger than the box width, it will write it.
To avoid that, I make sure we don't go too much to the left, and I
redraw the background at the right of the keys. This is not visible
cause we damage track correctly the updated buffer coordinates.
I also moved the damage tracking from do_rectangle and draw_text to
higher draw_key and draw_layout.
The virtual keyboard can't cover other surface. Only the wallpaper could
eventually go through it, or conky. Let's make a fancy default now that
--alpha exists for users that want the old transparency.