aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-19wlr_scene: Only enable black rect optimization if culling is enabledAlexander Orzechowski
If culling is not enabled, there is no longer any guarantee that the elements behind the rect won't be rendered. We must render the black rect in all circumstances to cover up anything rendered. This fixes the WLR_SCENE_DISABLE_VISIBILTY option.
2022-08-19wlr_scene: Simplify calculate_visibilty optionAlexander Orzechowski
2022-08-19wlr_scene: Convert render_list to wl_arrayKenny Levinsen
This simplifies some of the growth logic, but uses array_realloc to shrink the array if needed.
2022-08-19util/array: Add array_realloc for wl_arrayKenny Levinsen
array_realloc will grow the array for the target size like wl_insert_add, but will also shrink the array if the target size is sufficiently smaller than the current allocation.
2022-08-19types/wlr_xdg_output_v1: Fix wl_output.done bug.Mark Bolhuis
If the client binds to version 3 of zxdg_output_v1 and version 1 of wl_output no wl_output.done or zxdg_output_v1.done event is emitted [1]. Also no wl_output.done event is emitted when version 2 or lower of zxdg_output_v1 is bound to. Add a version check to output_manager_handle_get_xdg_output so that no wl_output.done event is emitted when using version 1 of wl_output and version 2 or lower of zxdg_output_v1. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/81
2022-08-18Remove wlr_signal_emit_safeAlexander Orzechowski
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2022-08-18build: remove libkms option and disable tests for libdrm fallbackSimon Zeni
2022-08-16wlr_scene: fix color value when filtering black boxesyiqiang
Signed-off-by: yiqiang <yiqiang@kylinos.cn>
2022-08-15wlr_scene: Use wlr_box_equalAlexander Orzechowski
2022-08-15wlr_scene: Use wlr_fbox_equalsAlexander Orzechowski
2022-08-15util/box: Introduce wlr_fbox_equalAlexander Orzechowski
2022-08-15util/box: Introduce wlr_box_equalAlexander Orzechowski
2022-08-14wlr_scene: Remove unused typedefAlexander Orzechowski
2022-08-14wlr_scene: Account for occlusion by other scene nodes when calculating ↵Alexander Orzechowski
visibility
2022-08-14wlr_scene: Calculate output intersections based on node visibilityAlexander Orzechowski
This has a few benefits one of them crucial for proper operation: - The primary output will be based on the largest area that is actually visible to the user. Presentation and frame done events are based on this state. This is important to do since we cull frame done events. If we happen to be in a situation where a surface sits mostly on output A and some on output B but is completely obstructed by for instance a fullscreen surface on output A we will erroneously send frame_done events based on output A. If we base things as they are in reality (visibility) the primary output will instead be output B and things will work properly. - The primary output will be NULL if the surface is completely hidden. Due to quirks with wayland, on a surface commit, frame done events are required to be sent. Therefore, a new frame will be submitted for rendering on the primary output. We can improve adaptive sync on completely hidden but enabled surfaces if we null out the primary output in this state. - The client will be more likely to choose better metadata to use for rendering to an output's optimal rendering characteristics.
2022-08-14wlr_scene/surface: Hook through opaque metadataAlexander Orzechowski
2022-08-14wlr_scene: Introduce buffer opaque region metadataAlexander Orzechowski
2022-08-14wlr_scene: Rewrite direct scan out logic to rely on visibilityAlexander Orzechowski
Also make the regular rendering logic use the introduced render list.
2022-08-14wlr_scene: Don't render non visible parts of textures/rectsAlexander Orzechowski
We can also get rid of the intersection checks in the rendering functions because we are guaranteed to already be in the node do to the prior intersection checking of the node visibility.
2022-08-14wlr_scene: Only send frame done events for visible buffersAlexander Orzechowski
2022-08-14wlr_scene_set_buffer_with_damage: Only damage the visible parts of the nodeAlexander Orzechowski
2022-08-14wlr_scene: Rework damage handlingAlexander Orzechowski
Simplify damage handling by using our cached visibility state. Damaging can happen in one step because since we can use the old visibility state which represent what portions of the screen the scene node was. This way we can damage everything in one step after the fact.
2022-08-14wlr_scene: Add per scene node visibilityAlexander Orzechowski
2022-08-14wlr_scene: Damage scene on node destroy by disabling nodeAlexander Orzechowski
This removes one trivial call of scene_node_damage_whole. It's easier to disable the node later than it is to do the damage dance later.
2022-08-14wlr_scene: Introduce scene_nodes_in_boxAlexander Orzechowski
Will query the scene for all nodes that appear in the given wlr_box. The nodes will be sent to the iterator from closest to farthest from the eye. Refactor wlr_scene_node_at to use this new function.
2022-08-12surface: implement wl_surface.offsetSimon Ser
References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/123
2022-08-12surface: add WLR_SURFACE_STATE_OFFSETSimon Ser
This indicates whether the surface offset has changed.
2022-08-12render: replace wlr_texture_write_pixels with update_from_bufferSimon Ser
This lets the renderer handle the wlr_buffer directly, just like it does in texture_from_buffer. This also allows the renderer to batch the rectangle updates, and update more than the damage region if desirable (e.g. too many rects), so can be more efficient.
2022-08-11backend/wayland: fix touch device not added on startupSimon Ser
We were firing the new_input signal on backend initialization, before the compositor had the chance to add a listener for it. Mimick what's done for wl_keyboard: if the backend hasn't been started, delay wl_touch initialization. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3473
2022-08-10backend/drm: drop enum wlr_drm_connector_statusSimon Ser
We can just use libdrm's drmModeConnection enum instead.
2022-08-10backend/drm: drop WLR_DRM_CONN_NEEDS_MODESETSimon Ser
- Add wlr_output.enabled checks to CONNECTED checks - Replace NEEDS_MODESET with CONNECTED
2022-08-10backend/drm: remove unused WLR_DRM_CONN_CLEANUPSimon Ser
2022-08-08wlr_scene: Add option to disable direct scanoutAlexander Orzechowski
Closes: #3405 Supersedes: !3562 Co-authored-by: Xiao YaoBing <xiaoyaobing@qq.com>
2022-08-06scene/layer_shell: Ignore unmapped exclusion zoneKenny Levinsen
Only the exclusion zone for mapped layer shell surfaces should be respected. In particular, a layer shell surface that was mapped with an exclusion zone but is now unmapped should not adjust the usable area. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3471
2022-08-06xdg_shell: Destroy popups after unmap eventKenny Levinsen
This aligns with wlr_layer_shell_v1, and better matches how we normally use teardown signals.
2022-08-06Set mapped before firing map/unmap eventsKenny Levinsen
This allows whatever the user calls from the signal handlers to react to observe the new state rather than the old, e.g. that a surface is no longer mapped in the unmap handler.
2022-08-03single-pixel-buffer-v1: new protocol implementationSimon Ser
This implements the single-pixel-buffer-v1 protocol [1], to allow clients to create 1x1 buffers with a single color. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/104
2022-08-01xdg-shell: add support for v5Simon Ser
This version adds a wm_capabilities event.
2022-07-28seat/pointer: fix uninitialized variable warningQuantum
This results in the following warning, which in release mode causes an error due to -Werror: ../types/seat/wlr_seat_pointer.c: In function ‘wlr_seat_pointer_send_axis’: ../types/seat/wlr_seat_pointer.c:344:25: error: ‘low_res_value_discrete’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 343 | if (version < WL_POINTER_AXIS_VALUE120_SINCE_VERSION && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 344 | value_discrete != 0 && low_res_value_discrete == 0) { | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
2022-07-27seat/pointer: rework sending axis eventsKirill Primak
This commit fixes: - sending discrete scrolling events to multiple pointer resources - sending events to clients which don't support wl_pointer.axis_discrete
2022-07-25backend/drm: use drmModeConnectorGetPossibleCrtcsSimon Ser
This function has been merged in libdrm. References: https://gitlab.freedesktop.org/mesa/drm/-/commit/3ee004ef529f43366fdd1f4d32b26872cc82c6ca
2022-07-25backend/drm: use drmModeGetConnectorTypeNameSimon Ser
No need to manually maintain this table now. The wlroots names and the libdrm (= kernel) names all match. References: https://gitlab.freedesktop.org/mesa/drm/-/commit/50f8d517733d24fce6693ffae552f9833e2e6aa9
2022-07-20render/gles2: simplify alpha depth checkManuel Stoeckl
GL_ALPHA_BITS is the number of bits of the alpha channel of the currently bound frame buffer's color buffer -- which is precisely renderer->current_buffer->rbo . Thus, instead of binding the color buffer and checking its properties, we can query the already bound frame buffer. Note that GL_IMPLEMENTATION_COLOR_READ_{FORMAT,TYPE} are also properties of frame buffer's color buffer.
2022-07-11seat: support low-resolution clientsJosé Expósito
When the client doesn't support high-resolution scroll, accumulate deltas until we can notify a discrete event. Some mice have a free spinning wheel, making possible to lock the wheel when the accumulator value is not 0. To avoid synchronization issues between the mouse wheel and the accumulators, store the last delta and when the scroll direction changes, reset the accumulator.
2022-07-11seat: support high-resolution clientsJosé Expósito
Upgrade the seat protocol to version 8 and handle clients that support high-resolution scroll wheel events. Since the backend already sends discrete values in the 120 range, forwarding them is enough.
2022-07-11backend/wayland: handle high-res scroll eventsJosé Expósito
Receive high-resolution scroll events from the parent compositor using a Wayland listiner and emit the appropiate wlr_pointer signal.
2022-07-11backend/libinput: code style consistencyJosé Expósito
Reduce a level of identation in "handle_pointer_axis" to keep the consistency with "handle_pointer_axis_value120".
2022-07-11backend/libinput: handle high-res scroll eventsJosé Expósito
On newer versions of libinput, the event LIBINPUT_EVENT_POINTER_AXIS has been deprecated in favour of LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, LIBINPUT_EVENT_POINTER_SCROLL_FINGER and LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. Where new events are provided by the backend, ignore LIBINPUT_EVENT_POINTER_AXIS, receive high-resolution scroll events from libinput and emit the appropiate wlr_pointer signal.
2022-07-11pointer: transform low-res to high-res axis eventsJosé Expósito
Currently, the "wlr_event_pointer_axis" event stores low-resolution values in its "delta_discrete" field. Low-resolution values are always multiples of one, i.e., 1 for one wheel detent, 2 for two wheel detents, etc. In order to simplify internal handling of events, always transform in the backend from the low-resolution value into the high-resolution value. The transformation is performed by multiplying by 120. The 120 magic number is used by the kernel and it is exposed to clients in the "WLR_POINTER_AXIS_DISCRETE_STEP" constant.