Bug 377122

Summary: kwallet cannot ask for GPG password on wayland
Product: [Plasma] plasmashell Reporter: Luiz Angelo De Luca <luizluca>
Component: generic-waylandAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: major CC: ashmikuz, dziltener, fabian, i, kde, kdelibs-bugs, marius, rewarp, simonandric5
Priority: NOR Keywords: wayland
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Luiz Angelo De Luca 2017-03-02 18:10:50 UTC
Hello,

When testing wayland, kwallet keeps telling me that an error happened when it tried to decrypt my wallet. It just never asked me the password.
Comment 1 Guo Yunhe 2017-03-09 19:08:14 UTC
Same issue here. When enter desktop, kwalletd keeps popping up a warning saying cannot open wallet with GPG.

openSUSE Tumbleweed 20170308 64bit
Plasma 5.9.2
Frameworks 5.31.0
Qt 5.7.1
Wayland 
Kernel 4.10.1
Comment 2 Rewarp 2017-06-06 07:41:40 UTC
Just dropping by to say that as of openSUSE Tumbleweed build 20170602, kwallet with GPG still does not work.
Comment 3 Marius Orcsik 2017-09-14 14:27:47 UTC
Same on Archlinux with kwallet 5.38.0 and gnupg 2.2.0.

I'm not sure how to start debugging this issue. 

Any KDE dev can add some pointers?
Comment 4 Daniel Ziltener 2017-12-25 11:47:28 UTC
Well, it seems like I'm definitely not the only one with that problem :)
Comment 5 Fabian Vogt 2018-01-01 17:34:45 UTC
Found the issue: pinentry-qt has broken behaviour.

It checks whether DISPLAY is set in the environment and if it is not, uses a text-based prompt. This is a bug in pinentry (also affects the gnome backend, btw.), which I reported now: https://dev.gnupg.org/T3659

However, this points to a second bug: $DISPLAY is not set in the dbus environment. This is because dbus-update-activation-environment is called before kwin_wayland is started.
AFAICT this call should be moved from startplasmacompositor to startplasma to fix that.

Workaround: run dbus-update-activation-environment --all before the wallet gets opened.
Comment 6 David Edmundson 2018-01-02 12:21:45 UTC
>AFAICT this call should be moved from startplasmacompositor to startplasma to fix that.

If you *moved* that call we'd need to be absolutely sure that kwin doesn't make any DBus calls before startplasma has finished processing that.

Given kwin calls kactivitymanagerd, that's not easy to do safely.

Doing it twice would work though.
Comment 7 Fabian Vogt 2018-01-02 12:39:44 UTC
(In reply to David Edmundson from comment #6)
> >AFAICT this call should be moved from startplasmacompositor to startplasma to fix that.
> 
> If you *moved* that call we'd need to be absolutely sure that kwin doesn't
> make any DBus calls before startplasma has finished processing that.
> 
> Given kwin calls kactivitymanagerd, that's not easy to do safely.
> 
> Doing it twice would work though.

Seems to work fine though, kactivitymanagerd's environ is complete with https://phabricator.kde.org/D9597
Comment 8 Fabian Vogt 2018-01-02 17:06:05 UTC
Git commit 32932b44e6f0f3ed6cbf68490d6a8c28da79cdb4 by Fabian Vogt.
Committed on 02/01/2018 at 17:05.
Pushed by fvogt into branch 'master'.

Move calls depending on $DISPLAY from startplasmacompositor to startplasma

Summary:
Xwayland is only available within startplasma, so only call xprop in
startplasma.
Additionally, the environment isn't complete within startplasmacompositor,
as $DISPLAY needs to be exported to the activation environment as well.

Test Plan: pinentry-qt works now when started from gpg-agent.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: graesslin, davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9597

M  +12   -0    startkde/startplasma.cmake
M  +2    -3    startkde/startplasmacompositor.cmake

https://commits.kde.org/plasma-workspace/32932b44e6f0f3ed6cbf68490d6a8c28da79cdb4