Commit Graph

7115 Commits

Author SHA1 Message Date
Simon Ser bd58df61ef pango: add printf attribute
This allows the compiler to catch mismatches between the format
string and the arguments passed in.

Need to add -Wno-format-zero-length because we pass an empty string
on purpose in swaybar/render.c.
2023-04-14 18:34:54 +02:00
Simon Ser aab4c9da5f Add format_str() and vformat_str()
Simple helpers to allocate and format a string.
2023-04-14 18:34:54 +02:00
Simon Ser 4118c49349 Use output_match_name_or_id() in workspace functions 2023-04-14 18:34:54 +02:00
Simon Ser fcec581748 Use output_match_name_or_id() in apply_output_config_to_outputs() 2023-04-14 18:34:54 +02:00
Simon Ser 04904ab9a5 Use all_output_by_name_or_id() in merge_id_on_name()
No need to iterate over the outputs manually.
2023-04-14 18:34:54 +02:00
Simon Ser 8d95638df6 Introduce output_match_name_or_id()
Reduces code duplication.
2023-04-14 18:34:54 +02:00
Elyes Haouas 63f9bdf001 Fix old style function definitions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-04-14 18:21:43 +02:00
Simon Ser ab4f460597 Set output damage during direct scan-out
During direct scan-out, pass the damaged region to the wlroots
backend.
2023-04-14 17:43:37 +02:00
Simon Ser 777df22377 Skip direct scan-out commit when damage is empty
When there is no damage, no need to perform an output commit, even
when direct scan-out is used.
2023-04-14 17:43:37 +02:00
Simon Ser 5e847fe3c8 Pass version to wlr_compositor_create()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3696
2023-04-14 17:26:03 +02:00
Alexander Orzechowski dadf3e9b78
Chase wlroots!4067 2023-04-06 22:03:52 +02:00
Simon Ser e8fb7f53b8 Remove duplicate wlr_damage_ring_set_bounds() call
We already do this in handle_commit().
2023-04-06 16:35:21 +02:00
Erik Reider fa7b686e61
Fix damage-ring bounds not being set when unplugging -> plugging in monitor
#7524 was a partial fix. Seems like this is still an issue when
unplugging and plugging the monitor back in.

Closes: https://github.com/swaywm/sway/issues/7528
2023-04-06 10:40:49 +02:00
Alexander Orzechowski 9cf66e8c7c swaybar: Lift background clearing out of main rendering function
This avoids us from using a bogus background_color value that
mutates as swaybar renders things and deciding opacity depending on
that.

Also remove a redundant full surface clear. Just directly write our
desired background color.
2023-04-02 01:58:02 +02:00
Alexander Orzechowski 5d5b21dcce swaybar: Set opaque region properly
The opaque region is set incorrectly if updated on-the-fly if switching from an opaque to a non opaque background.
2023-04-02 01:58:02 +02:00
Simon Ser dee032d0a0 ipc: add LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM entry
This was introduced in the last libinput release.

Fixes the following error:

    ../sway/ipc-json.c:928:17: error: enumeration value 'LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM' not handled in switch [-Werror=switch]
      928 |                 switch (libinput_device_config_accel_get_profile(device)) {
          |                 ^~~~~~
2023-03-27 10:56:16 +02:00
Ronan Pigott 6701b90c55 Add a .mailmap file 2023-03-26 23:22:30 +02:00
Simon Ser 4f6e559dec man: deprecate seat cursor move/set/press/release
The Wayland protocol better serves this purpose, and is supported
by more compositors.
2023-03-26 23:22:04 +02:00
Erik Reider ac1ed638e9 Init the damage_ring bounds on output creation
Otherwise the initial bounds would be `INT_MAX` until `handle_mode` or `handle_commit` is called :)
2023-03-26 23:00:08 +02:00
Ankit Pandey f21090f978 root: Set inactive focus when scratchpad is moved to new workspace
Fixes an issue where an already visible scratchpad window being moved due to
'scratchpad show' leaves the entire workspace at the top of the focus stack in
the old workspace. Moving by 'focus output' back to the old workspace would
focus the entire workspace instead of just the last active container.
2023-03-24 13:20:13 -07:00
Ankit Pandey 90c2d631e2 root: Try to preserve relative positions of floating containers
This makes the behavior of floating containers more consistent with i3.
The coordinates of the container are scaled when the size of the
workspace it is on changes or when the container is moved
between workspaces on different outputs.

For scratchpad containers, add a new state that preserves the dimensions
of the last output the window appeared on. This is necessary because
after a container is hidden in the scratchpad, we expect it to be in the
same relative position on the output when it reappears. We can't just
use the container's attached workspace because that workspace's
dimensions might have been changed or the workspace as a whole could
have been destroyed.
2023-03-14 23:26:42 -07:00
Stanislav Ochotnický ebeed7e303 man: add warning for hide_cursor configuration
See https://github.com/swaywm/sway/issues/6297
2023-03-11 11:58:05 -05:00
Simon Zeni 51c9376c07
ci: add libdisplay-info dependency 2023-02-28 23:19:33 +01:00
novenary b28e1b0d3c Disable direct scanout for surfaces with popups 2023-02-28 15:38:05 +01:00
llyyr b757ef94ef sway{,bar}: use default font hint style
CAIRO_HINT_STYLE_FULL attempts to maximize contrast at the expense
of fidelity, this makes most fonts that haven't been hand hinted,
which makes up the majority of fonts out there, appear much worse.

