aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-17render/gles2: use .x/.y instead of .s/.tSimon Ser
texcoord is a vector of coordinates, with the first member being the X axis value and the second member being the Y axis value. It makes more sense to use the accessors with the same names.
2020-06-16render: assert sane values for box functionsRouven Czerwinski
Width and height should always be > 0 for render functions which take a wlr_box. References https://github.com/swaywm/wlroots/issues/2281
2020-06-13screencopy: Use correct constant for y-inversionAndri Yngvason
2020-06-13backend: drm: Fix dmabuf resource leakAndri Yngvason
2020-06-11examples/fullscreen-shell: stop advertising linux-dmabuf unconditonallySimon Ser
Remove the wlr_linux_dmabuf_v1_create call. wlr_renderer_init_wl_display will take care of creating the linux-dmabuf global if the OpenGL implementation supports it.
2020-06-11examples/screencopy-dmabuf: call strncpy with maxlen - 1Simon Ser
The original code wasn't wrong since we were manually writing a null byte anyway, but this makes GCC happy. Closes: https://github.com/swaywm/wlroots/issues/2273
2020-06-10render/egl: explicit client extension handlingSimon Ser
Prior to this commit, wlr_egl_init seemed to assume the extension string queried via EGL_NO_DISPLAY was a subset of the extension string queried via an initialized display. This isn't correct. EGL_EXT_client_extensions [1] defines two types of extensions: client extensions and display extensions. The set of supported client and display extensions are disjoint (ie. an extension is either a client or a display extension, not both). Client extensions are queried via EGL_NO_DISPLAY, display extensions are queried via an initialized display. Rename the variables to make this clear. Remove the misleading comment. Log both client and display extensions. [1]: https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_client_extensions.txt
2020-06-09output: document wlr_output_export_dmabufSimon Ser
2020-06-09buffer: document wlr_buffer_get_dmabuf DMA-BUF lifetimeSimon Ser
2020-06-08render: Fix blit_dmabuf() breakage due to API changeAndri Yngvason
2020-06-08examples: Add screencopy-dmabuf exampleAndri Yngvason
2020-06-08screencopy: Implement copying into linux-dmabufAndri Yngvason
2020-06-08protocol: screencopy: Extend to report linux-dmabuf capabilityAndri Yngvason
A new version of the protocol is required so that the client can discover which buffer types are supported by the compositor.
2020-06-08render: Add wlr_renderer_blit_dmabuf()Andri Yngvason
2020-06-08render: egl: Add utility functions for saving/restoring contextAndri Yngvason
2020-06-08backend/drm: fix stack overflow in dealloc_crtcSimon Ser
Call drm_crtc_commit directly instead of calling drm_connector_set_mode. This restores the previous behaviour where conn_enable was called [1]. [1]: https://github.com/swaywm/wlroots/blob/0c7c562482575cacaecadcd7913ef25aeb21711f/backend/drm/drm.c#L1093 Closes: https://github.com/swaywm/wlroots/issues/2253
2020-06-08contributing: add note about events that destroy objectsSimon Ser
2020-06-08contributing: resource destroy handlers need to cleanup pointersSimon Ser
2020-06-06render: choose DMA-BUF texture target via eglQueryDmaBufModifiersEXTSimon Ser
EGL_EXT_image_dma_buf_import_modifiers tells us whether we should use GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES. Using the right texture target can fix some failures and/or improve performance on some drivers. This does the same as a Weston commit [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/commit/40c519a3e613 Closes: https://github.com/swaywm/wlroots/issues/2173
2020-06-06util/time: move `timespec_sub` to time utilitiesTudor Brindus
2020-06-06util/time: de-duplicate `timespec_to_msec`Tudor Brindus
2020-06-06util: fix and move `get_current_time_msec` into a util fileTudor Brindus
This commit makes `get_current_time_msec` correctly return milliseconds as opposed to microseconds. It also considers the value of `tv_sec`, so we don't lose occasionally go back in time by one second. Finally, the function is moved into `util/time.cc` so that it can be reused elsewhere without having to consider these pitfalls.
2020-06-05Allow keyboard and pointer grabs to hook clear_focus()Thomas Hebb
This is necessary for some grabs, which currently have no way of knowing when the pointer/keyboard focus has left a surface. For example, without this, a drag-and-drop grab can erroneously drop into a window that the cursor is no longer over. This is the plumbing needed to properly fix swaywm/sway#5220. The existing fix, swaywm/sway#5222, relies on every grab's `enter()` hook allowing a `NULL` surface. This is not guaranteed by the API and, in fact, is not the case for the xdg-shell popup grab and results in a crash when the cursor leaves a surface and does not immediately enter another one while a popup is open (#2161). This fix also adds an assertion to wlr_seat_pointer_notify_enter() that ensures it's never called with a `NULL` surface. This will make Sway crash much more until it fixes its usage of the API, so we should land this at the same time as a fix in Sway (which I haven't posted yet).
2020-06-05wlr_seat: Clarify wording of non-grab-respecting function commentsThomas Hebb
I found the previous wording a bit confusing when I first read it. Reword these comments to explicitly say that the grab-respecting variants should be used in most cases. This change has no functional effect.
2020-06-05wlr_seat: Declare functions in the same order for pointer, keyboard, and touchThomas Hebb
These three APIs are very similar to one another, but they all had slightly different function orderings. For consistency, always declare the non_`notify` functions first, then the `notify` functions, then `{start,end,has}_grab`. This change has no functional effect.
2020-06-03backend/drm: fix black screens when enabling outputSimon Ser
This patch fixes this failure: 01:57:16.642 [ERROR] [backend/drm/drm.c:360] Failed to page-flip output 'eDP-1': a page-flip is already pending 01:57:16.684 [ERROR] [backend/drm/drm.c:360] Failed to page-flip output 'eDP-1': a page-flip is already pending 01:57:16.684 [ERROR] [backend/drm/drm.c:732] Failed to initialize renderer on connector 'eDP-1': initial page-flip failed 01:57:16.684 [ERROR] [backend/drm/drm.c:805] Failed to initialize renderer for plane 01:57:16.684 [sway/config/output.c:423] Failed to commit output eDP-1 References: https://github.com/swaywm/sway/issues/5101
2020-06-02render: stop making EGL context current in wlr_egl_initSimon Ser
This leaves an EGL context current behind. wlr_gles2_renderer_create was assuming the EGL context was already current because of this (because it called a GL function right off the bat).
2020-06-02backend/wayland: fix spurious eglSwapBuffers failuresSimon Ser
This was introduced in [1]. However after reverting that PR I still can't reproduce the bug the PR aimed to fix [2]. Since there's no good explanation why we would need to swap buffers before resizing, let's just revert the PR. [1]: https://github.com/swaywm/wlroots/pull/1486 [2]: https://github.com/swaywm/wlroots/issues/1371 Closes: https://github.com/swaywm/wlroots/issues/1768
2020-06-01backend/wayland: scale tablet tool position into [0, 1] rangeTudor Brindus
Fixes #2233.
2020-06-01backend/drm: always perform a CRTC commit in drm_connector_commitSimon Ser
When the mode, status or buffer hasn't changed, drm_connector_commit was a no-op. Because of this individual changes to the gamma LUT or adaptive sync status were ignored (if committed without a buffer). Instead, perform a commit to apply the changes.
2020-06-01backend/drm: drop extra wlr_output_update_enabled callSimon Ser
drm_connector_set_mode already takes care of keeping this up-to-date.
2020-06-01backend/drm: commit/rollback FBs in drm_crtc_commitSimon Ser
We need to perform the FB bookkeeping on all commits, not just on page-flips.
2020-06-01backend/drm: make adaptive_sync atomicSimon Ser
Stop using drmModeObjectSetProperty, set the property in the crtc_commit function instead.
2020-06-01backend/drm: rollback pending CRTC state on test commitSimon Ser
A test commit doesn't apply the pending state. The CRTC state will be populated again if the compositor decides to perform a regular commit afterwards.
2020-06-01export-dmabuf: Keep frame->output = NULL until frame is readyAndri Yngvason
This fixes a crash that happens when a client requests a frame on a backend that does not implement export_dmabuf. An assertion fails with the message: sway: types/wlr_output.c:777: wlr_output_lock_attach_render: Assertion `output->attach_render_locks > 0' failed.
2020-05-31wlr_keyboard_group: introduce enter and leaveBrian Ashworth
This introduces the enter and leave events for wlr_keyboard_group. The enter event is emitted when a keyboard is added to the group while a key is pressed that is not pressed by any other keyboard in the group. The data is a wl_array of the pressed key codes unique to the keyboard that should now be considered pressed. Similarly the leave event is emitted when a keyboard is removed from the group while at least one key is pressed that is not pressed by any other keyboard in the group. The data is a wl_array of the pressed key codes unique to the keyboard that should now be considered released. The purpose of these events are to allow the compositor to update its state to avoid corruption. Additionally, for the leave event, the focused surface may have been notified of a key press for some or all of the key codes and needs to be notified of a key release to avoid state corruption. These were previously emitted as normal key events, but they are not normal key events. There is no actual key press or release associated with the events. It's purely for state keeping purposes. Emitting them as separate events allows the compositor to handle them differently. Since these are purely for state keeping purposes and are not associated with an actual key being pressed or released, bindings should not be triggered as a result of these events.
2020-05-29Don't send redundant capability updatesKalyan Sriram
2020-05-28Add comments for missing tablet tool entriesSimon Ser
And stop using default cases, so that we know which parts of the code need an update when adding a new enum entry. Closes: https://github.com/swaywm/wlroots/issues/2208
2020-05-28seat: Create inert objects for missing capabilitiesKenny Levinsen
We should throw a protocol error if the relevant capability has never existed when get_(pointer|keyboard|touch) is called. Otherwise, it should succeed, even if the capability is not currently present. This follows the spec, and avoids possible races with the client when capabilities are lost. Closes: https://github.com/swaywm/wlroots/issues/2227
2020-05-27backend/drm: fix missing crtc->cursor NULL checkSimon Ser
Fixes: cdb6fdbc6cb7 ("backend/drm: remove missing cursor plane workaround")
2020-05-27backend/drm: don't set cursor if off-screenSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/2216
2020-05-27xwayland: add error-checking to `server_start_lazy`Tudor Brindus
This prevents a very unlikely crash in `xwayland_socket_connected`. Refs #2163.
2020-05-26backend/drm: introduce pending and current CRTC stateSimon Ser
Previously, we only had the pending state (crtc->pending, crtc->mode and crtc->active). This causes issues when a commit fails: the pending state is left as-is, and the next commit may read stale data from it. This will also cause issues when implementing test-only commits: we need to rollback the pending CRTC state after a test-only commit. Introduce separate pending and current CRTC states. Properly update the current state after a commit.
2020-05-26backend/drm: nuke retry_pageflipSimon Ser
retry_pageflip is now dead code, since drm_connector_start_renderer isn't called anymore. It was previously called when enabling an output. The name "retry_pageflip" was a little confusing because the function retried a modeset and the timer wasn't set up while performing a simple page-flip. Let's just remove this altogether for now. We can discuss whether it's worth it to bring it back. Should we only do it on failed page-flips? Should we only do it on EBUSY?
2020-05-26backend/drm: make drm_connector_set_mode take a wlr_drm_connectorSimon Ser
Since this is an internal DRM backend function, there's no reason we need to take a generic wlr_output.
2020-05-26backend/drm: remove enable_drm_connectorSimon Ser
Merge enable_drm_connector into drm_connector_set_mode. This allows us to de-duplicate logic since enabling an output performs a modeset.
2020-05-26backend/drm: remove drm_connector_set_custom_modeSimon Ser
Replace it with a function that returns the pending mode.
2020-05-26backend/drm: refuse to enable an output without a modeSimon Ser
2020-05-26backend/drm: rollback atomic blobsSimon Ser
If the atomic commit fails or is test-only, rollback wlr_drm_crtc.{mode_id,gamma_lut} blob IDs to their previous value. This prevents the next commits from failing or applying test-only state.
2020-05-25xwayland: send focus change event unconditionallyTudor Brindus
This fixes issues with (at least) dialogs in Jetbrains IDEs becoming unclickable if they ever lost focus (ref. swaywm/sway#5373). Prior to this change, since `xwm->focus_surface` would be set prior to `xwm_surface_activate` being called, the latter would short-circuit immediately and not notify the application of the focus change.