Bug 432625 - KWin does not set up Xauthority socket in the Plasma Wayland session, breaking Anaconda
Summary: KWin does not set up Xauthority socket in the Plasma Wayland session, breakin...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.20.90
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL: https://bugzilla.redhat.com/show_bug....
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-07 22:31 UTC by Neal Gompa
Modified: 2021-02-08 22:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neal Gompa 2021-02-07 22:31:24 UTC
SUMMARY
When using the Plasma Wayland session, there is no Xauthority socket configured for Xwayland, which makes some X11 applications not function unless "xhost +" is used first. In particular, this seems to stop Anaconda (the Fedora installer) from working entirely.

STEPS TO REPRODUCE
1. Download Fedora KDE Live nightly snapshot: https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20210207.n.0/compose/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-Rawhide-20210207.n.0.iso
2. Open Konsole
3. Run "liveinst"

OBSERVED RESULT
Anaconda will crash with a GTK error saying it can't be initialized.

EXPECTED RESULT
Anaconda starts and can install Fedora.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 34 (KDE Plasma)
(available in About System)
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.78
Qt Version: 5.15.5

ADDITIONAL INFORMATION
This was originally reported in Red Hat bug 1921947: https://bugzilla.redhat.com/show_bug.cgi?id=1921947

Nightlies can be looked up and downloaded from: https://openqa.fedoraproject.org/nightlies.html
Comment 1 Rex Dieter 2021-02-08 01:24:17 UTC
sddm may be related too,
https://github.com/sddm/sddm/blob/develop/src/helper/UserSession.cpp#L263

appears to purposely set XAUTHORITY only for X11 sesions.
Comment 2 Neal Gompa 2021-02-08 12:15:54 UTC
Using GDM+Plasma doesn't solve the problem (and this works in GNOME), so I do not think that SDDM is where this needs to be fixed.
Comment 3 Bug Janitor Service 2021-02-08 14:01:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/665
Comment 4 Neal Gompa 2021-02-08 18:29:52 UTC
The MR fixes the issue for me in Fedora, and I've cherry-picked it to our kwin package[1].

It'd be great if this was included in kwin 5.21 final release, so we don't have to maintain the patch. :)


[1]: https://src.fedoraproject.org/rpms/kwin/c/f6befa54b9a3202eca123f10e53b6c19d21f0959?branch=rawhide
Comment 5 Vlad Zahorodnii 2021-02-08 22:18:49 UTC
Git commit 335d9c41925d9463a52f59ff61e7be6a84cae8c3 by Vlad Zahorodnii.
Committed on 08/02/2021 at 22:14.
Pushed by vladz into branch 'master'.

xwayland: Generate Xauthority file

This allows running Xwayland apps as root. Xwayland started with an
empty Xauthority file. After kwin has received the display number, the
file is updated with an actual authority entry.

M  +1    -0    autotests/integration/kwin_wayland_test.cpp
M  +1    -0    main_wayland.cpp
M  +89   -14   xwl/xwayland.cpp
M  +7    -2    xwl/xwayland.h

https://invent.kde.org/plasma/kwin/commit/335d9c41925d9463a52f59ff61e7be6a84cae8c3
Comment 6 Vlad Zahorodnii 2021-02-08 22:19:46 UTC
Git commit 80ff37862c9d41b2ac0cfb51f87aa5b9ea63dfdb by Vlad Zahorodnii.
Committed on 08/02/2021 at 22:19.
Pushed by vladz into branch 'Plasma/5.21'.

xwayland: Generate Xauthority file

This allows running Xwayland apps as root. Xwayland started with an
empty Xauthority file. After kwin has received the display number, the
file is updated with an actual authority entry.


(cherry picked from commit 335d9c41925d9463a52f59ff61e7be6a84cae8c3)

M  +1    -0    autotests/integration/kwin_wayland_test.cpp
M  +1    -0    main_wayland.cpp
M  +89   -14   xwl/xwayland.cpp
M  +7    -2    xwl/xwayland.h

https://invent.kde.org/plasma/kwin/commit/80ff37862c9d41b2ac0cfb51f87aa5b9ea63dfdb