Bug 460980 - Apps launched via overview end up with unwanted environment variables
Summary: Apps launched via overview end up with unwanted environment variables
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-overview (show other bugs)
Version: 5.26.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-25 12:01 UTC by priv.luk
Modified: 2022-10-27 13:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description priv.luk 2022-10-25 12:01:11 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
When launching apps via Overview, applications are started directly via kwin_x11, which ends up setting QT_NO_GLIB=1 and QT_QPA_PLATFORM=xcb environment variables for the child process. These variables disable GLIB event loop, thus breaking some apps that depend on that, e.g. telegram-desktop or KDE System Settings.

STEPS TO REPRODUCE
1.  Open System Settings via Krunner,
2.  Go to Audio, notice that it works
3.  Now open System Settings via Overview
4. Go to Audio, notice that it's empty

OBSERVED RESULT
Audio tab is not empty

EXPECTED RESULT
Audio tab is empty


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 37
(available in About System)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
1. https://github.com/KDE/kwin/blob/bcd43ff44d323044cc130aac4d9423f4d0411122/src/main_x11.cpp#L332-L337
Comment 1 Bug Janitor Service 2022-10-25 12:33:54 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.

If you're unsure how to do this, contact your distributor about it.
Comment 2 priv.luk 2022-10-25 12:36:56 UTC
(In reply to Bug Janitor Service from comment #1)
> Thank you for the bug report!
> 
> Please note that Plasma 5.25.5 is not supported for much longer by KDE;
> supported versions are 5.24, and 5.26 or newer.
> 
> If at all possible please upgrade to a supported version and verify that the
> bug is still happening there.
> 
> If you're unsure how to do this, contact your distributor about it.
Comment 3 priv.luk 2022-10-25 12:37:21 UTC
(In reply to Bug Janitor Service from comment #1)
> Thank you for the bug report!
> 
> Please note that Plasma 5.25.5 is not supported for much longer by KDE;
> supported versions are 5.24, and 5.26 or newer.
> 
> If at all possible please upgrade to a supported version and verify that the
> bug is still happening there.
> 
> If you're unsure how to do this, contact your distributor about it.

This still happens with 5.26.1
Comment 4 ratijas 2022-10-25 13:08:14 UTC
Can reproduce
Comment 5 ratijas 2022-10-25 13:10:29 UTC
>     // Disable the glib event loop integration, since it seems to be responsible
>    // for several bug reports about high CPU usage (bug #239963)
>    setenv("QT_NO_GLIB", "1", true);

It's been 12 years since that BUG 239963. I wonder if it's still relevant, or the workaround can be dropped.
Comment 6 Nicolas Fella 2022-10-25 13:26:24 UTC
We probably can unset again after creating the QApplication, just like we did for Wayland in https://invent.kde.org/plasma/kwin/-/commit/77ec43d5e15a8b8ad8e1824ebf49d7d3cbf015c5
Comment 7 priv.luk 2022-10-25 13:52:19 UTC
(In reply to Nicolas Fella from comment #6)
> We probably can unset again after creating the QApplication, just like we
> did for Wayland in
> https://invent.kde.org/plasma/kwin/-/commit/
> 77ec43d5e15a8b8ad8e1824ebf49d7d3cbf015c5

Ah, I'll try kwin with the following changes: https://invent.kde.org/lpatron/kwin/-/commit/5a5995355ed9d60b092e1118359457d032572d6d and see if that solves my issue.
Comment 8 priv.luk 2022-10-25 13:55:20 UTC
(In reply to priv.luk from comment #7)
> (In reply to Nicolas Fella from comment #6)
> > We probably can unset again after creating the QApplication, just like we
> > did for Wayland in
> > https://invent.kde.org/plasma/kwin/-/commit/
> > 77ec43d5e15a8b8ad8e1824ebf49d7d3cbf015c5
> 
> Ah, I'll try kwin with the following changes:
> https://invent.kde.org/lpatron/kwin/-/commit/
> 5a5995355ed9d60b092e1118359457d032572d6d and see if that solves my issue.

Ok, just compiled it and it seems to work ^.^
Comment 9 Bug Janitor Service 2022-10-25 13:55:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3114
Comment 10 Bug Janitor Service 2022-10-25 18:04:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1012
Comment 11 priv.luk 2022-10-27 09:08:16 UTC
Git commit c2b4f03f9671c0ad9fc1929426df5f79db414aa7 by Łukasz Patron.
Committed on 27/10/2022 at 08:03.
Pushed by vladz into branch 'master'.

x11: Don't force QT_NO_GLIB=1

This breaks certain apps, e.g. KDE System Settings when launched from
overview effect.

M  +0    -4    src/main_x11.cpp

https://invent.kde.org/plasma/kwin/commit/c2b4f03f9671c0ad9fc1929426df5f79db414aa7
Comment 12 Nate Graham 2022-10-27 13:36:52 UTC
Git commit 4c5830ba149ec4462587a95f78624dfc981d281c by Nate Graham, on behalf of Łukasz Patron.
Committed on 27/10/2022 at 13:36.
Pushed by ngraham into branch 'Plasma/5.26'.

x11: Don't force QT_NO_GLIB=1

This breaks certain apps, e.g. KDE System Settings when launched from
overview effect.


(cherry picked from commit c2b4f03f9671c0ad9fc1929426df5f79db414aa7)

M  +0    -4    src/main_x11.cpp

https://invent.kde.org/plasma/kwin/commit/4c5830ba149ec4462587a95f78624dfc981d281c