This wasn't that great:
1. Now that damage ring tracks damage across actual wlr_buffer objects,
it can use the buffer size to do any sort of cropping that needs to
happen.
2. The damage ring size really should be the size of the transformed
size of the output. Compositors currently have to call
`wlr_damage_ring_set_bounds()` where it might not be clear when to
call the function. Compositors can just check against the actual
output bounds that they care about when processing the damage.
Fixes: #3891
A struct wlr_xdg_toplevel_configure is passed in with the whole
state. This makes it a lot clearer that the size and WM state are
always sent to the client.
It was completely wrong: according to the protocol, the effective
geometry is only updated on commit time if there pending state has
new state from xdg_surface.set_window_geometry or
xdg_surface.set_window_geometry has never been sent at all.
This commit adds wlr_xdg_surface.geometry which correctly matches the
effective window geometry and removes now-useless
wlr_xdg_surface_get_geometry().
It seems that some scene compositors want to avoid wlr_scene_output_commit
and use the lower lever wlr_scene_output_build_state. However, build
state does not early return if a frame is not needed so compositors will
implement the check themselves. Let's add a helper function that compositors
can use to implement the check.
Technically pending_commit_damage is a private interface, so this lets
compositors not interface with private interfaces to implement the check.
This commit removes extra wlr_xdg_toplevel_set_parent() calls,
simplifies wlr_surface->wlr_xdg_toplevel conversion logic, makes related
structures store wlr_xdg_toplevel objects directly instead of
wlr_surface objects, and improves the code style.
The infrastructure to read _NET_WM_WINDOW_TYPE already exists in wlroots
(it's used for example in wlr_xwayland_or_surface_wants_focus()). But
the window type isn't easily accessible to the compositor because the
atoms to compare against are private to xwm.c.
labwc has recently gone to a fair amount of effort (including opening a
whole new xcb connection) just to get the needed window type atoms:
a04b394e59
It seems much cleaner to add the remaining few (3) atoms to wlroots and
implement a shared function which can be used by any wlroots compositor.
v2: naming updates
Previously it was supplying a pointer to private struct wlr_xwm
which was useless for compositors. The wlr_xwayland pointer in
contrast does have a generic data field and thus can be used by
compositors to attach their own pointer.
Additionally change the return value from int to bool.
This is especially useful if the compositor wants to support X11
panels to control windows. Without the signal a compositor does
have to hook into the user_event_handler callback but that would
not change the _NET_SUPPORTED root window property.