Commit Graph

1610 Commits

Author SHA1 Message Date
Fabian Vogt
cb5c07b4c5 Redesign Xauth handling
This commit moves Xauthority handling over to libXau.
Advantage is that this allows use of FamilyWild, is faster, more reliable
and easier to read. However, we lose the ability to merge the new cookie into
an existing Xauthority file, so support for using a non-temporary file is
dropped. Even if merging was implemented manually, use of FamilyWild would
"infect" such a file and break it for DMs which don't write it.

Co-authored-by: Matt Jolly <Matt.Jolly@footclan.ninja>
2023-02-08 08:12:21 +01:00
Fabian Vogt
1198395c9f Minor message handler refactoring 2023-02-07 17:27:29 +01:00
Fabian Vogt
a31059e5e8 Write logging messages to stderr if connected to a tty
standardLogger was missing a check like in journaldLogger, which caused that
it logged to the file in all cases.

Also log to stderr, that's what it's meant for. Check for a tty on stderr
instead of stdin to match that, to also make it work in processes without
forwarded stdin.
2023-02-07 17:27:29 +01:00
Fabian Vogt
25d0aa2313 Run make test in .github/workflows/build.yml 2023-02-07 17:16:05 +01:00
Fabian Vogt
fdaecbb21d Add QMLThemeConfigTest
Using Qt Quick Test with a .cpp part for setup and a .qml part for test code.
2023-02-07 17:16:05 +01:00
Fabian Vogt
14623cf5a8 ThemeConfig: Provide typed accessors to values
Some methods are added to interpret theme.conf settings as bool, int, real and
string explicitly. Previously, most basic types were returned as string and
needed manual handling in QML code.

To allow exporting those methods to QML, it was necessary to port the class
from QVariantMap over to QQmlPropertyMap. A single method had to be added
to make it API compatible with the rest of the code.

Small breaking change: This returns more members when used with Object.keys,
e.g. the added methods and QObject's objectName.

Fixes #1097
2023-02-07 17:16:05 +01:00
Fabian Vogt
c42bb38036 Remove guessing of XDG_RUNTIME_DIR
It's already set properly at that point.
2023-02-07 15:48:35 +01:00
Fabian Vogt
58d5c25691 Quit greeter on SIGINT
Very useful especailly in test mode.
2023-02-06 14:04:47 +01:00
Fabian Vogt
de12bb4f0e Fix list format in sddm.conf man page 2023-02-06 13:29:55 +01:00
Fabian Vogt
a0066e4d17 Remove dead code in helpers 2023-02-06 12:08:37 +00:00
Andrey Butirsky
eaf7c51ddc fixup! Search XDG Base Directories for session files 2023-02-04 23:13:02 +01:00
Andrey Butirsky
883787f2dc Search XDG Base Directories for session files
"SessionDir" config entries are now a lists with default values:
"/usr/local/share/xsessions,/usr/share/xsessions" for [X11] section and
"/usr/local/share/wayland-sessions,/usr/share/wayland-sessions" for
[Wayland] section.
2023-02-04 21:57:30 +01:00
Fabian Vogt
7df16ceeb7 Don't install the unconfigured version of LayoutBox.qml twice
It installs the source LayoutBox.qml and also the configured version of
LayoutBox.qml
2023-02-03 13:51:55 +01:00
Fabian Vogt
46e1357b24 Avoid bogus Loading theme configuration from "" message 2023-02-03 13:51:55 +01:00
Fabian Vogt
9896dea103 Avoid bogus "Malformed entry" warnings if X-SDDM-Env not present or empty
Just skip empty parts.
2023-02-02 17:24:54 +01:00
Aleix Pol
3ee57e9983 Fix user switching
Make sure we don't start a new session if we are switching.
Update the terminalId (i.e. tty) Display property as we switch from the
greeter to the actual session, as they might be on different terminals now.

If we are reusing a session, also remember to switch to that session's tty.
This way we do not switch to a random open session. It's common to have 2
at most but we better fix it properly than hope our users have a predictable
workflow.
2023-02-01 19:57:01 +01:00
Christoph Pleger
b042f69ff3 Added localization of session names to Session.cpp 2023-02-01 18:29:46 +01:00
Aleix Pol
0ff45c0f83 Introduce SDDM_INITIAL_VT as the TTY to reach out to
We were telling sddm to hold onto tty1, this allows us to configure a
different tty.
2023-02-01 15:13:09 +01:00
Aleix Pol
192a11a476 Allow recovering from tty switching failures
If we fail to switch tty when showing the greeter, exit saying so then
switch back to tty 1 and try launching the Display again.

Fixes #1636
2023-02-01 15:13:09 +01:00
Gleb Popov
2d7f1f735f Get rid of FreeBSD-specific implementation of VirtualTerminal.
Original patch by Jessica Clarke @jrtc27
2023-01-30 15:35:53 +01:00
Aleksei Bavshin
c9272e62cb WaylandHelper: support non-default display names
Weston v10[1] and some wlroots-based compositors[2][3] decided to stop
using `wayland-0`.
Extend WaylandSocketWatcher to look for any socket matching the
`wayland-?` pattern and pass the `WAYLAND_DISPLAY` to the greeter.

