aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-01compositor: send WL_SURFACE_ERROR_INVALID_SIZE for non-cursor surfacesSimon Ser
See the discussion at [1]: there's no easy way to fix libwayland-cursor without a new API. Sending the error for other roles will prevent the same client bug from appearing elsewhere. [1]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/194
2022-06-01scene/output-layout: add initial outputsKirill Primak
2022-06-01scene/output-layout: improve ownership logicKirill Primak
This commit ensures that outputs that weren't created by the output layout helper aren't destroyed on the output layout change. Consider the following piece of logic: // struct wlr_output *o1, *o2; // struct wlr_scene *scene; // struct wlr_output_layout *layout; wlr_scene_attach_output_layout(scene, layout); wlr_output_layout_add_auto(layout, o1); struct wlr_scene_output *so2 = wlr_scene_output_create(scene, o2); wlr_output_layout_move(layout, o1, 100, 200); // so2 is invalid now
2022-06-01scene: add wlr_scene_output.events.destroyKirill Primak
2022-05-31scene/wlr_scene.h: fix indentationKirill Primak
2022-05-31output: drop wlr_output_cursor.events.destroySimon Ser
Compositors can just listen to wlr_output.events.destroy instead.
2022-05-31output: re-implement set_image with set_bufferSimon Ser
Avoids having two code-paths doing the same thing.
2022-05-31output: introduce wlr_output_cursor_set_bufferSimon Ser
This will supersede wlr_output_cursor_set_image, and then later also supersede wlr_output_cursor_set_surface.
2022-05-31output: remove noop backend check in wlr_output_cursor_set_imageSimon Ser
The noop backend doesn't exist anymore.
2022-05-31wlr_scene: Move children list from wlr_scene_node to wlr_scene_treeAlexander Orzechowski
2022-05-31wlr_scene: Inline wlr_scene_node_stateAlexander Orzechowski
This seems like nothing interesting was done with this. Let's simplify and allow us some flexibility in the future.
2022-05-31wlr_scene: Only allow parenting on a wlr_scene_treeAlexander Orzechowski
2022-05-31wlr_scene: Refactor wlr_scene (the root element) to encase a wlr_scene_treeAlexander Orzechowski
Co-authored-by: Isaac Freund <mail@isaacfreund.com>
2022-05-31backend/drm: improve atomic commit flag loggingSimon Ser
We weren't logging all of the flags, which made debugging more difficult.
2022-05-30relative-pointer-v1: don't allocate when inertSimon Ser
When the wl_pointer the zwp_relative_pointer_v1 is created with is inert, don't allocate any struct, just leave the resource's data pointer NULL.
2022-05-30relative-pointer-v1: remove unnecessary log messagesSimon Ser
Logging when a client creates or destroys an object is a bit too chatty.
2022-05-30relative-pointer-v1: remove unnecessary commentsSimon Ser
We don't do this in other implementations, so it feels out of place.
2022-05-30wlr_scene: Fix scaling with default source_boxConsolatis
Default to texture instead of destination_box geometry.
2022-05-30relative_pointer: handle inert pointer objectsRouven Czerwinski
Since 5e0ef70cc085 ("seat: Create inert objects for missing capabilities") wlroots can create inert seat objects when the capability is currently missing for the client but it had the capablity before. The client hoever will happily handover the wl_pointer resource to the relative_pointer implementation, creating a NULL pointer dereference when trying to access the seat_client which is set to NULL for inert objects. Since the protocol does not contain an error for such requests, we hand out an relative_pointer handle with the seat set to NULL. We also need to check whether there is an associated seat in send_relative_motion and need to tweak the destroy notifier in case no seat is available. This way we can hand out a valid relative_pointer resource and don't crash the compositor when trying to access an inert seat pointer resource in relative_pointer. Relevant WAYLAND_DEBUG=1 when testing a client and switching VT every second: [2619872.442] wl_seat@30.capabilities(3) [2619872.460] -> wl_seat@30.get_pointer(new id wl_pointer@36) [2619872.484] wl_data_device@25.selection(nil) [2619872.504] zwp_primary_selection_device_v1@26.selection(nil) [2619874.995] wl_seat@12.capabilities(3) [2619875.035] -> wl_compositor@5.create_surface(new id wl_surface@37) [2619875.088] -> wl_seat@12.get_pointer(new id wl_pointer@29) [2619875.105] -> zwp_relative_pointer_manager_v1@8.get_relative_pointer(new id zwp_relative_pointer_v1@27, wl_pointer@29) [2619875.127] -> wl_compositor@5.create_surface(new id wl_surface@35) [2619875.139] -> wl_seat@12.get_pointer(new id wl_pointer@43) [2619981.180] wl_seat@12.capabilities(2) [2619981.214] -> zwp_relative_pointer_v1@27.destroy() [2619981.226] -> wl_pointer@29.release() [2619981.236] -> wl_surface@37.destroy() [2619981.247] -> wl_pointer@43.release() [2619981.254] -> wl_surface@35.destroy() [2619981.262] wl_seat@12.capabilities(0) [2619981.285] -> wl_keyboard@33.release() [2619987.316] wl_seat@30.capabilities(2) [2619987.336] -> wl_pointer@36.release() [2619987.363] wl_seat@30.capabilities(0) [2619987.371] -> wl_keyboard@34.release() [2621932.880] wl_display@1.delete_id(41) [2621932.903] wl_display@1.delete_id(40) [2621932.910] wl_display@1.delete_id(27) [2621932.917] wl_display@1.delete_id(29) [2621932.924] wl_display@1.delete_id(37) [2621932.930] wl_display@1.delete_id(43) [2621932.944] wl_display@1.delete_id(35) [2621932.950] wl_display@1.delete_id(33) [2621932.959] wl_seat@12.capabilities(2) [2621932.976] -> wl_seat@12.get_keyboard(new id wl_keyboard@33) [2621936.875] wl_seat@12.capabilities(3) [2621936.893] -> wl_compositor@5.create_surface(new id wl_surface@35) [2621936.931] -> wl_seat@12.get_pointer(new id wl_pointer@43) [2621936.945] -> zwp_relative_pointer_manager_v1@8.get_relative_pointer(new id zwp_relative_pointer_v1@37, wl_pointer@43) [2621936.965] -> wl_compositor@5.create_surface(new id wl_surface@29) [2621936.987] -> wl_seat@12.get_pointer(new id wl_pointer@27) [2621942.796] wl_data_device@25.selection(nil) [2621942.817] zwp_primary_selection_device_v1@26.selection(nil) [2621942.823] wl_seat@30.capabilities(2)
2022-05-30build: make GBM optionalSimon Ser
Now that the DRM backend no longer depends on GBM, we can make it optional. The GLES2 renderer still depends on it because of our EGL device selection. This is useful for compositors with their own renderers, and for compositors using the Vulkan renderer.
2022-05-30output: add wlr_output_commit_stateSimon Ser
Same as wlr_output_commit, but takes a wlr_output_state.
2022-05-30output: add output_state_{init,finish}Simon Ser
2022-05-30output: add wlr_output_event_precommit.stateSimon Ser
2022-05-30output: add wlr_output_test_stateSimon Ser
Same as wlr_output_test, but takes a wlr_output_state argument.
2022-05-30output: pass wlr_output_state to rendering functionsSimon Ser
No functional change.
2022-05-30output: pass wlr_output_state to output_pending_resolutionSimon Ser
2022-05-30output: pass wlr_output_state to backendSimon Ser
Groundwork for the following commits. The goal is to allow users to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-28gitignore: remove unnecessary entries, add subprojects/Simon Ser
The previous entries aren't used because the build files are self-contained in the Meson build directory. Add subprojects/ because it's common for developers to override Meson dependencies via subproject symlinks.
2022-05-27docs/env_vars: fix case of WLR_SCENE_DEBUG_DAMAGE valuesSimon Ser
The values are lowercase, not uppercase.
2022-05-27tinywl: use xdg-shell v3Kirill Primak
2022-05-27xdg-shell: bump version to 3Kirill Primak
2022-05-27xdg-popup: add reposition supportKirill Primak
2022-05-27xdg-positioner: add v3 parametersKirill Primak
2022-05-27xdg-popup: use current/pending state patternKirill Primak
2022-05-27xdg-popup: add proper configure flowKirill Primak
2022-05-27backend/x11: fix output model strdup callSimon Ser
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434#note_1401193 Fixes: be86145322e6 ("output: turn make/model/serial into char *")
2022-05-26backend/drm: fix crash with null serialvaxerski
backend/drm: use serial_str instead
2022-05-26linux-dmabuf-v1: fix MOD_INVALID handling in feedback tranchesSimon Ser
[1] has changed wlr_drm_format to remove the assumption that MOD_INVALID is always implicitly enabled. MOD_INVALID is now part of the modifier list just like any other modifier. The patch adding support for linux-dmabuf-v1 feedback has been written a lot of time before [1], and hasn't been updated accordingly when merged. This results in MOD_INVALID being advertised twice [2] and other index bugs. Fix these issues by removing special-casing for MOD_INVALID. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3231 [2]: https://github.com/swaywm/sway/issues/7028
2022-05-26output: turn make/model/serial into char *Simon Ser
This allows the make/model/serial to be NULL when unset, and allows them to be longer than the hardcoded array length. This is a breaking change: compositors need to handle the new NULL case, and we stop setting make/model to useless "headless" or "wayland" strings.
2022-05-26backend/drm: fix crash in init_drm_surfaceSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434
2022-05-25render/egl: document wlr_egl_create_with_contextSimon Ser
2022-05-25render/egl: make wlr_egl_{make,unset,is}_current privateSimon Ser
These are trivial wrappers around eglMakeCurrent and eglGetCurrentContext. Compositors which need to call these functions will also call other EGL or GL functions anyways. Let's reduce our API surface a bit by making them private.
2022-05-25render/egl: make wlr_egl struct opaqueSimon Ser
Compositors can use wlr_egl_create_with_context if they need a custom EGL display or context.
2022-05-25render/egl: add wlr_egl_get_{context,display}Simon Ser
This allows compositors to integrate with the wlroots GLES2 renderer, if they need to perform custom GL rendering.
2022-05-25render/egl: drop MESA_EGL_NO_X11_HEADERSSimon Ser
This has been superseded by the standard EGL_NO_X11 switch, supported by Mesa 19.3.0+.
2022-05-25Reformat doc commentsSimon Ser
Unify the way we document our APIs. See CONTRIBUTING.md for the rules.
2022-05-25contributing: add section about documentation conventionsSimon Ser
Document the existing conventions. Use `mystruct.foo` instead of `mystruct::foo` because `::` is pretty alien to C. Instead of backticks, use a different format to reference declarations in our docs: See foo(). See struct foo. See union bar. See enum baz. See typedef meh. This is inspired by the kernel's documentation style [1]. This format has the upside of being pretty natural to write and read, and can be automatically processed by documentation generators. [1]: https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#cross-referencing-from-restructuredtext
2022-05-25backend/drm: remove wlr_drm_surface.{width,height}Simon Ser
This information is stored in wlr_swapchain, no need to duplicate it.
2022-05-24backend/drm: allow non-linear modifiers for multi-GPUSimon Ser
Prior to [1], if an entry in a DRM format set was different than a single LINEAR modifier, implicit modifiers were always allowed. This has changed and now implicit modifiers are only allowed if INVALID is in the list of modifiers. So now we can safely enable explicit modifiers for cross-GPU imports, without risking receiving buffers with an implicit modifier. This should improve perf a bit on setups where two GPUs from the same vendor are used. This fixes the first bullet point from [2]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3231 [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3331
2022-05-24util: Fix infinite loop in recursive functionSteven Newbury
When testing Xwayland multi-HiDPI support with Wine + SimCity4 I encountered a 100% CPU lockup from sway. This turned out to be triggering a bug in the wlroots pointer contraint code. region_confine() contains multiple recursive calls where arguments are modified and resubmitted to the function. One of the calls is however made using the original arguments, if/when this triggers it results in the same codepath being followed each loop so the condition always applies. It makes much more sense if this was intended to apply the clamped values x,y instead of the original x1,y1, and indeed this fixes the infinite loop and results in correct behaviour.