If the surface the pointer started to interact with is destroyed we also
want the seatop_down to end. In case a drag is initiated we receive a
call to handle_end.
This solves an issue where layer-shell items would not receive a button
release event when the pointer left them while being pressed. The
default seatop changes focus immediately while seatop_down defers any
focus changes until the pointer is released or seatop_down is destroyed.
The title itself and marks were being rendered by two very-similar yet
different functions, and any changes made to one had to be reflected on
the other.
This mostly prevents such oversights from happening, and keeps makes
sure we keep both consistent.
Use fixed titlebar heights. The default height is calculated based on
font metrics for the configured font and current locale.
Some testing with titles with emoji and CJK characters (which are
substantially higher in my setup) shows that the titlebars retain their
initial value, text does shift up or down, and all titlebars always
remain aligned.
Also drop some also now-unecessary title_height calculations.
Makes also needed to be updated, since they should be positioned with
the same rules.
Sometimes the preferred mode is not available due to hardware
constraints (e.g. GPU or cable bandwidth limitations). In these
cases it's better to fallback to lower modes than to end up with
a black screen.
When a layer surface shrinks we need to damage the area it previously
occupied, but we don't know the location of all its subsurfaces in the
previous state, so instead damage a rectangle that encloses the entire
previous extent.
The xdg-decoration protocol allows clients to request whether they want
to use server side decorations or client side decorations. Currently,
sway ignores this and always enforces whatever the server is currently
set to. Although tiled clients cannot be allowed to set borders, there
is no harm in listening requests from floating clients. Sidenote: also
fix an unrelated style error.
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state
getting out of sync during pointer motion in seatop_down.
Since the difference was always under 1 px, it was practically
impossible to notice in normal use.
But because of being out of sync, cursor_rebase would always end up
incorrectly calling wlr_seat_pointer_notify_motion from
seatop_default_begin (on releasing mouse button) which broke cursor
locking.
See #5405Closes#4632
When emulating touch, the simulating_pointer_from_touch field is
set to true. It's switched back to false when a touch_up event is
received. However we need to ensure we always send a wl_pointer.frame
event following a group of other wl_pointer events.
Since a touch_frame event is always guaranteed to come after a group
of touch events, unset simulating_pointer_from_touch in the touch_frame
handler instead of the touch_up handler. Add a new field to know whether
the touch_frame handler should stop emulation.
If HOME environment variable is not set, sway fails startup with a
segmentation fault due to null pointer dereference.
Also check calloc return value and only perform the fallback code when
really needed.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Add a subcommand for `gaps` that allows to toggle gaps at
runtime. This functionality is part of i3-gaps since [1]
but is missing in sway.
[1] https://github.com/Airblader/i3/pull/264
When setting the geometry from content for floating windows, the
coordinates for borders are normally taken into account. However in the
case of a floating fullscreen window, we should not be doing this. Since
the content of the container takes the space of the entire output, this
causes the calculated borders to neccesarily be outside of the output.
This later causes a problem when sending surface entrance events since
in a multi-monitor setup, the border coordinates will overlap with
another output despite the surface not actually being on that output at
all. The fix is to just ignore border coordinates for a floating
fullscreen container since fullscreen, of course, does not actually have
any borders. Fixes#6080.
New warnings can be hard to notice in CI, since CI will just pass in
that case. Meson sometimes uses warnings for important mistakes, e.g.
invalid option.
Let's turn warnings into errors so that we can spot these more easily.
get_current_time_msec is only used in cursor.c, so we can move it in and
make it static. This is primarily intended to avoid a symbol collision
with wlroots, which we unfortunately do not have a good solution for
yet.
This fixes the following scenario:
- Place a floating window so its border is right at the edge of the
screen
- Create a new split
- The border disappears
- Moving the window does not restore the border