[1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/486
[2]: 65a751a21f
[3]: 4ee4f3f259
2023-01-30 15:20:34 +01:00
Aleix Pol
3e486499b9 Remove debug line I didn't mean to send 2022-11-23 17:08:24 +00:00
Aleix Pol
ebe6110bd2 Provide a fallback mechanism for failed sessions
If a session fails to load, we go into the greeter.
If the greeter fails to load, we are in trouble.
This change adds a fallback into launch the greeter in a x11-user setup
in case that happens as a failsafe.
2022-11-17 13:57:26 +00:00
Daniele Basso
308e8a88f7
Update CI
* Use Github image (downgrade to Ubuntu 22.04)
* Update checkout actions
* Use sudo for privileged actions
* Fix workflow
* Update build.yml

Co-authored-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2022-11-17 13:00:56 +01:00
Gleb Popov
b1d8e3067b Remove unused Linux-specific include. 2022-11-17 01:32:21 +01:00
Aleix Pol
e24082ff4a Use a generic ubuntu image for the CI 2022-11-15 09:38:57 +01:00
Jeremy Linton
9a5c0eec69 greeter: Do not populate Wayland sessions if /dev/dri does not exist
Check for /dev/dri which should indicate that the Wayland will work
on this hardware.

References:
* https://bugzilla.redhat.com/1952431
* https://bugzilla.redhat.com/2016788
* https://bugzilla.redhat.com/2016310

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2022-11-15 00:37:26 +01:00
Reverier-Xu
1d156897ab fix SocketServer signal delays
caused by QLocalSocket sticky package.
2022-11-14 15:11:39 +01:00
Aleix Pol
3277ce8e0d Allow using org.freedesktop.locale1 to switch keyboard layouts on wayland 2022-11-11 17:09:00 +01:00
Aleix Pol
8858a39f8c Improve list of keyboard layouts on wayland
A more meaningful list of keyboard layouts, with human-readable texts
(in English for now).
2022-11-11 17:09:00 +01:00
Harald Sitter
fc24321541 disable automatic portal launching
in Qt6 (and the KDE patch collection for Qt 5) genericunixservices will
internally attempt to probe the portal tech early on in the app life
cycle. this causes the protal system to launch app and then crash
because we aren't actually providing a fully functional session. instead
opt out of this altogether
2022-10-25 08:06:10 +02:00
Pier Luigi Fiorini
497fe40ff5
Update build.yml
Update actions/checkout version.
2022-10-25 08:04:49 +02:00
Aleix Pol
21e965aab8
Display: Do not offer a tty if it's already taken by a logind session
Otherwise, it all freezes and nothing works as it should.

Fixes #1588
2022-09-21 15:15:07 +02:00
hexchain
a16f612e34
Reformat sddm.pam 2022-09-21 06:25:29 +02:00
Aleix Pol
85d9d3e375 MessageHandler: Also use journald if the process is run by sddm
This way we don't end up in the awkward position of having to fish for
the logs somewhere in /var
2022-09-21 06:24:42 +02:00
Aleix Pol
5892180c24 Auth: Do not stop processes that were never started
It blocks the process unnecessarily
2022-09-20 16:34:54 +02:00
Aleix Pol
4913a3ee51 StartWaylandHelper: Remember to quit the app upon SIGTERM
Quit the app if we receive a sigterm signal, like we do when restarting
SDDM.
2022-09-20 16:34:54 +02:00
Aleix Pol
dbf96e50ea SignalHandler should happen after QCoreApplication
Otherwise it refuses to work
2022-09-20 16:34:54 +02:00
Aleix Pol
149ab51a76 UserSession: Do not emit finished twice
On the other if branch, it will be called when waitForFinished finishes.
2022-09-20 16:14:49 +02:00
Aleix Pol
b7065ce18e UserSession: Use setProgram and setArguments
It makes the debug output later on more informed as the QProcess knows
what it's running.
2022-09-20 16:14:49 +02:00
Aleix Pol
32b67111a4 The X11 helper should not claim to be the Wayland helper 2022-09-20 16:14:49 +02:00
Aleix Pol
733425861f Remove unnecessary casts 2022-09-20 16:14:49 +02:00
Aleix Pol
6579a7d9d6 Properly convert an integer into a string 2022-09-20 16:14:49 +02:00
Aleix Pol i Gonzalez
02801666f7 HelperStartWayland: Do not start the greeter if the compositor failed
It's always better to error out early, so we can better see what is
going wrong.
2022-09-14 16:21:38 +02:00
Aleix Pol i Gonzalez
1bbf4e1061 Greeter: Do not install a message handler when on test mode
It's useful to see the output right on the stdout when using --test-mode
2022-09-14 16:21:38 +02:00
Aleix Pol
edf55fbb94 CI: Use KDE's CI images
The current ones seem to be out of date and these we need to maintain
anyway for many other projects.
2022-09-14 15:06:20 +02:00
Aleix Pol
6c313bba81 Fix CI, seems like SUSE changed the names of their packages 2022-09-13 19:12:49 +01:00
Aleix Pol
53c247cc24 Remove link to Travis CI
It doesn't exist anymore.
2022-09-13 09:25:31 +02:00
NorwayFun
f31a3cd513 po: add Georgian translation
po: add Georgian
2022-09-12 21:22:32 +01:00
NorwayFun
e824830f45 po: add Georgian 2022-09-12 21:22:32 +01:00