Commit graph

45 commits

Author SHA1 Message Date
nerdopolis
e44bed0c2b Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not all
seat0s have TTYs
2020-09-04 11:46:54 +02:00
Ryan Walklin
28cedb5623 Quieten failure to set login session type
(almost certainly due to systemd version <246)
2020-09-02 11:35:32 +02:00
Kenny Levinsen
bad1e9afa8 session: Add libseat backend 2020-08-24 11:13:55 +02:00
Ryan Walklin
7e990a2991 Don't set XDG_SESSION_TYPE unless logind SetType succeeds 2020-08-07 19:15:25 +02:00
Ryan Walklin
e81d2086c0 Also set XDG_SESSION_TYPE 2020-08-07 19:15:25 +02:00
Ryan Walklin
f0d03fb892 Implement logind session SetType method to change session type to wayland 2020-08-07 19:15:25 +02:00
Antonin Décimo
d9bb792794 Fix incorrect format parameters 2020-07-27 10:49:19 +02:00
Kenny Levinsen
904c37845d logind: Close fd before releasing device
This speeds up shutdown significantly, and is in line with how Weston
does it.
2020-04-15 21:36:19 +02:00
Scott Anderson
626c98d754 session/logind: Clean up add_signal_matches
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-03 10:13:47 +01:00
Ronan Pigott
3ebf079a9a session/logind: support CanGraphical property 2019-11-03 00:17:23 +00:00
Antonin Décimo
68b4a5305e backend/session: non-void function should return a value
With assertions disabled, it should make sense to return NULL.
2019-08-12 09:37:21 +09:00
Simon Ser
ca45f4490c Remove all wayland-server.h includes
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-07-27 15:49:32 -04:00
Jan Chren
151b7d1d94 session/logind: check for XDG_SESSION_ID first
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 e95be7def2/src/login/loginctl.c (L856).
2019-05-22 15:43:07 +02:00
Jan Chren
e04e1ba197
session/logind: specify seat exactly
"/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 47985d2dc5,
so hard-coding it here is not a problem, otherwise sd_session_get_seat() could be used.
2019-05-22 14:43:13 +02:00
Brian Ashworth
90c284bded session/logind: keep active for pause_device gone
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-05-13 10:43:35 -04:00
emersion
5445d8aad0 meson: enable more compiler warnings 2019-03-01 09:20:23 +01:00
mnussbaum
c138da233b Allow compositors to run as systemd user units
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-02-03 18:45:32 -08:00
emersion
22faddde9e
backend/session/logind: dup FD with CLOEXEC 2019-01-31 16:11:45 +01:00
emersion
e23fe328a6
backend/session/logind: improve logging 2018-12-06 17:01:17 +01:00
emersion
51bfdd620e
Use #if instead of #ifdef for wlroots config data
This prevents some annoying issues when e.g. not including wlr/config.h or
making a typo in the guard name.
2018-11-12 10:12:46 +01:00
nyorain
b4d46aa9c2 Use sd_bus_get_property_trivial & remove numbering 2018-10-04 14:04:06 +02:00
nyorain
7b52388424 Rework session handling
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).
2018-09-24 23:35:09 +02:00
emersion
07ea98dab9 backend/session: add assertions 2018-09-18 11:06:01 +02:00
Drew DeVault
4b096fc114 Revert "Merge pull request #1153 from emersion/include-config"
This reverts commit ef0a6ea4d2, reversing
changes made to 8d03bc9178.
2018-07-21 09:44:20 -04:00
emersion
41094a7df5 Always include config.h 2018-07-21 13:08:23 +01:00
emersion
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Vincent Vanlaer
ece58514b4 Close fd's obtained from logind 2018-07-01 02:22:57 +02:00
Scott Anderson
47985d2dc5 Multiseat fixes 2018-06-14 20:46:16 +12:00
emersion
c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion
36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion
5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
Johannes Schramm
e37ebf6869 style: add comment to empty while loop in logind.c 2018-01-21 17:00:15 +01:00
Johannes Schramm
dcc743047b style: include brackets for if/while/for, even if it's a single statement 2018-01-21 16:28:21 +01:00
PoroCYon
7574e27c6a fix build without systemd 2018-01-02 16:39:58 +01:00
Björn Esser
ff13849624
config: Avoid clash with other config-headers 2017-12-27 17:13:58 +01:00
Björn Esser
57a09c8ca4
config: Put all defines into config.h 2017-12-26 18:51:27 +01:00
n3rdopolis
8a2d54c24a
Fix style and string comparison 2017-12-02 12:37:28 -05:00
n3rdopolis
a8d8a63fe0
Attempt to fix #454
With logind, only seat0 can use TTYs
2017-12-02 10:50:00 -05:00
Stefano Ragni
f092a37955 Fix typos 2017-11-11 00:45:52 +01:00
dudemanguy
175f89f4ff Add elogind support
Resolves SirCmpwn/wlroots#146
2017-09-22 12:02:55 -05:00
Scott Anderson
d16b2977f6 Remove single GPU assumptions from wlr_session 2017-08-26 14:50:16 +12:00
Scott Anderson
fb93628bda Merge wlr_udev into wlr_session 2017-08-26 14:02:04 +12:00
Scott Anderson
46823152ea Rename functions to be consistent with #93 2017-08-26 11:56:43 +12:00
Scott Anderson
cb4d50e22c Changed header paths. 2017-08-06 13:25:26 +12:00
Scott Anderson
2ae5cd6539 Moved session/ into backend/ 2017-08-06 13:25:26 +12:00
Renamed from session/logind.c (Browse further)