Commit Graph

6877 Commits

Author SHA1 Message Date
Simon Ser 395a08f5d1 render/egl: fallback to GBM FD if EGLDevice is not available
It's possible that we don't have an EGLDevice if we created the
EGL context from a GBM device. Let's ensure all GPU-accelerated
renderers always have a DRM FD to return by falling back to GBM's
FD.
2023-11-28 13:12:43 +00:00
Simon Ser 9a0a4ce221 render/vulkan: drop current_command_buffer
This was used by the legacy rendering API. Since begin()/end()
only need to set current_render_buffer and nothing else, we can
drop all of these bits.
2023-11-28 12:56:30 +00:00
Kirill Primak c3c7b1c9d0 xwm: don't do anything except mapping on MapRequest
Instead, move the wlr_xwayland_surface_set_withdrawn() and
wlr_xwayland_surface_restack() calls to the MapNotify handler with an
override_redirect check, as they are done too early. This mirrors the logic in
the UnmapNotify handler and fixes a bug where wlr_xwayland_surface_restack()
would be called on an o-r window after the following sequence of requests:

- CreateWindow with override_redirect=True
- ChangeWindowAttributes with override_redirect=False
- MapWindow

Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3770
2023-11-27 13:21:17 +03:00
Kirill Primak 4990ed99eb backend/x11: don't send ConfigureRequest with the same size
Under X11, ConfigureNotify means that the window has already been resized.
Sending ConfigureRequest with the received size is not only useless, but also
can confuse the window manager, which will probably reply with the current
(i.e. *old*) size causing a configure loop.

Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3769
2023-11-27 09:46:11 +00:00
Kirill Primak 4102b722d9 backend/x11: check buffer format in output_test() 2023-11-26 23:11:28 +03: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 87346b3393 Revert "subcompositor: emit new_subsurface immediately"
new_subsurface emitted immediately isn't actually that useful. Revert the change
and document that this event is special.

This reverts commit 504b9491f0.
2023-11-25 11:47:11 +00:00
Simon Ser 36cc698bc5 matrix: deprecate
Compositors should no longer need matrix operations to render:
the old rendering API has been removed, and the new API doesn't
take matrices as input.
2023-11-25 08:37:55 +01:00
Simon Ser 56ec13596a Cleanup wlr_matrix.h includes
Many files used to require wlr_matrix but no longer do.
2023-11-25 08:37:43 +01:00
Kirill Primak 7661ab2bf1 compositor: deprecate wlr/types/wlr_region.h
The only function in that header is now also declared in
wlr/types/wlr_compositor.h.
2023-11-24 15:09:31 +03:00
Alexander Orzechowski 26158d0718 output: Drop transform matrix 2023-11-23 16:32:58 -05:00
Kirill Primak 78a09573af output: fix display destroy listener double removal
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3762
2023-11-23 21:20:46 +03:00
Kirill Primak 504b9491f0 subcompositor: emit new_subsurface immediately
See https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3608.
2023-11-23 13:18:06 +00:00
Kirill Primak 43fd3a007e subcompositor: don't map unadded subsurfaces 2023-11-23 13:18:06 +00:00
Kirill Primak e841366068 layer-shell: emit new_surface event at the proper time 2023-11-23 13:02:10 +00:00
Kirill Primak c85838892d xdg-{shell,decoration}: improve events
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.
2023-11-23 12:52:20 +00:00
Simon Ser d61ec694b3 output: take wl_event_loop in wlr_output_init()
We don't need the whole wl_display here anymore. The wl_event_loop
is enough.
2023-11-23 11:39:25 +00:00
Simon Ser d23d8ed3ba output: setup display destroy listener in wlr_output_create_global()
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().
2023-11-23 11:39:25 +00:00
Simon Ser 5717e27c06 output: take wl_display in wlr_output_create_global()
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.
2023-11-23 11:39:25 +00:00
Simon Ser 6a7463bb8e output-layout: take wl_display in constructor
The output layout creates and destroys wl_output globals. We will
soon need the wl_display to do so.
2023-11-23 11:39:25 +00:00
Simon Ser 63792b38e4 backend/session: take wl_event_loop instead of wl_display
wl_display holds a lot more than wlr_session needs: wlr_session
only needs to wait for a FD to become readable, but wl_display
provides full access to the Wayland client and protocol objects.

