aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-04-21backend/libinput: correctly populate x/y fields on tablet proximity inTudor Brindus
Otherwise, the cursor will briefly jump to (0, 0). This is particularly noticeable in the referenced issue (the game osu!). Refs swaywm/sway#3633
2020-04-17Document the events of wlr_layer_surfaceIsaac Freund
2020-04-15logind: Close fd before releasing deviceKenny Levinsen
This speeds up shutdown significantly, and is in line with how Weston does it.
2020-04-15seat: add selection event docsTudor Roman
2020-04-15tinywl: remove redundant create output global callIsaac Freund
2020-04-14backend/multi: add backends at end of listSimon Ser
This allows wlr_multi_for_each_backend to iterate on the backends in the order where they have been added.
2020-04-14seat: add check for NULL keyboardr-c-f
Check for a NULL keyboard_state.keyboard value in seat_client_create_keyboard() before trying to use it, as is done in other functions like seat_client_send_repeat_info(). Prevents a segfault in certain situations on keyboard removal, as seen in the sway issue. Closes: https://github.com/swaywm/sway/issues/5205 Closes: https://github.com/swaywm/wlroots/issues/2073
2020-04-10output: fix maybe-uninitialized warningSimon Ser
GCC is complaining about a maybe-uninitialized variable when doing a release build. Even if that can't actually happen because all enum values are handled, add an abort call to silence the warning.
2020-04-10backend/wayland: check scan-out buffer is compatible in output_testSimon Ser
If the buffer doesn't have a supported format/modifier, make the test fail.
2020-04-10output: check for buffer size compatibility in common codeSimon Ser
Instead of checking for buffer size compatibility in each backend, centralize the check in wlr_output itself.
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: only expose linux-dmabuf if EGL extension is supportedSimon Ser
Only expose linux-dmabuf extension if EGL_EXT_image_dmabuf_import_ext is supported. Closes: https://github.com/swaywm/wlroots/issues/2076
2020-04-09render/gles2: only call wlr_egl_bind_display if supportedSimon Ser
This allows us to hard-fail if the extension is advertised but we fail to enable it.
2020-04-09backend: set EGL_RENDERABLE_TYPE and EGL_SURFACE_TYPESimon Ser
Ensure these are set to the correct value.
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-08backend: reset EGL surface after buffer swapSimon Ser
This prevents GL commands to affect a previously current EGL surface after a buffer swap.
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-25Prevent memory leak in copypaste of the screencopy exampleRabit
If someone want to use screencopy as is processing multiple screenshots - it could be hard to find this issue with shm.
2020-03-24build: Add 'auto' to logind-provider combo optionScott Moreau
The logind provider defaulted to systemd and in order to use elogind, -Dlogin-provider=elogind was required. This adds 'auto' as a choice for the login-provider option and sets it as default. Using 'auto', the build will check for systemd first and if it's not found, try to find and use elogind automatically.
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-21wlr_surface: Post error if multiple role objects createdScott Anderson
This fixes an assertion failure if a client tries to do this, e.g. by creating multiple toplevel objects for the same surface. If the same role data is set multiple times, this does not cause an error, which is how cursors use this interface.
2020-03-17backend/wayland: close keymap FDSimon Ser
We don't actually need the keymap. We need to close the FD or we will run out of FDs.
2020-03-15Fix uint32 overflow in fill_empty_gamma_table on Icelake platformFilip Sandborg
Closes: https://github.com/swaywm/sway/issues/4826
2020-03-14Send pointer enter/leave on capability changeIsaac Freund
This is more correct according to the protocol and fixes issues with clients that wait for an enter event before processing pointer events.
2020-03-13Properly popluate keys array for enter on creationIsaac Freund
This corrects an oversight made in 3f617631cb68c0e90a755b86f9c241caf0080f9a
2020-03-13Send keyboard enter/leave on capability changeIsaac Freund
This is more correct according to the protocol and fixes issues with clients that wait for an enter event before processing key events
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-12output: add comment about needs_frame in wlr_output_schedule_frameSimon Ser
Add a comment to not forget why this call is necessary. References: https://github.com/swaywm/wlroots/pull/2053
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-09render/gles2: remove duplicated format listSimon Ser
2020-03-07util/log: improve time prefixSimon Ser
Log milliseconds. This is useful when debugging a rendering loop. Print the time relative to the compositor start-up.
2020-03-06output: don't send a needs_frame event if already sentSimon Ser
2020-03-06output: make wlr_output_schedule_frame set output->needs_frameSimon Ser
This way, wlr_output_schedule_frame will always be followed by a wlr_output_commit. This forces the compositor to render an extra frame before stopping the rendering loop. To test, run wleird's frame-callback [1], make sure it's the only visible client on the output and check the interval between frame events is the output's refresh period instead of zero. [1]: https://github.com/emersion/wleird/blob/master/frame-callback.c Closes: https://github.com/swaywm/wlroots/issues/2051
2020-03-06xwayland: remove underscore prefix from atom namesSimon Ser
Previously, some atoms had a leading underscore, others didn't. Be more consistent and never use a leading underscore (symbols with a leading underscore followed by an upper-case letter are reserved).
2020-03-06xwayland: remove duplicate _NET_WM_NAME entrySimon Ser
2020-03-06xwayland: use explicit indexes when initializing atom_mapSimon Ser
It's very easy to break the mapping between the atom_name enum and the atom_map array. Use explicit indexes to prevent issues.
2020-03-06backend/drm: add support for adaptive_sync_enabledSimon Ser
The vrr_capable and VRR_ENABLED properties are used.
2020-03-06backend/x11: add support for adaptive_sync_enabledSimon Ser
This sets the _VARIABLE_REFRESH window property [1]. [1]: https://gitlab.freedesktop.org/mesa/mesa/blob/0616b7ac90cf4f86bb409d34101e3a3cceac8cbe/src/vulkan/wsi/wsi_common_x11.c#L1374
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-04xcursor: also look for cursor themes under ${datadir}/icons by defaultJan Beich
Same as https://gitlab.freedesktop.org/wayland/wayland/commit/dd8891be36ec
2020-03-04backend/wayland: fix seat caps handlingSimon Ser
Previously, each time a wl_seat.capabilities event was received the Wayland backend created new input devices. It now only does so the first time. Input devices are now destroyed when the cap is removed. Closes: https://github.com/swaywm/sway/issues/5055
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