mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
output: replace wlr_output.damage with a damage event
This patch disambiguates the needs_frame event by uncoupling it from damage. A new separate damage event is emitted when the backend damages the output (this happens e.g. VT is changed or software cursors are used). The event specifies the damaged region. The wlr_output.damage field is removed. wlr_output is no longer responsible for tracking its own damage, this is wlr_output_damage's job. This is a breaking change, but wlr_output_damage users shouldn't need an update. Bugs fixed: - Screen flashes on VT switch - Cursor damage issues on the X11 and headless backends Closes: https://github.com/swaywm/sway/issues/5086
This commit is contained in:
parent
07737e85cc
commit
e0bbafc253
4 changed files with 43 additions and 14 deletions
|
|
@ -138,7 +138,6 @@ struct wlr_output {
|
|||
|
||||
bool needs_frame;
|
||||
// damage for cursors and fullscreen surface, in output-local coordinates
|
||||
pixman_region32_t damage;
|
||||
bool frame_pending;
|
||||
float transform_matrix[9];
|
||||
|
||||
|
|
@ -150,8 +149,11 @@ struct wlr_output {
|
|||
struct {
|
||||
// Request to render a frame
|
||||
struct wl_signal frame;
|
||||
// Emitted when buffers need to be swapped (because software cursors or
|
||||
// fullscreen damage or because of backend-specific logic)
|
||||
// Emitted when software cursors or backend-specific logic damage the
|
||||
// output
|
||||
struct wl_signal damage; // wlr_output_event_damage
|
||||
// Emitted when a new frame needs to be committed (because of
|
||||
// backend-specific logic)
|
||||
struct wl_signal needs_frame;
|
||||
// Emitted right before commit
|
||||
struct wl_signal precommit; // wlr_output_event_precommit
|
||||
|
|
@ -181,6 +183,11 @@ struct wlr_output {
|
|||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_output_event_damage {
|
||||
struct wlr_output *output;
|
||||
pixman_region32_t *damage; // output-buffer-local coordinates
|
||||
};
|
||||
|
||||
struct wlr_output_event_precommit {
|
||||
struct wlr_output *output;
|
||||
struct timespec *when;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ struct wlr_output_damage {
|
|||
struct wl_listener output_transform;
|
||||
struct wl_listener output_scale;
|
||||
struct wl_listener output_needs_frame;
|
||||
struct wl_listener output_damage;
|
||||
struct wl_listener output_frame;
|
||||
struct wl_listener output_commit;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue