ZaWertun / fedora-copr-kde5

https://copr.fedorainfracloud.org/coprs/zawertun/kde/
18 stars 4 forks source link

Non-KDE applications use GTK4 file dialogs #142

Open popov895 opened 2 years ago

popov895 commented 2 years ago

Looks like xdg-desktop-portal-kde is broken because a lot of things don't work:

Also there are some errors in system log related to xdg-desktop-portal-kde:

$ journalctl -b 0 | grep xdg-desktop-portal-kde
sep 30 12:38:56 fedora xdg-desktop-portal-kde[1329]: qt.qpa.xcb: could not connect to display
sep 30 12:38:56 fedora audit[1329]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1329 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1
sep 30 12:38:56 fedora xdg-desktop-portal-kde[1329]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
sep 30 12:38:56 fedora xdg-desktop-portal-kde[1329]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                                #9  0x00005639d5c71ad3 main (xdg-desktop-portal-kde + 0x23ad3)
                                                #12 0x00005639d5c72ea5 _start (xdg-desktop-portal-kde + 0x24ea5)
sep 30 12:38:56 fedora systemd[1274]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT
sep 30 12:38:56 fedora systemd[1274]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'.
sep 30 12:38:56 fedora systemd[1274]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE.
ZaWertun commented 2 years ago

Looks like this bug: https://bugs.kde.org/show_bug.cgi?id=458865 And there is a patch: https://invent.kde.org/plasma/plasma-workspace/-/commit/8817cce67ed039a538936d0041d33387a40dd1c6

I'll try to apply and try if it helps.

ZaWertun commented 2 years ago

Patch didn't help at all... For me current working solution is restarting xdg-desktop-portal-kde by hands after logging in plasma session:

systemctl --user restart plasma-xdg-desktop-portal-kde.service
ZaWertun commented 2 years ago

Also it seems like removing this lines from /usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service fixes issue as well:

# Auto restart is off as we are DBus activated
Restart=no

It fails to start about 2 times and finally starts up without errors. It's better than trying to start it once, crash and not to trying to start it again.

ZaWertun commented 2 years ago

Should be fixed in https://copr.fedorainfracloud.org/coprs/zawertun/kde/build/4880519/ It will still crash 1 to n times (up to 4 to me) but eventually it will start without errors. We will wait for proper fix from KDE team.

popov895 commented 2 years ago

The problem is that even if xdg-desktop-portal-kde is running, non-KDE applications (Firefox, Telegram) still use GTK4 file dialogs and don't handle color scheme changes. This behavior appeared after one of the recent updates.

Screenshot_20221001_130849

By the way, I noticed that I have 3 packages installed related to the portal:

$ dnf list installed | grep portal
xdg-desktop-portal.x86_64                            1.12.6-1.fc36                     @updates
xdg-desktop-portal-gnome.x86_64                      42.3-1.fc36                       @updates
xdg-desktop-portal-kde.x86_64                        5.25.5-11.fc36                    @copr:copr.fedorainfracloud.org:zawertun:kde

Moreover, when the xdg-desktop-portal-gnome package is removed, the file dialogs are no longer displayed at all. I don't really understand what this has to do with each other, but something is definitely broken.

ZaWertun commented 2 years ago

TLDR: xdg-desktop-portal-kde service starts to early in plasm X11 session and it cause bug.

Read comments to the issue that I've posted - 458865.

popov895 commented 2 years ago

I'm not sure if this bug is related to mine. Also, I don't see this issue on openSUSE Tumbleweed.

popov895 commented 2 years ago

Just found that non-KDE apps are using the xdg-desktop-portal-gnome instead of the xdg-desktop-portal-kde, so it looks like a configuration issue.

ZaWertun commented 2 years ago

See also: https://bugzilla.redhat.com/show_bug.cgi?id=2129479

Additional info: xdg-desktop-portal-kde didn't crash during boot with Qt 5.15.5 or earlier.

popov895 commented 2 years ago

After the latest update, the problem is gone. List of updated packages:

