New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Greeter on Wayland - rebased #1393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the branch contains commits that we don't want anymore.
i would have applied the patch on top of the new develop
instead of rebasing it.
src/daemon/Display.cpp
Outdated
status == Auth::HELPER_OTHER_ERROR) | ||
stop(); | ||
else | ||
VirtualTerminal::jumpToVt(m_terminalId, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we decided not to stop the greeter
@@ -224,6 +248,7 @@ namespace SDDM { | |||
qCritical() << "setgid(" << pw.pw_gid << ") failed for user: " << username; | |||
exit(Auth::HELPER_OTHER_ERROR); | |||
} | |||
qputenv("XDG_RUNTIME_DIR", QByteArrayLiteral("/run/user/") + QByteArray::number(pw.pw_uid)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For WaylandSocketWatcher to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks not great. Either something like pam_systemd
creates it and it can be used or sddm has to create its own and use that path. Just guessing that it will be /run/user/<uid>
smells like a hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pam_systemd does create it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, but then it should only be used in the context that $XDG_RUNTIME_DIR
is actually set in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In FreeBSD for instance (or with ConsoleKit in general, not sure), XDG_RUNTIME_DIR
is actually set up by the session scripts and somewhere below /tmp
IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On FreeBSD both consolekit2
(upstream + downstream) and pam_xdg
(downstream) use /var/run/user/<uid>
, hardcoded at build-time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. If something else (e.g. pam_systemd) created XDG_RUNTIME_DIR, then you must READ the environment variable XDG_RUNTIME_DIR to find out its value. Or maybe there is a d-bus interface to ask for it if this is not your current session, I don't know. It would be incorrect to guess what the value might be and set XDG_RUNTIME_DIR to that guessed value.
process, [](int exitCode, QProcess::ExitStatus exitStatus) { | ||
qDebug() << "wayland compositor finished" << exitCode << exitStatus; | ||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) | ||
QCoreApplication::instance()->quit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will quit the helper, we don't want this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is copied from XOrgUserHelper::startProcess
.
I guess we'll need to include a start failed signal.
Ultimately we'll need quitting anyway. If the compositor (wayland or xorg) can't be started.
void WaylandHelper::switchVt() | ||
{ | ||
int vtNumber = m_environment.value(QStringLiteral("XDG_VTNR")).toInt(); | ||
VirtualTerminal::jumpToVt(vtNumber, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think UserSession already do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to bring back the WaylandSocketWatcher because we need to wait for the compositor to start before we can start the sddm-greeter.
An alternative implementation would be to have the sddm-greeter block at start until the compositor appears.
6398077
to
73e68df
Compare
Ping? |
1 similar comment
Ping? |
It would have really great if this feature landed before Plasma 5.23. |
6a9c2aa
to
d180acd
Compare
Introduce a new display server option to run the greeter with. In the future this will be the default display server. This patch contains the most important parts to get the greeter running on Wayland, but it's not possible to select a keyboard layout. At the moment the Wayland socket is assumed to be "wayland-0" but in a multi-seat configuration we would have more than one greeter running, each with a diffent socket and the assumption won't work anymore. In the future we will figure out how to do, after all at the moment this is considered enough for most people. Closes: #440
Includes a GreeterEnvironment configuration entry.
d180acd
to
e1c7202
Compare
Added a couple of environment variables for fullscreen-shell and disable window decoration, then rebased on top of the latest develop. I will give it one more last test later this evening and merge if it works fine. |
Thanks! |
Waylanded SDDM really sucks on mulit-monitor setups, because it’s not cloned across displays, and menu items appeared on internal(closed laptop lid) display, than I’ve been clicking (so it was impossible to change Session for me). It uses Weston by default, and from my research Weston doesn’t support clone-mode-by-default (ass application argument). |
Yes, that's what the CompositorCommand setting is for. |
I know. But for now sddm with wayland is downgrade to sddm on X11 on
multimonitor setups.
I wanted to point that IMHO SDDM should choose other compositor for
wayland as default.
I've simply went back to X11 setup. But SDDM should definitely work
with multi-monitor setups. And while strict multimonitor setups are in
decline, due to widescreens larger displays becoming cheaper, every
laptop with external monitor acts as multi-monitor setup (because
while I've set internal display as disabled, I must go trough SDDM for
it).
Also SDDM should work out-of-the-box on as many configurations as
possible, and mine laptop+ext. screen is not so exotic. So I think the
current state of SDDM+weston mariage (in wayland mode) is not
acceptable (I know that X11 is default, but I guess that with current
pro-wyaland trend, you want to change that as quickly as possible)
cheers,
Krzysztof Krakowia
…On 6/22/21, Aleix Pol ***@***.***> wrote:
> Maybe other Wayland compositor(than weston) could do that?
Yes, that's what the CompositorCommand setting is for.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1393 (comment)
|
Was there a discussion somewhere on how you ended up choosing to use Weston's fullscreen-shell protocol extension? I see that you are planning to run on more than Weston, which I think is a good idea, and I suppose it also means the greeter works on the xdg-shell family of protocol extensions, not just fullscreen-shell. As for the clone mode, you could have the greeter set up similar windows on all outputs. That does not need clone mode support from Weston, and it will fit diverse monitors much much better than a clone mode because a) resolution aware text rendering instead of raster scaling, and b) you can fit the UI layout to the available screen estate on each monitor. At Weston upstream, we had kind of abandoned the fullscreen-shell, but now that it actually has a use case, I wonder what to do. Maybe we should open a Weston issue about the future of the fullscreen-shell? Weston has also kiosk shell plugin which seems more promising going forward and exposes the xdg-shell family of protocol extensions. |
No, I just wanted something that didn't involve a panel but it's temporary.
The greeter should work very well with xdg-shell.
I need to investigate what's going on here: SDDM creates a window for each screen that is reported by Qt therefore there is no clone mode here as opposed to X11. This should actually be very good for the use case of @isopix but my guess is that Weston still reports the laptop output even though the lid is closed and that's why the greeter goes into that output.
At the time there was no kiosk shell, so the fullscreen-shell was the best way to get something without a panel. |
Released Qt presents a challenge QWindow::setFullscreen() on XDG calls xdg_toplevel.set_fullscreen(null). So on a multi-screen setup you don't know where the window will end up. Qt's fullscreen-shell did forward the screen. XDGShell implementation is changed in Qt6 and in KDE's Qt backports. |
Oh I forgot about that
Yeah I remember I did get that right when I wrote the shell integration plugin :)
Do you know if distros are using the KDE's Qt backports? |
Thanks! I would assume that Weston does not handle the laptop lid switch at all, so probably the internal panel does not even turn off, unless it also appears disconnected from KMS perspective. |
I think Arch does: https://archlinux.org/packages/extra/x86_64/qt5-base/ |
On /29/21, Pier Luigi Fiorini ***@***.***> wrote:
I need to investigate what's going on here: SDDM creates a window for each
screen that is reported by Qt therefore there is no clone mode here as
opposed to X11. This should actually be very good for the use case of
@isopix but my guess is that Weston still reports the laptop output even
though the lid is closed and that's why the greeter goes into that output.
I havem't investigated it rurther, nor I've opened laptop lid. Simply
decided this setup is broken, switched to X11 backend and posted there
SSDM started in wayland mode on external screen, but dialogs (like
session/language/keyboard selection) haven't appeared on this display
(not sure about internal one). I was able to login, but not to use
stuff that required 'menus' (that starts as external windows/dialogs)
|
Rebased version of #1379
Had to be creative in some places since it changed quite a bit.