Commit Graph

1610 Commits

Author SHA1 Message Date
Fabian Vogt
4a9aa2e003 If autologin is used, avoid starting a display server for the greeter
Introduce a new "early autologin" path that starts the session without
starting the display server first. This avoids starting a rootful X just
to then ignore it and start a Wayland session in a separate VT.
2024-11-08 11:12:22 +01:00
Fabian Vogt
7baf8420d2 Reset daemonApp->first in the Display constructor
Simplifies the code and makes really sure that only the first display has
this set.
2024-11-08 11:12:22 +01:00
Fabian Vogt
50e4124799 Load autologin configuration in Display::Display
Makes m_autologinSession more easily available and simplifies runtime
handling.
2024-11-08 11:12:22 +01:00
Fabian Vogt
7b3fd9c798 Set Display::m_started early
It's only read to check whether start() and stop() should do anything,
so set it true as soon as it attempted to start anything.
2024-11-08 11:12:22 +01:00
Fabian Vogt
352878a7f9 Remove unused Display::m_relogin variable 2024-11-08 11:12:22 +01:00
YaoBing Xiao
b96d323f79 xcb: use xcb_connection_has_error to check for failue
xcb_connect() always returns a non-NULL pointer to a
xcb_connection_t, even on failure.

Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
2024-10-27 11:35:41 +01:00
rparkins999
942e173cc2 Fix for issue Suspicious code in PamHandle::end #1990 2024-10-15 10:20:28 +02:00
Fabian Vogt
4ec29a8bba CI: Drop building with clang on CentOS Stream9
Clazy is reproducibly broken, it crashes immediately.
2024-07-23 18:52:27 +02:00
Fabian Vogt
98a6b3c8a9 CI: Fix order of arguments for dnf
Should fix installing dependencies for Fedora rawhide builds.
2024-07-23 18:52:27 +02:00
walken
b6b6c7c391 Update Czech translations 2024-07-16 20:23:52 +02:00
Mohammad Bahoosh
07fe2c290f Add translation for Persian 2024-07-16 20:16:45 +02:00
Fabian Vogt
d89a1f2dbc Use xrdb to set Xcursor.theme and Xcursor.size
Qt 6 switched to xcb-util-cursor which unlike libXcursor does not read
$XCURSOR_THEME and $XCURSOR_SIZE.
2024-07-13 19:13:11 +02:00
Peter
b704e2ee35
Introduce utmps support (#1962)
utmps library can be used to provide utmp functionality on systems whose
libcs do not implement it, e.g. musl.

For more details, see https://skarnet.org/software/utmps/.

Signed-off-by: Peter Shkenev <petershh@disroot.org>
2024-07-11 19:55:24 +02:00
nerdopolis
5c7af4e5c0 Switch back to greeter when logind emits SecureAttentionKey 2024-07-09 09:11:56 +02:00
nerdopolis
dadf4e0eaa Prevent the greeter display server from hanging if SwitchToGreeter() is sent to a seat when the greeter is already active 2024-07-09 09:11:56 +02:00
Emil Velikov
ae072f9016 cmake: remove the final (Arch) PAM modules
PAM modules are distribution specific and are ultimately better fit in
the distribution packaging.

Having them in SDDM brings extra burden to the already stretched
developers and maintainers. Plus a handful of distributions currently
patch the (Arch) PAM modules, where having the full set in their own
tree would make for cleaner solution.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2024-03-04 14:25:57 +01:00
Emil Velikov
d4afb9069b cmake: drop Debian specific PAM modules
Having a per-distribution set in the upstream project (sddm) does not
scale well. Instead sddm can provide a default set that distributions
can opt out of with "cmake -DINSTALL_PAM_CONFIGURATION=off ..."
2024-03-04 14:25:57 +01:00
Emil Velikov
b82f9be9cb cmake: drop FreeBSD specific PAM modules
Having a per-distribution set in the upstream project (sddm) does not
scale well. Instead sddm can provide a default set that distributions
can opt out of with "cmake -DINSTALL_PAM_CONFIGURATION=off ..."

Glancing through the FreeBSD ports - all the pam modules are patched
already, so dropping them from here should reduce maintenance on both
sides.
2024-03-04 14:25:57 +01:00
Aleksei Bavshin
cc03fabf2f Docs: add QtVersion information to THEMING 2024-02-27 16:35:55 +01:00
Aleksei Bavshin
b5fd7ecedf Themes: set QtVersion=@QT_MAJOR_VERSION@ 2024-02-27 16:35:55 +01:00
Aleksei Bavshin
82af253421 Themes: fix deprecated signal handler declarations
Fixes following warnings:
```
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
Parameter "event" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.
```
2024-02-27 16:35:55 +01:00
Aleksei Bavshin
391baf22f5 Components: use Transitions instead of Behaviors
It's not recommended[^1] to use Behaviors with States, but the specific
examples in SDDM weren't causing any problems previously (on Qt5).

Now, with Qt6 support, we can finally observe the promised bugs from the
referenced article in the wild:

* ComboBox can be closed only once. On a second activation it stays open
* Button color transitions on focus out are abruptly stopped on a wrong
  color
* ... (this is where I noticed a pattern and decided to convert
  everything else preemptively).

This commit essentially reverts 930fa07bf2

[^1]: https://doc.qt.io/qt-5/qtquick-statesanimations-behaviors.html
2024-02-27 16:35:55 +01:00
Aleksei Bavshin
fa65020883 Themes: explicitly resolve image URLs
Qt6 no longer resolves relative URLs on assignment to a property of type
url[^1]. The resolution now happens late, in the context of the item that
uses the URL. In our case, it would be a QML component containing Image.
However, the themes shipped with SDDM contain resources in the theme
directories and rely on the previous algorithm of the URL resolution.

The only documented[^2] way to address that is to resolve the paths in
advance with `Qt.resolvedUrl` to avoid any ambiguity. `Qt.resolvedUrl`
is supported in Qt5, so that should be a safe, albeit a bit verbose,
conversion.

Fixes following error:
```
file:///usr/lib64/qt6/qml/SddmComponents/ComboBox.qml:105:9: QML Image: Cannot open: file:///usr/lib64/qt6/qml/SddmComponents/angle-down.png
```

[^1]: https://doc.qt.io/qt-6/qml-url.html
[^2]: `QQmlAbstractUrlInterceptor` exists in Qt5, but
  `QQmlEngine::setUrlInterceptor` is undocumented and has potential
negative side-effects. It also receives already resolved absolute URLs.
2024-02-27 16:35:55 +01:00
Aleksei Bavshin
8d32f3261e Themes: hide LayoutBox when keyboard model is empty or disabled 2024-02-27 16:35:55 +01:00
Aleksei Bavshin
71b2171f02 Mark keyboard backend as disabled on Wayland
8c370d9 already cleared the list of layouts, but Num/Caps indicators
are also not supported on Wayland. Let's communicate that clearly by
marking the KeyboardModel as disabled.
2024-02-27 16:35:55 +01:00
nerdopolis
abb9f9eea9 UserSession: Only act on the VT when XDG_VTNR is set 2024-02-27 14:47:39 +01:00
nerdopolis
a11f05fc10 Conditionalize more VT related calls 2024-02-27 14:47:39 +01:00
nerdopolis
cda8d936c2 Allow non-root greeters and sessions to start on kernels without VTs 2024-02-27 14:47:39 +01:00
nerdopolis
fbffb57779 VirtualTerminal: Export defaultVtPath 2024-02-27 14:47:39 +01:00
Harald Sitter
63780fcd79 bump to 0.21.0 and start changelog 2024-02-26 11:23:03 +01:00
Neal Gompa
dfc3bdb651 Switch the Wayland greeter default to use Weston's Kiosk shell
Weston introduced the kiosk shell in Weston 9.0 and deprecated the
fullscreen shell in Weston 12.0.
2024-02-22 15:42:02 +01:00
Salif Mehmed
51741bf105 Add Bulgarian translation 2024-02-20 11:43:42 +01:00
rottenpants466
6f7a371a3e Update pt_PT.ts 2024-02-20 11:39:00 +01:00
rottenpants466
1d0fbf7f6f Update pt_BR.ts 2024-02-20 11:39:00 +01:00
Fabian Vogt
115f01b9e1 Let themes specify the used version of Qt
metadata.desktop in the theme directory has a new key "QtVersion" which
defaults to 5. If it's not 5, sddm-greeter-qt${QtVersion} will be used to
show the theme.
2024-02-20 11:35:40 +01:00
Fabian Vogt
27cae1af06 Make sddm-greeter for Qt 5 and Qt 6 coinstallable
When not building for Qt 5, give the sddm-greeter binary a Qt version suffix.
Also version the translation directory.
2024-02-20 11:35:40 +01:00
Emil Velikov
f5e580e865 Simplify /var/log/*tmp handling
Use a simple ternary operator and drop the repeated preprocessor checks.
2024-02-20 11:30:23 +01:00
Fabian Vogt
08ff23432d Fix DBus interface XML syntax
Attribute values must be escaped.

Fixes #1865
2024-02-20 11:28:06 +01:00
Fabian Vogt
896320c24a Try to fix the CI
liri-project/qmllint silently switched to Qt 6 and the status output is also
broken.

Pin it to a specific hash and maybe fix the output by setting the env only
for that job.
2024-02-20 11:25:51 +01:00
Neal Gompa
501129294b cmake: Add option to disable installing PAM files
This is primarily useful for development purposes.
2023-12-28 22:25:05 +01:00
Neal Gompa
d0c7107a69 CI: Install Qt 5 on Fedora when a Qt 5 build is being done
SDDM in Fedora Linux 40+ uses Qt 6, so for the Qt 5 build, we need
to request the Qt 5 packages explicitly.
2023-12-28 22:25:05 +01:00
Rob Wu
b002d02bbe Prevent tmpfiles from removing "old" xauth files
Starting from sddm 0.20 (by https://github.com/sddm/sddm/pull/1230),
the xauth file is at `/tmp/xauth_*` instead of `~/.Xauthority`.
The new location is subject to systemd-tmpfiles's cleanup, which
deletes files from /tmp/ that are older than 10 days:
https://github.com/systemd/systemd/blob/v254/tmpfiles.d/tmp.conf

The xauth file should not be removed while the session is active,
because it is needed for starting X applications. When removed,
X applications won't start any more.

This patch fixes the issue by declaring these files as "ignored"
in sddm-tmpfiles.conf, so that systemd-tmpfiles doesn't remove them.

Minimal test case:

```
touch /tmp/xauth_testonly
SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --prefix=/tmp/ --clean
```

Pre-patch output:
File "/tmp/xauth_testonly": change time Mon 2023-10-02 01:27:38.395466 CEST is too new.

(meaning that the file was considered for removal)

Post-patch output:
Ignoring "/tmp/xauth_testonly": a separate glob exists.

(meaning that the file is ignored and not considered for removal)
2023-12-07 10:51:02 +01:00
sgakerru
132f1051c3 Move autologin fallback (handle auth error) from slotAuthError to slotAuthenticationFinished
There may be a case when pam authentication error not only of the `auth` type, but also, for example, of the `session` type fall into the `slotAuthError` during autologin. For example, a pam module error in the file `/etc/pam.d/postlogin` already during the loaded session. As a result, a fallback (`handleAutologinFailure`) is triggered that loads greeter (sddm-theme) already on top of the loaded session, which leads to unpleasant consequences.

In my opinion, this is incorrect, and I think it's worth transferring the fallback to the `slotAuthenticationFinished` method and calling fallback if `success` = false, then the fallback will trigger exactly when an error of the `auth` type occurred, i.e. when the session really wasn't loaded and the greeter should be loaded to avoid black screen with only cursor.
2023-11-13 19:25:48 +01:00
Alessandro Astone
8c370d97c1 Don't populate list of keyboard layouts in the wayland greeter
Layout switching is not implemented. We should keep the list of
layouts empty so that themes can know to not show the option to
change layout
2023-09-19 13:55:36 +02:00
Fabian Vogt
93429ffec5 Drop unnecessary ECM dependency and dead uninstall target
ECM was added by 6ef91b0b because of some potential dependency needed for
Wayland, which was not added until now.

The commit also changed the "uninstall" target to not be created if
ECM >= 1.7.0. ECM itself doesn't register an uninstall target automatically
either, which means this is dead code. Just remove it.
2023-09-14 20:41:13 +02:00
Stepan Zubkov
afc3d2de0f Add count property to SessionModel. 2023-08-29 08:15:06 +02:00
SgAkErRu
a8e40c5d70
Handle autologin auth attempt errors (#1775)
If the autologin auth attempt failed for any reason, then start socket server and greeter (launch sddm theme, like as if there was no autologin at all).
2023-08-20 11:39:19 +02:00
Ilya Fedin
9e7791d5fb Let GreeterEnvironment option take the precedence over PAM environment 2023-08-02 09:58:03 +02:00
Gleb Popov
c813b2f56c Add and install PAM services for FreeBSD.
Sponsored by:	Serenity Cybersecurity, LLC
2023-07-31 09:42:02 +02:00
Gioele Barabucci
0823810ed1 CMakeLists.txt: Install dbus policy in /usr/share, not /etc
From https://bugs.debian.org/1006631:

> dbus supports policy files in both `/usr/share/dbus-1/system.d` and
> `/etc/dbus-1/systemd`. [The] recently released dbus 1.14.0, officially
> deprecates installing packages' default policies into `/etc/dbus-1/systemd`,
> instead reserving it for the sysadmin. This is the same idea as the
> difference between `/usr/lib/udev/rules.d` and `/etc/udev/rules.d`.
2023-07-27 13:58:31 +02:00