aboutsummaryrefslogtreecommitdiff
path: root/backend/session
AgeCommit message (Collapse)Author
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.
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-02-17backend/session: allow GPU enumeration on FreeBSDJan Beich
https://github.com/FreeBSDDesktop/libudev-devd/commit/f11ee5b418c740ba6fd4c946ab10b0d89702e4d0
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-22backend/session/freebsd: Fix the way to get TTY pathTing-Wei Lan
Previously, the path of TTY is generated using snprintf with %d format. It works with TTY 1 to 10, but fails with TTY with greater number because the number used in the name is in base 32 instead of base 10. Since there is no standard function to convert a number to a string with a custom base, this commit adds a function to do it. Fixes: https://github.com/swaywm/wlroots/issues/1854
2019-11-03session/logind: Clean up add_signal_matchesScott Anderson
The original signal matching was using the old interface before sd_bus_match_signal was added, which the new code uses. Change them all to use it now.
2019-11-03session/logind: support CanGraphical propertyRonan Pigott
2019-08-12backend/session: non-void function should return a valueAntonin Décimo
With assertions disabled, it should make sense to return NULL.
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration.
2019-05-22session/logind: check for XDG_SESSION_ID firstJan Chren
In order to support compositors running as systemd user units without display manager, a mechanism for specifying session ID exactly must exist. Checking for `XDG_SESSION_ID` mimics loginctl behaviour https://github.com/systemd/systemd/blob/e95be7def26c6c5feaf08a4135aa4f50c53263a8/src/login/loginctl.c#L856.
2019-05-22session/logind: specify seat exactlyJan Chren
"/org/freedesktop/login1/seat/self" path triggers seat-finding code path in logind, which currently relies on getting the session based on caller's PID. This behaviour is deprecated in logind as it doesn't work eg. with systemd user units, which run outside of user session. We check for "seat0" in logind_change_vt() already as introduced in 47985d2dc56a6af469ac9375e7548136765aff16, so hard-coding it here is not a problem, otherwise sd_session_get_seat() could be used.
2019-05-13session/logind: keep active for pause_device goneBrian Ashworth
This appears to be a quick fix for compositors freezing when a dock is disconnected. Disconnection of the dock is causing `pause_device` for the DRM devices associated with the dock. Since these devices major number is `DRM_MAJOR`, the session was being set to inactive. This just makes it so the session is not set to inactive when the device's state is `gone`.
2019-03-06backend/session: Allow setting a custom tty via WLR_DIRECT_TTYNiklas Schulze
2019-03-05backend/session: open TTY with O_CLOEXEC for direct sessionemersion
2019-03-02backend/session: add noop sessionemersion
This is the first step towards being able to run via DRM leasing and on render nodes. Test with: export WLR_BACKENDS=drm export WLR_SESSION=noop export WLR_DRM_DEVICES=/dev/dri/renderD128
2019-03-01meson: enable more compiler warningsemersion
2019-02-03Allow compositors to run as systemd user unitsmnussbaum
When a wlroots compositor runs as a systemd user unit there is no session associated with the compositor process. Instead we need to attach to an active and graphical user session. This change first looks for an available session for the process, and if there isn't one falls back to display in the oldest available graphical session. This work was modeled after a similar change to mutter - https://gitlab.gnome.org/GNOME/mutter/merge_requests/150.
2019-01-31backend/session/logind: dup FD with CLOEXECemersion
2019-01-07Simplify evdev includes on FreeBSD by relying on up-to-date packageJan Beich
As evdev-proto is installed by CI some files have been missed: ../examples/pointer-constraints.c:2:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../examples/relative-pointer-unstable-v1.c:5:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-12-06backend/session/logind: improve loggingemersion
2018-11-12Use #if instead of #ifdef for wlroots config dataemersion
This prevents some annoying issues when e.g. not including wlr/config.h or making a typo in the guard name.
2018-10-04Use sd_bus_get_property_trivial & remove numberingnyorain
2018-09-24Rework session handlingnyorain
Sessions can now be retrieved from a backend in a more general manner. Multi-backend gets back its `session` field that contains the session if one was created, removing the interfacing from multi backend with the drm backend directly. This adds the possibility to use sessions even without the drm backend. It additionally fixes the bug that 2 session objects got created when WLR_BACKENDS were set to "libinput,drm". To allow vt switching without drm backend (and drm fd) on logind, start listening to PropertiesChanged signals from dbus and parse the session "Active" property when no master fd was created (this does not change current drm backend behaviour in any way).