aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
AgeCommit message (Collapse)Author
2020-04-22render/gles2: add wlr_gles2_renderer_check_extSimon Ser
2020-04-22output_layout: improve docsSimon Ser
2020-04-17Document the events of wlr_layer_surfaceIsaac Freund
2020-04-15seat: add selection event docsTudor Roman
2020-04-10output: fix blurred hw cursors with fractional scalingSimon Ser
The scaling factor was being implicitly cast to an int. Closes: https://github.com/swaywm/sway/issues/4927
2020-04-09render/egl: make config attribs constSimon Ser
wlr_egl_init is not allowed to mutate these attribs.
2020-04-08Add wlr_output_impl.rollbackSimon Ser
Most of the pending output state is not forwarded to the backend prior to an output commit. For instance, wlr_output_set_mode just stashes the mode without calling any wlr_output_impl function. wlr_output_impl.commit is responsible for applying the pending mode. However, there are exceptions to this rule. The first one is wlr_output_attach_render. It won't go away before renderer v6 is complete, because it needs to set the current EGL surface. The second one is wlr_output_attach_buffer. wlr_output_impl.attach_buffer is removed in [1]. When wlr_output_rollback is called, all pending state is supposed to be cleared. This works for all the state except the two exceptions mentionned above. To fix this, introduce wlr_output_impl.rollback. Right now, the backend resets the current EGL surface. This prevents GL commands from affecting the output after wlr_output_rollback. This patch is required for FBO-based outputs to work properly. The compositor might be using FBOs for its own purposes [2], having leftover FBO state can have bad consequences. [1]: https://github.com/swaywm/wlroots/pull/2097 [2]: https://github.com/swaywm/wlroots/pull/2063#issuecomment-597614312
2020-04-08output: check buffer in wlr_output_testSimon Ser
Check that buffer can be scanned out in wlr_output_test instead of wlr_output_attach_buffer. This allows the backend to have access to the whole pending state when performing the check. This brings the wlr_output API more in line with the KMS API. This removes the need for wlr_output_attach_buffer to return a value, and for wlr_output_impl.attach_buffer.
2020-04-08output: introduce wlr_output_testSimon Ser
2020-04-02buffer: add width and heightSimon Ser
2020-04-02buffer: add a release eventSimon Ser
Consumers call wlr_buffer_lock. Once all consumers are done with the buffer, only the producer should have a reference to the buffer. In this case, we can release the buffer (and let the producer re-use it).
2020-04-02buffer: add destroy eventSimon Ser
2020-03-29Gracefully handle inert wl_output resourcesSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/2088
2020-03-24Return false on wlr_keyboard_set_keymap() failureIsaac Freund
This allows users of the library to handle or ignore the error as they see fit.
2020-03-23Return failure of wlr_renderer_init_wl_display()Isaac Freund
This makes it easier for the user of this library to properly handle failure of this function. The signature of wlr_renderer_impl.init_wl_display was also modified to allow for proper error propagation.
2020-03-12output: replace wlr_output.damage with a damage eventSimon Ser
This patch disambiguates the needs_frame event by uncoupling it from damage. A new separate damage event is emitted when the backend damages the output (this happens e.g. VT is changed or software cursors are used). The event specifies the damaged region. The wlr_output.damage field is removed. wlr_output is no longer responsible for tracking its own damage, this is wlr_output_damage's job. This is a breaking change, but wlr_output_damage users shouldn't need an update. Bugs fixed: - Screen flashes on VT switch - Cursor damage issues on the X11 and headless backends Closes: https://github.com/swaywm/sway/issues/5086
2020-03-09buffer: remove unused wlr_client_buffer fieldsSimon Ser
Forgot to remove these, they are superseded by fields in wlr_buffer. Some functions were still using them. Fixes: 8afc1ed68cfa ("Introduce wlr_client_buffer") Closes: https://github.com/swaywm/sway/issues/5087
2020-03-06output: add adaptive_sync_enabled propertySimon Ser
2020-03-06Introduce wlr_client_bufferSimon Ser
Split out the client/resource handling out of wlr_buffer by introducing wlr_client_buffer. Make wlr_buffer an interface so that compositors can create their own wlr_buffers (e.g. backed by GBM, like glider [1]). [1]: https://github.com/emersion/glider/blob/c66847dd1cf8ae5e68666ce7cb3be41427b38dc7/include/gbm_allocator.h#L7
2020-03-04output: remove wlr_output_impl.schedule_frameSimon Ser
This function allowed backends to provide a custom function for frame scheduling. Before resuming the rendering loop, the DRM and Wayland backends would wait for vsync. There isn't a clear benefit of doing this. The only upside is that we get more stable timings: the delay between two repaints doesn't change too much and is close to a mutliple of the refresh rate. However this introduces latency, especially when a client misses a frame. For instance a fullscreen game missing vblank will need to wait more than a whole frame before being able to display new content. This worst case scenario happens as follows: - Client is still rendering its frame and cannot submit it in time - Deadline is reached - Compositor decides to stop the rendering loop since nothing changed on screen - Client finally manages to render its frame, submits it - Compositor calls wlr_output_schedule_frame - DRM backend waits for next vblank - The wlr_output frame event is fired, compositor draws new content on screen - On the second next vblank, the new content reaches the screen With this patch, the wlr_output frame event is fired immediately when the client submits its late frame. This change also makes it easier to support variable refresh rate, since VRR is all about being able to present too-late frames earlier. References: https://github.com/swaywm/wlroots/issues/1925
2020-02-20keyboard-shortcuts-inhibit: Implement the protocolMichael Weiser
The keyboard shortcuts inhibitor protocol is useful for remote desktop and virtualization software in order to request all keyboard events to be passed to it and (almost) none being resonded to by the compositor. This allows the session at the other end of the remote desktop connection or inside the virtual machine to be interacted with as usual (e.g. Alt+Tab to switch windows on the remote system instead of locally). Add the wayland protocol to the meson build files. Copy'n'search'n'replace the very similar idle inhibit protocol implementation. This already provides all the basic functionality: - creating and destroying inhibitors upon request by a client, - destruction in reaction to destruction of surfaces or displays, - a list of inhibitors to search through for existing ones as well as - a signal to be sent to the compositor upon registration of a new inhibitor. Beyond that we add the active and inactive events to be sent to the client and wire those to activate and deactivate functions for the compositor to call in confirmation of activation of a new inhibitor or (un-)suspending of an existing inhibitor e.g. in response to a special key combination entered by the user as suggested by the protocol. As mandated by the protocol, we check the existance of an inhibitor for a given surface and seat upon creation and return the error provided by the protocol for that purpose. Signed-off-by: Michael Weiser <michael.weiser@gmx.de> Closes: https://github.com/swaywm/wlroots/issues/1817
2020-02-20Implement wlr-output-power-management-v1Guido Günther
Co-authored-by: Simon Ser <contact@emersion.fr>
2020-02-20text_input_v3: Note features supported by the text fieldDorota Czaplejewicz
With this information, consumers can realize they will never retrieve some state, and adjust their strategy.
2020-02-19output-management: add current_configuration_dirtyIlia Bozhinov
Previously, if the current configuration contains an output X which is destroyed, its head is automatically removed. If the compositor submits the new configuration after X was removed, the current output configuration is incorrectly detected to be the same as the previous one, and no done event is sent. To prevent this, we can just keep track of whether the current configuration is dirty, i.e whether we have sent a done event for it.
2020-02-10virtual-pointer: Add request for mapping to specific outputAndri Yngvason
2020-01-24render: unconditionally disable implicit X11 includesSimon Ser
Even if the X11 backend or Xwayland is enabled, we don't rely on EGL/egl.h including Xlib headers.
2020-01-24build: replace version with soversionSimon Ser
This allows us to have a single number to update when doing a release. This drops WLR_VERSION_API_* definitions.
2020-01-10Drop RDP backendDrew DeVault
Users interested in remote access to wlroots compositors should use wayvnc: https://github.com/any1/wayvnc
2019-12-31render: guard rendering operations between begin() and end()Simon Ser
Add a wlr_renderer.rendering bool, set it to true between wlr_renderer_begin() and wlr_renderer_end(). Assert we're rendering when calling functions that render.
2019-12-31virtual-pointer: Add support for the wlr-virtual-pointer-unstable-v1Josef Gajdusek
2019-12-30xdg-shell: fix inert xdg_surface handlingSimon Ser
Closes: https://github.com/swaywm/sway/issues/4834 Closes: https://github.com/swaywm/wlroots/issues/1890
2019-12-30output: refuse to commit a buffer or modeset a disabled outputSimon Ser
References: https://github.com/swaywm/wlroots/issues/1780#issuecomment-518938390
2019-12-30output: re-introduce atomic mode, enabled, scale and transformSimon Ser
This reverts commit 01f903874b7e27539488fad7f31476d5bcbc6ac9 and re-applies commit ee5f98ad49fed0439f3313ec685307831d1d1d05. Updates: https://github.com/swaywm/wlroots/issues/1640 (Atomic output updates issue) See also: https://github.com/swaywm/wlroots/pull/1762 (Atomic output updates original PR) See also: https://github.com/swaywm/wlroots/issues/1780 (Issue caused by atomic output updates) See also: https://github.com/swaywm/sway/issues/4419 (Issue caused by atomic output updates) See also: https://github.com/swaywm/wlroots/pull/1781 (Revert PR)
2019-12-29xdg-output-v1: use wlr_output.descriptionSimon Ser
Since [1], the xdg-output description is mutable. Listen to output description changes and send the new output description when updated. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/commit/048102f21ad3783f64c4996704b07a13a010fd19
2019-12-29output: add descriptionSimon Ser
wlr_output.description is a string containing a human-readable string identifying the output. Compositors can customise it via wlr_output_set_description, for instance to make the name more user-friendly. References: https://github.com/swaywm/wlroots/issues/1623
2019-12-23meson: Various improvementsScott Anderson
Bumps minimum version to 0.51.0 - Remove all intermediate static libraries. They serve no purpose and are just add a bunch of boilerplate for managing dependencies and options. It's now managed as a list of files which are compiled into libwlroots directly. - Use install_subdir instead of installing headers individually. I've changed my mind since I did that. Listing them out is annoying as hell, and it's easy to forget to do it. - Add not_found_message for all of our optional dependencies that have a meson option. It gives some hints about what option to pass and what the optional dependency is for. - Move all backend subdirectories into their own meson.build. This keeps some of the backend-specific build logic (especially rdp and session) more neatly separated off. - Don't overlink example clients with code they're not using. This was done by merging the protocol dictionaries and setting some variables containing the code and client header file. Example clients now explicitly mention what extension protocols they want to link to. - Split compositor example logic from client example logic. - Minor formatting changes
2019-12-20Refactor EGL/GL API loadingSimon Ser
Remove glapi.sh code generation, replace it with hand-written loading code that checks extension strings before calling eglGetProcAddress. The GLES2 renderer still uses global state because of: - {PUSH,POP}_GLES2_DEBUG macros - wlr_gles2_texture_from_* taking a wlr_egl instead of the renderer
2019-12-01Revert "output: add block_idle_frame"Simon Ser
This reverts commit cbb2781fed7944dae680a66a35443f5b1a678ec7. In [1], we found issues with block_idle_frame and replaced it with frame_pending. block_idle_frame is now unused. [1]: https://github.com/swaywm/sway/pull/4772
2019-11-25Simplify globals implementation by removing destructorsSimon Ser
Some globals are static and it doesn't make sense to destroy them before the wl_display. For instance, wl_compositor should be created before the display is started and shouldn't be destroyed. For these globals, we can simplify the code by removing the destructor and stop keeping track of wl_resources (these will be destroyed with the wl_display by libwayland).
2019-11-23Amend typosJason
2019-11-21presentation-time: add helper for common caseSimon Ser
Most of the time, compositors just display the surface's current buffer on an output. Add an helper to make it easy to support presentation-time in this case.
2019-11-21presentation-time: make API more flexibleSimon Ser
The wlr_presentation_feedback struct now tracks presentation feedback for multiple resources (but still a single surface content update). This allows the compositor to properly send presentation events even when there is more than one frame of latency or when it references a surface's buffer.
2019-11-17output: add wlr_output_event_present.commit_seqSimon Ser
This is set to the value of wlr_output.commit_seq when the frame has been submitted. This allows tracking presentation with more then 1 full frame of latency. References: https://github.com/swaywm/wlroots/issues/1917
2019-11-13backend/wayland: expose remote objectsSimon Ser
Expose the remote wl_display, wl_surface and wl_seat used by the Wayland backend. This allows compositors to customize the Wayland backend and to have more freedom. For instance a compositor might want to handle clipboard and drag-and-drop from the remote Wayland compositor. Another compositor might want to setup pointer constraints.
2019-11-11Introduce wlr_renderer_get_eglDrew DeVault
2019-11-07render/gles2: provide public API to access GL textureSimon Ser
Prior to this commit, compositors needed to render the texture to an intermediate off-screen buffer using wlr_renderer APIs if they wanted to use a custom rendering path (e.g. render to a 3D scene). A new wlr_gles2_texture_get_attribs exposes the GL texture target and ID so that compositors can render wlr_textures with their own shaders. An example of a compositor doing so is available at [1]. [1]: https://git.sr.ht/~sircmpwn/wxrc/tree/3db905b7842ac42cf1878876e647005b41f00a52/src/render.c#L227
2019-11-06render: remove EGL includes from wlr_texture.hSimon Ser
2019-11-05Introduce wlr_keyboard_groupBrian Ashworth
A wlr_keyboard_group allows for multiple keyboard devices to be combined into one logical keyboard. Each keyboard device can only be added to one keyboard group. This helps with the situation where one physical keyboard is exposed as multiple keyboard devices. It is up to the compositors on how they group keyboards together, if at all. Since a wlr_keyboard_group is one logical keyboard, the keys are a set. This means that if a key is pressed on multiple keyboard devices, the key event will only be emitted once, but the internal state will count the number of devices that the key is pressed on. Likewise, the key release will not be emitted until the key is released from all devices. If the compositor wants access to which keys are pressed and released on each keyboard device, the events for those devices can be listened to, as they currently are, in addition to the group keyboard's events. Also, all keyboard devices in the group must share the same keymap. If the keymap's differ, the keyboard device will not be able to be added to the group. Once in the group, if the keymap or effective layout for one keyboard device changes, it will be synced to all keyboard devices in the group. The repeat info and keyboard modifiers are also synced
2019-10-27backend/drm: add support for custom modesSimon Ser
Use the CVT algorithm to create a drmModeModeInfo.
2019-10-22screencopy: Implement damage reportingAndri Yngvason