Switch to wl_event_loop to better reflect the above.
2023-11-23 11:15:07 +00:00
novenary f1762f428b xwm: ensure stack list only contains mapped managed surfaces 2023-11-23 10:41:41 +00:00
novenary 720e8ac26b xwm: avoid restacking managed surfaces above OR surfaces
This is consistent with other X11 window managers (checked against i3
and mutter).
2023-11-23 10:41:41 +00:00
Simon Ser 2eb225236e util/transform: add wlr_output_transform_coords()
We hand-roll this in multiple places.
2023-11-23 11:07:34 +01:00
Simon Ser 9e702e9cfe util/transform: move over wl_output_transform helpers
These aren't really tied to wlr_output.
2023-11-23 11:03:57 +01:00
Manuel Stoeckl a3d22dbe97 xdg-toplevel: check that title provided actually is UTF-8
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.
2023-11-22 22:03:00 +03:00
Simon Ser 41494244df render: drop legacy rendering API 2023-11-22 11:43:05 +01:00
Simon Ser b2aac3390d render/vulkan: drop legacy rendering API 2023-11-22 11:36:17 +01:00
Simon Ser 514caea437 render/pixman: drop legacy rendering API 2023-11-22 11:34:32 +01:00
Simon Ser 4635717d82 render/gles2: drop legacy rendering API 2023-11-22 11:33:10 +01:00
Simon Ser 0c83c331ca output/cursor: drop legacy rendering API 2023-11-22 11:30:14 +01:00
Simon Ser 40633ae7fd render: drop legacy render pass
All built-in renderers now implement the new API.
2023-11-22 00:55:56 +01:00
Kirill Primak 5dd614b9ad input-inhibitor: drop
wlr_input_inhibitor.h has been marked as deprecated in 0.17.0.
2023-11-21 20:10:18 +03:00
Simon Ser 3b4d7d2a92 build: bump version to 0.18.0-dev 2023-11-21 17:28:06 +01:00
Simon Ser fe53ec6937 tinywl: fix wlroots dependency constraint in Makefile 2023-11-21 17:22:02 +01:00
Simon Ser 767eedd3cb build: bump version to 0.17.0 2023-11-21 17:06:13 +01:00
Manuel Stoeckl dbe7fb7027 render/vulkan: undo alpha premult for 8-bpc ARGB/ABGR
When a texel from the Vulkan format VK_FORMAT_B8G8R8A8_SRGB is read,
the sRGB to linear conversion is applied independently to the R, G,
and B channels; the A channel has no influence on this. However,
DRM_FORMAT_ARGB8888 buffers are, per Wayland protocol, not encoded
in this fashion; one must first unpremultiply the color channels
before doing sRGB to linear conversion. This commit switches to
handling ARGB8888 and ABGR8888 formats using the general fragment
shader conversion from electrical to optical values.
2023-11-21 11:08:55 +00:00
Simon Ser fe6a432299 linux-dmabuf-v1: skip import check on split render/display SoCs
Unfortunately we have no way to get back the proper render node in
that case. This will be fixed with [1]: with that Mesa patch, the
wlr_renderer will return the proper render node and the existing
logic will work fine.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3757
2023-11-20 19:54:16 +01:00
Alexander Orzechowski 515681503e screencopy: Use box size instead for shm copy
This doesn't change functionality, both the values are the same. Less
confusing to use the box size.
2023-11-20 11:33:11 -05:00
Alexander Orzechowski 7a22030071 screencopy: Move frame bounds sanity check into common code 2023-11-20 11:33:11 -05:00
Alexander Orzechowski c8861a2865 screencopy: Define proper destination for dmabuf copy
Leaving this empty would have it filled in with the size of the source
texture, but we want the destination size.

Fixes: #3758
2023-11-20 11:33:10 -05:00
Simon Ser bd18d5ccfc backend/drm: drop unnecessary flags in legacy interface
drm_crtc_commit() already ensures that atomic-only flags are
disallowed.
2023-11-19 15:32:30 +01:00
Simon Ser 8c44e86077 backend/drm: add wlr_drm_connector_state.nonblock
Instead of having this condition checked in multiple places,
centralize it so that they don't go out-of-sync.
2023-11-19 15:32:30 +01:00
Simon Ser f47b6e3fce backend/drm: fix pending page-flip check
This chunk of code was moved by mistake.

Fixes: 3b53d1cbf1 ("backend/drm: introduce page-flip tracking struct")
2023-11-19 15:14:22 +01:00
Kirill Primak c6b498528c xcursor: don't store NULL xcursors 2023-11-19 15:33:39 +03:00
Kirill Primak e16b0068a7 xcursor: fix NULL deref on malloc() fail 2023-11-19 15:33:39 +03:00
Alexander Orzechowski b06d58fa8b backend/drm: Destroy page flips on backend destroy
When we destroy the backend, page flips will no longer be invoked meaning
those won't clean up the page flips for us.
2023-11-17 14:34:32 -05:00
Alexander Orzechowski 3aed24b8d4 backend/drm: Track page flips in list 2023-11-17 13:49:18 -05:00