Before we were populating wlr_output.current_mode with a generated
fixed mode when a custom mode was committed in the DRM backend. But
that's no longer the case: now a custom mode behaves the same under
the DRM backend and other backends.
wlr_output_layout was still assuming that an output without a
current_mode was disabled. Fix that assumption.
Fixes: 5567aefb1c ("backend/drm: Don't add pollute fixed modes list with custom modes")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3743
We have current and pending state and the code uses struct
assignments between them and resets and frees in multiple places.
Introduce a reset() function so we can unify that.
wlr_cursor is responsible for sending enter/leave events, but
doesn't send fractional-scale-v1 and wl_surface.preferred_buffer_scale
events. This is not an easy thing to do from a compositor, so let's
just do it in wlr_cursor itself.
When we cleared the pending backend damage when the output committed,
we would not take into account the output transform. It's easiest to fix
this by just changing pending_commit_damage to always have transformed
coordinates.
Direct scanout damage will just accumulate on the damage ring while in
direct scanout and properly damage when we exit anyway. On the flip side
since we now manage backend damage submission ourselves, this won't break
that either.
Sadly, the new API is not backwards compatible with the old API. Since
we have already switched all users in wlroots to the new API compositors
are already practically mandated to implement the new API. Let's get rid
of the old one since there is no point.
This adds an alternate way to use wlr_damage_ring without the
concept of buffer age. Buffer age is a concept inherited from EGL
but there is no real reason why we should continue to use that in
wlroots. Instead, use wlr_buffer pointers.
Eventually, we should be able to remove the buffer age based
functions.
new_subsurface emitted immediately isn't actually that useful. Revert the change
and document that this event is special.
This reverts commit 504b9491f0.
This commit changes the behavior of `new_*` signals to better match
their names (see https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3608).
wlr_xdg_shell.events.new_surface is now emitted when an xdg_surface is
created, and wlr_xdg_shell.events.new_{toplevel,popup} events are
introduced to get notified when an xdg_{toplevel,popup} is created.
Same applies to
`wlr_xdg_decoration_manager_v1.events.new_toplevel_decoration`. As a
result, wlr_xdg_surface.added and wlr_xdg_toplevel_decoration_v1.added
are removed, as we no longer need to track whether the corresponding
event was emitted.
Additionally, this commit changes the behavior of
wlr_xdg_surface.events.destroy: it is now emitted when the xdg_surface
is destroyed, as the name suggests.
wlr_xdg_{toplevel,popup}.events.destroy events are added to get
notified when an xdg_{toplevel,popup} is destroyed.
The wl_display destroy listener cleans up the global (if any).
wlr_output.display will go away, so setup the listener in
wlr_output_create_global() instead of wlr_output_init().
Currently wlr_output holds a wl_display, but it will go away soon.
Instead of relying on that field in wlr_output_create_global(),
make the dependency explicit by taking a wl_display as argument.
While the xdg-shell protocol requires this, it does not yet have
a dedicated error code for invalid titles; this commit makes
wlroots send a generic error instead.