In the absence of explicitly set hint style, cairo will default to
CAIRO_HINT_STYLE_SLIGHT, which attempts to improve contrast while
retaining fidelity to the original shapes, which is what we want.
2023-02-27 13:55:08 -05:00
rj1 d63497698b fix typo 2023-02-25 10:50:43 +01:00
Robin Jarry 9498e4d261 Allow windows in scratchpad to set the urgent flag
When a window in the scratchpad container requests for
xdg_activation_v1, it is ignored no matter what the value of
focus_on_window_activation is.

At least allow windows in the scratchpad to set the urgent flag. When
focus_on_window_activation is set to "focus", show the parent scratchpad
where the contained requested for xdg_activation_v1.
2023-02-22 11:41:43 -07:00
Simon Ser 16b0afd433 Check for empty damage before attaching render buffer
Check whether output->damage_ring.current is empty before calling
wlr_output_attach_render(). Saves us from having to un-do that
via wlr_output_rollback().
2023-02-22 13:37:44 -05:00
Simon Ser c2ccc0c9d4 Move output commit out of output_render()
That way output_render() only does what it says on the tin.
2023-02-22 13:37:44 -05:00
Simon Ser d6cb4fa8de Constify pixman_region32_t for rendering functions 2023-02-22 13:37:44 -05:00
Simon Ser 423459723b Adjust scale for fractional-scale-v1 2023-02-22 10:14:31 -05:00
Stacy Harper 4666d1785b Implement seatop_touch
Atm we got issue with the touch position sent to the clients. While
holding contact, leaving the initial container will continue to send
motion event to the client but with the new local position from the new
container.

This seatop goal is to send the position of the touch event, relatively
to the initial container layout position.
2023-02-20 10:35:10 -05:00
Simon Ser 7d2e4a5106 layer-shell: enter output before surface is mapped
This sends fractional-scale-v1 events before the first configure
event. That way clients have all of the metadata they need to render
the first frame.
2023-02-20 12:20:42 +01:00
Simon Ser 7a6c7d60d5 Update surface fractional scale on output change
Closes: https://github.com/swaywm/sway/issues/7464
2023-02-20 12:11:07 +01:00
Ronan Pigott 633d409b88 container: rehome the container_swap function into container.c
This function was already declared in container.h but defined in
commands/swap.c for some unknown reason. Everything in commands/ assumes
the handler context has been set appropriately by the command preludes
but this function snuck its way into seatop_* which doesn't set anything
in the handler context.

The fact that the seatop drag actions manipulate the focus without
custody of the seat means they are definitely very broken in multiseat.
2023-02-19 20:07:39 -05:00
Daniel Hill 788118f194 Fix map_to_output * turning off device
Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-02-18 20:15:28 +01:00
Simon Ser 9162b536f6 Add support for fractional-scale-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
2023-02-10 20:36:15 +01:00
Simon Ser 1cab17ada2 Introduce surface_{enter,leave}_output()
We can centralize all output-related surface events from there.
2023-02-10 20:36:15 +01:00
Łukasz Adamczak 8e4b659578 Clarify documentation for window_rect 2023-02-10 11:17:50 -07:00
Łukasz Adamczak fadfbe8dba Correct window_rect.y with hide_edge_borders
With `hide_edge_borders both` (or at least `vertical`),
`window_rect.y` will equal `border_thickness` for SOME windows,
but it will be 0 for windows adjacent to top screen edge.

Therefore setting it to `border_thickness` is not sufficient.

This commit changes it to the actual y offset of content
into the container.
2023-02-10 11:17:50 -07:00
Ronan Pigott 1b27e8c8fd xdg-activation: fix urgency when the client does not specify a seat
xdg-activation is now too strict in only allowing tokens with a seat to
activate a surface. Clients may rely on this behavior for urgency hints.
The seat argument is still useful in case the client does provide a seat
so we can activate it on the desired seat.

Fixes: 842609da64 (view: make request_activate take a seat, 2022-11-30)
2023-02-09 20:02:32 +01:00
Simon Ser b4ce0a30c1 Use wlr_linux_dmabuf_feedback_v1_init_with_options()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3933
Closes: https://github.com/swaywm/sway/issues/7436
Closes: https://github.com/swaywm/sway/pull/7437
2023-02-07 13:35:56 -05:00
Baltazár Radics 7d0351b411 ipc: add ability to subscribe to output event 2023-02-06 11:02:52 +01:00
Ronan Pigott 4cda9ee3a3 launcher: support external launcher tokens 2023-02-05 00:53:47 -07:00
Ronan Pigott dbc1eec850 launcher: make launcher context seat aware 2023-02-05 00:53:47 -07:00
Ronan Pigott 842609da64 view: make request_activate take a seat
This way we can move focus on the same seat an activation token
originates from.
2023-02-05 00:53:47 -07:00
Simon Ser 0780d3a465 ci: install hwdata-dev on Alpine
We're missing the pkg-config file so the DRM backend gets disabled.
2023-02-04 20:48:20 -07:00
Simon Ser 0695f3fa2a swaymsg: s/inactive/disabled/
The JSON field is named "active", but that's confusing for users:
`output disable` is the command which results in `active = false`
outputs. Use the same terminology in end-user messages.
2023-02-02 12:00:06 -05:00
Simon Ser f22d4dbab7 swaymsg: print output power status 2023-02-02 12:00:06 -05:00
Radical 412b80983e
Add Norwegian READMR
Added a Norwegian README file `README.no.md` and added a link to it in
the original `README.md` file.
2023-02-02 17:45:01 +01:00