Commit Graph

12 Commits

Author SHA1 Message Date
Kirill Primak 072f6ed977 viewporter: fix "has buffer" check
Previously, cases when a viewport source box was updated without attaching
a buffer weren't checked for correctness properly because the state's buffer
would be NULL. Use wlr_surface_state_has_buffer() instead.
2024-03-24 02:20:18 +00:00
Kirill Primak 0052078bd3 compositor: introduce wlr_surface_reject_pending() 2024-01-27 12:05:05 +00:00
Simon Ser 4fbe648faf viewporter: fix src buffer bounds check
The surface scale and transform are applied before the viewport.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3766
2023-11-26 11:56:28 +00:00
Simon Ser 7dcb045176 viewporter: listen to client_commit
The commit event fires too late: we're interested in checking the
values at wl_surface.commit time, not after.
2023-11-26 11:56:28 +00:00
Simon Ser d1c88a22a3 viewporter: rename state var in viewport_handle_surface_commit()
"current" is misleading, since we are using the pending state here.
2023-11-26 11:56:28 +00:00
Kirill Primak 4966857f21 viewporter: check for an existing viewport 2023-07-07 12:49:06 +03:00
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Kirill Primak 617eb4fb93 surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
Simon Ser ba0525c5c0 surface: drop wlr_surface_state.buffer_resource
Instead, use wlr_surface_state.buffer only.
2021-09-06 14:21:23 -04:00
Simon Ser 0fe3b45361 viewporter: hide wlr_viewport
This is an internal struct.
2021-09-06 19:19:45 +02:00
Quantum 456c6e2279 viewporter: remove crop and scale state upon destruction
According to the viewport protocol, upon wp_viewport::destroy():

> The associated wl_surface's crop and scale state is removed.
> The change is applied on the next wl_surface.commit.

Therefore, wp_viewport_destroy(viewport) should remove all viewport state.

Currently, wlroots does not remove the crop and scale state. Instead, a
client must do:

    wl_fixed_t clear = wl_fixed_from_int(-1);
    wp_viewport_set_source(viewport, clear, clear, clear, clear);
    wp_viewport_set_destination(viewport, -1, -1);
    wp_viewport_destroy(viewport);

This commit adds the necessary logic into viewport_destroy and makes
wlroots comply with the protocol.
2021-08-02 09:08:03 +02:00
Simon Ser 9e68ed2159 viewporter: new protocol implementation
Closes: https://github.com/swaywm/wlroots/issues/633
2020-06-17 09:10:54 -06:00