$ dnf history info 142
Transaction ID : 142
Begin time     : пн, 03-жов-2022 00:41:26 +0300
Begin rpmdb    : 1bf3d85970093907b89faa4a79623cb96b4eb2d90801ad38f606f5d16c136299
End time       : пн, 03-жов-2022 00:41:32 +0300 (6 seconds)
End rpmdb      : 15ffdd6912df72ba6bb721de0e00acb97ce340390d6a0ff142626d4eaa580657
User           :  <toquza>
Return-Code    : Success
Releasever     : 36
Command Line   : upgrade
Comment        :
Packages Altered:
    Upgrade  libkworkspace5-5.25.5-12.fc36.x86_64                    @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded libkworkspace5-5.25.5-11.fc36.x86_64                    @@System
    Upgrade  plasma-lookandfeel-fedora-5.25.5-12.fc36.noarch         @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-lookandfeel-fedora-5.25.5-11.fc36.noarch         @@System
    Upgrade  plasma-workspace-5.25.5-12.fc36.x86_64                  @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-5.25.5-11.fc36.x86_64                  @@System
    Upgrade  plasma-workspace-common-5.25.5-12.fc36.x86_64           @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-common-5.25.5-11.fc36.x86_64           @@System
    Upgrade  plasma-workspace-geolocation-5.25.5-12.fc36.x86_64      @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-geolocation-5.25.5-11.fc36.x86_64      @@System
    Upgrade  plasma-workspace-geolocation-libs-5.25.5-12.fc36.x86_64 @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-geolocation-libs-5.25.5-11.fc36.x86_64 @@System
    Upgrade  plasma-workspace-libs-5.25.5-12.fc36.x86_64             @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-libs-5.25.5-11.fc36.x86_64             @@System
    Upgrade  plasma-workspace-wayland-5.25.5-12.fc36.x86_64          @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-wayland-5.25.5-11.fc36.x86_64          @@System
    Upgrade  plasma-workspace-x11-5.25.5-12.fc36.x86_64              @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-x11-5.25.5-11.fc36.x86_64              @@System
    Upgrade  sddm-breeze-5.25.5-12.fc36.noarch                       @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded sddm-breeze-5.25.5-11.fc36.noarch                       @@System
    Upgrade  sddm-breeze-fedora-5.25.5-12.fc36.noarch                @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded sddm-breeze-fedora-5.25.5-11.fc36.noarch                @@System
ZaWertun commented 2 years ago

After the latest update, the problem is gone. List of updated packages:

$ dnf history info 142
Transaction ID : 142
Begin time     : пн, 03-жов-2022 00:41:26 +0300
Begin rpmdb    : 1bf3d85970093907b89faa4a79623cb96b4eb2d90801ad38f606f5d16c136299
End time       : пн, 03-жов-2022 00:41:32 +0300 (6 seconds)
End rpmdb      : 15ffdd6912df72ba6bb721de0e00acb97ce340390d6a0ff142626d4eaa580657
User           :  <toquza>
Return-Code    : Success
Releasever     : 36
Command Line   : upgrade
Comment        :
Packages Altered:
    Upgrade  libkworkspace5-5.25.5-12.fc36.x86_64                    @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded libkworkspace5-5.25.5-11.fc36.x86_64                    @@System
    Upgrade  plasma-lookandfeel-fedora-5.25.5-12.fc36.noarch         @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-lookandfeel-fedora-5.25.5-11.fc36.noarch         @@System
    Upgrade  plasma-workspace-5.25.5-12.fc36.x86_64                  @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-5.25.5-11.fc36.x86_64                  @@System
    Upgrade  plasma-workspace-common-5.25.5-12.fc36.x86_64           @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-common-5.25.5-11.fc36.x86_64           @@System
    Upgrade  plasma-workspace-geolocation-5.25.5-12.fc36.x86_64      @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-geolocation-5.25.5-11.fc36.x86_64      @@System
    Upgrade  plasma-workspace-geolocation-libs-5.25.5-12.fc36.x86_64 @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-geolocation-libs-5.25.5-11.fc36.x86_64 @@System
    Upgrade  plasma-workspace-libs-5.25.5-12.fc36.x86_64             @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-libs-5.25.5-11.fc36.x86_64             @@System
    Upgrade  plasma-workspace-wayland-5.25.5-12.fc36.x86_64          @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-wayland-5.25.5-11.fc36.x86_64          @@System
    Upgrade  plasma-workspace-x11-5.25.5-12.fc36.x86_64              @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded plasma-workspace-x11-5.25.5-11.fc36.x86_64              @@System
    Upgrade  sddm-breeze-5.25.5-12.fc36.noarch                       @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded sddm-breeze-5.25.5-11.fc36.noarch                       @@System
    Upgrade  sddm-breeze-fedora-5.25.5-12.fc36.noarch                @copr:copr.fedorainfracloud.org:zawertun:kde
    Upgraded sddm-breeze-fedora-5.25.5-11.fc36.noarch                @@System

Could you check again and post output of journalctl -b 0 | grep xdg-desktop-portal-kde?

