aboutsummaryrefslogtreecommitdiff
path: root/backend/session
AgeCommit message (Collapse)Author
2024-02-01backend/session: add docsSimon Ser
2023-11-23backend/session: take wl_event_loop instead of wl_displaySimon Ser
wl_display holds a lot more than wlr_session needs: wlr_session only needs to wait for a FD to become readable, but wl_display provides full access to the Wayland client and protocol objects. Switch to wl_event_loop to better reflect the above.
2022-11-25backend/session: make optionalSimon Ser
Some compositors are not interested in wlr_session, for instance nested compositors. Disabling wlr_session removes the udev dependency.
2022-11-25backend: use time helpers to implement timeoutsSimon Ser
Instead of hand-rolling get_current_time_msec(), let's just re-use the helper we already have in "util/time.h".
2022-11-25backend/session: disable libseat examples for subproject by defaultSimon Ser
We have no use for these.
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2021-12-19build: simplify Meson subproject fallbacksSimon Ser
All of these projects use meson.override_dependency() so we can stop referencing their internal variable name to grab the depndencies we need.
2021-12-13backend/drm: add wlr_drm_backend_monitorChris Chamberlain
This helper is responsible for listening for new DRM devices and create new child DRM backends as necessary.
2021-11-19Introduce WLR_DEVICE_LEASE eventsSimon Ser
This will allow the DRM backend to reload its lessee list.
2021-11-02backend/session: introduce wlr_device_change_eventSimon Ser
This struct contains additional information for session device change events, such as the DRM connector ID that has changed.
2021-06-17backend/session: use DRM_PRIMARY_MINOR_NAMESimon Ser
Instead of hardcoding the string "card", use DRM_PRIMARY_MINOR_NAME. Some systems may use another prefix, e.g. OpenBSD uses "drm" instead.
2021-06-17backend/session: use drmIsKMSSimon Ser
This moves the magic incantation into libdrm and is clearer. See [1] for details. While at it, fixup the doc comment and improve logging. [1]: https://gitlab.freedesktop.org/mesa/drm/-/commit/523b3658aa8efa746417e916c987de23740ce313
2021-04-27backend/session: add wlr_device.events.removeSimon Ser
2021-04-18backend/session: Close remaining devices on destroyKenny Levinsen
2021-04-18backend/session: Close fd in wlr_session_close_fileKenny Levinsen
This was lost in the session_impl removal refactor.
2021-04-14backend/session: Remove session_implKenny Levinsen
libseat provides all session functionality, so there is no longer need for a session backend abstraction. The libseat device ID, seat handle and event loop handle are moved to the main wlr_session and wlr_device structs.
2021-04-14backend/session: Remove noop backendKenny Levinsen
This is instead delegated to libseat.
2021-04-14backend/session: Remove direct backendKenny Levinsen
This is instead delegated to libseat.
2021-04-14backend/session: Make libseat mandatoryKenny Levinsen
2021-04-11backend/session: Remove logind backendKenny Levinsen
This is instead delegated to libseat.
2021-04-09build: disable libseat subproject server and man pagesSimon Ser
When libseat is built as a subproject, we're not interested in building the server or the man pages.
2021-04-02build: add subproject fallback for libseatSimon Ser
This allows libseat to be compiled as a Meson subproject when it's not installed system-wide. This can ease development and compilation on distributions where libseat isn't packaged.
2021-03-15backend/session/libseat: Set loglevel to INFOKenny Levinsen
2021-02-28backend/session: fix KMS device filteringSimon Ser
As explained in [1], user-space should perform a drmModeGetResources call to figure out whether a device supports KMS. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/127
2021-02-15build: use dictionnary for features instead of configuration_dataSimon Ser
This allows us to easily iterate on all features and only deal with bools.
2021-02-05Make implementation function lists static constManuel Stoeckl
This requires a change to the type of `struct wlr_tablet` and `wlr_tablet_init` signature, both of which are part of the unstable API.
2021-01-04backend/session: allow wlr_session_find_gpus to return an errorSimon Ser
Sometimes wlr_session_find_gpus will encounter an error. This is different from finding zero GPUs. On error, wlr_session_find_gpus already returns -1. However, this is casted to size_t, so callers uncorrectly assume this is a success. Instead, make wlr_session_find_gpus return a ssize_t and allow callers to handle the error accordingly.
2020-12-05backend/session/libseat: set XDG_SESSION_TYPESimon Ser
libseat will call logind's SetType method if necessary.
2020-11-24backend/libseat: fix change_vt return valueIsaac Freund
This should return true on success and false on failure not vice-versa.
2020-11-19backend/session: add a timeout waiting for GPUsSimon Ser
If a GPU doesn't show up in 10s, bail out and return zero GPUs.
2020-11-19backend/session/logind: log when using XDG_SESSION_IDSimon Ser
This makes it easier to figure out how wlroots selected the session.
2020-11-19backend/session: replace session_signal with events.activeSimon Ser
This is more idiomatic wlroots API. The new name makes it clear that the signal is emitted when wlr_session.active changes.
2020-11-19Revert "session/logind: support CanGraphical property"Simon Ser
We now use udev to wait for DRM card devices. This reverts commit 3ebf079a9a120a27fc1008a62e7f99d5d166b745.
2020-11-19backend/session: wait for DRM device if none foundSimon Ser
Wait for a DRM device if none is found in wlr_session_find_gpus. This can happen if the compositor is loaded before the display kernel driver. This supersedes the logind CanGraphical property. To test, e.g. with i915 and sway: rmmod -f i915 sway & modprobe i915 Closes: https://github.com/swaywm/wlroots/issues/2093
2020-11-19backend/session: introduce wlr_session.events.add_drm_cardSimon Ser
This is triggered when a new DRM card is added. An easy way to test this patch is `modprobe vkms`.
2020-11-19backend/session: filter udev events by sysnameSimon Ser
We're only interested in card devices. The loop over wlr_session.devices would take care of ignoring non-card events, but a future patch will listen to udev "add" events as well.
2020-11-19backend/session: operate on wlr_deviceSimon Ser
Instead of operating on FDs in {open,close}_device, operate on wlr_devices. This avoids the device lookup in wlr_session and allows callers to have access to wlr_device fields. For now, we use it to remove wlr_session_signal_add and replace it with a more idiomatic wlr_session.events.change field. In the future, other events will be added.
2020-11-19backend/session: don't return FD on failure in open_fileSimon Ser
When wlr_session_open_file fails, don't return the FD, otherwise the caller will think the call succeeded.
2020-09-04Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not allnerdopolis
seat0s have TTYs
2020-09-04session: Don't refuse unprivileged creation of "direct" backendPatrick Steinhardt
When starting a compositor that's using the "direct" session backend, wlroots needs to handle calls to `drmSetMaster()` and `drmDropMaster()`. As both calls used to require `CAP_SYS_ADMIN`, wlroots thus simply refused starting in case the process doesn't enjoy evelated privileges. Permission rules have changed since linux.git commit 45bc3d26c95a (drm: rework SET_MASTER and DROP_MASTER perm handling, 2020-03-19). As a result, starting with Linux v5.8, both ioctls will now also succeed if the process is currently or has been the DRM master. And as the first process to open render nodes will become the DRM master automatically, this effectively means that process elevation is not strictly required in all setups anymore. So let's drop the `geteuid() != 0` permission check to allow those new rules to do their magic.
2020-09-02Quieten failure to set login session typeRyan Walklin
(almost certainly due to systemd version <246)
2020-09-01backend/session/libseat: register log handlerSimon Ser
Route libseat errors through wlroots logging infrastructure. This requires libseat 0.2.0.
2020-08-26session: Add missing init to direct-freebsdKenny Levinsen
bad1e9afa8ea ("session: Add libseat backend") introduced a change to to how session backends initialize, but failed to update the FreeBSD specific version of the direct backend accordingly. Closes: https://github.com/swaywm/wlroots/issues/2376
2020-08-24session: Add libseat backendKenny Levinsen
2020-08-07Don't set XDG_SESSION_TYPE unless logind SetType succeedsRyan Walklin
2020-08-07Also set XDG_SESSION_TYPERyan Walklin
2020-08-07Implement logind session SetType method to change session type to waylandRyan Walklin
2020-07-27Fix incorrect format parametersAntonin Décimo
2020-04-29Remove libcap supportScott Anderson
This is simply a false sense of security, and is worse than just using setuid. CAP_SYS_ADMIN is an extremely serious capability that is effectively as powerful as root. It also required users to be in the input group, which allows any process to keylog the entire system.
2020-04-15logind: Close fd before releasing deviceKenny Levinsen
This speeds up shutdown significantly, and is in line with how Weston does it.