popov895 commented 2 years ago
Sure. ``` $ journalctl -b 0 | grep xdg-desktop-portal-kde oct 03 17:30:09 fedora systemd[1304]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:09 fedora xdg-desktop-portal-kde[1358]: qt.qpa.xcb: could not connect to display oct 03 17:30:09 fedora audit[1358]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1358 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1 oct 03 17:30:09 fedora xdg-desktop-portal-kde[1358]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. oct 03 17:30:09 fedora xdg-desktop-portal-kde[1358]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. #9 0x000055dcadba3ad3 main (xdg-desktop-portal-kde + 0x23ad3) #12 0x000055dcadba4ea5 _start (xdg-desktop-portal-kde + 0x24ea5) oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:09 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:09 fedora systemd[1304]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:09 fedora xdg-desktop-portal-kde[1398]: qt.qpa.xcb: could not connect to display oct 03 17:30:09 fedora audit[1398]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1398 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1 oct 03 17:30:09 fedora xdg-desktop-portal-kde[1398]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. oct 03 17:30:09 fedora xdg-desktop-portal-kde[1398]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. #9 0x0000564377153ad3 main (xdg-desktop-portal-kde + 0x23ad3) #12 0x0000564377154ea5 _start (xdg-desktop-portal-kde + 0x24ea5) oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:09 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:09 fedora systemd[1304]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:09 fedora xdg-desktop-portal-kde[1410]: qt.qpa.xcb: could not connect to display oct 03 17:30:09 fedora audit[1410]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1410 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1 oct 03 17:30:09 fedora xdg-desktop-portal-kde[1410]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. oct 03 17:30:09 fedora xdg-desktop-portal-kde[1410]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. #9 0x0000561345695ad3 main (xdg-desktop-portal-kde + 0x23ad3) #12 0x0000561345696ea5 _start (xdg-desktop-portal-kde + 0x24ea5) oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT oct 03 17:30:09 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:09 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:09 fedora systemd[1304]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:09 fedora xdg-desktop-portal-kde[1418]: qt.qpa.xcb: could not connect to display oct 03 17:30:09 fedora audit[1418]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1418 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1 oct 03 17:30:09 fedora xdg-desktop-portal-kde[1418]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. oct 03 17:30:09 fedora xdg-desktop-portal-kde[1418]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. #9 0x0000556f4f429ad3 main (xdg-desktop-portal-kde + 0x23ad3) #12 0x0000556f4f42aea5 _start (xdg-desktop-portal-kde + 0x24ea5) oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:10 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:10 fedora systemd[1304]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:10 fedora xdg-desktop-portal-kde[1428]: qt.qpa.xcb: could not connect to display oct 03 17:30:10 fedora audit[1428]: ANOM_ABEND auid=988 uid=988 gid=986 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1428 comm="xdg-desktop-por" exe="/usr/libexec/xdg-desktop-portal-kde" sig=6 res=1 oct 03 17:30:10 fedora xdg-desktop-portal-kde[1428]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. oct 03 17:30:10 fedora xdg-desktop-portal-kde[1428]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. #9 0x0000557a36552ad3 main (xdg-desktop-portal-kde + 0x23ad3) #12 0x0000557a36553ea5 _start (xdg-desktop-portal-kde + 0x24ea5) oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:10 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Start request repeated too quickly. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:10 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Start request repeated too quickly. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:10 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Start request repeated too quickly. oct 03 17:30:10 fedora systemd[1304]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'. oct 03 17:30:10 fedora systemd[1304]: Failed to start plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. oct 03 17:30:14 fedora systemd[1472]: Starting plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE... oct 03 17:30:14 fedora systemd[1472]: Started plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE. ```
slartibart70 commented 2 years ago

it seems, the problem is back with the latest chrom(e|ium) and current kde software:

Operating System: Fedora Linux 36 KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.6 Kernel Version: 6.0.5-200.fc36.x86_64 (64-bit) Graphics Platform: X11

Chromium: Version 107.0.5304.68 (Official Build) (64-bit) Edge: Version 107.0.1418.23 (Official build) beta (64-bit) Chrome: Version 107.0.5304.87 (Official Build) (64-bit)

all of them don't use the kde-save dialog any more

ZaWertun commented 2 years ago

Yeah, bunch of new bugs has appeared. And I see similar reports on reddit.

One of the bug: https://bugs.kde.org/show_bug.cgi?id=458865

Also starting with GTK4 env variable GTK_USE_PORTAL is ignored, it should be replaced with GDK_DEBUG=portals. But it wasn't working for me.

I'll do some more tests on monday. Currently xdg-desktop-portal-kde is working fine when testing it with https://invent.kde.org/libraries/xdg-portal-test-kde. But it not working in any GTK app with or without env variables such as GTK_USE_PORTAL and GDK_DEBUG.

ZaWertun commented 2 years ago

Removing xdg-desktop-portal-gnome helps a bit, at least KDE open & save dialogs starts working in Firefox. Still not working in Gedit though.

slartibart70 commented 1 year ago

Operating System: Fedora Linux 36 KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.100.0 Qt Version: 5.15.7 Kernel Version: 6.0.10-200.fc36.x86_64 (64-bit) Graphics Platform: X11

Since this latest update portal is working again. I think this report could be closed...