Bug 406195 - If QT_SCALE_FACTOR is set to 2, Kwin doesn't start and runs at 100% CPU forever
Summary: If QT_SCALE_FACTOR is set to 2, Kwin doesn't start and runs at 100% CPU forever
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.12.7
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-03 18:28 UTC by Niccolo Brogi
Modified: 2019-04-05 09:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niccolo Brogi 2019-04-03 18:28:44 UTC
SUMMARY

If QT_SCALE_FACTOR is set to 2, Kwin doesn't start and runs at 100% CPU forever. Running with QT_SCALE_FACTOR set to 1 works.

STEPS TO REPRODUCE

Start Kwin with "QT_SCALE_FACTOR" set to 2, for instance like so:
"(export QT_SCALE_FACTOR=2; kwin --replace &)"

OBSERVED RESULT

Kwin kills the current window manager, but then doesn't start and runs at 100% CPU forever. Can only be killed with "kill -9".


EXPECTED RESULT

Kwin should start normally

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Xfce on Ubuntu Bionic
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5 

ADDITIONAL INFORMATION

This problem seems to be caused by a combination of environmental variables that I'm running. If I create a brand new user, Kwin can start correctly even with QT_SCALE_FACTOR set to 2. Which variables are causing the problem, I cannot figure out. 

I actually figured out that I had originally opened another bug at https://bugs.kde.org/show_bug.cgi?id=398965, but last time I failed to figure out how to get a backtrace of the process. This time, I'm also attaching backtrace (sorry, don't know how to output to file so it's an image).
Comment 1 Niccolo Brogi 2019-04-03 18:32:28 UTC
Ops, nevermind--image was too big to attach. I uploaded it here: https://i.imgur.com/ElQEOe6.jpg
Comment 2 Vlad Zahorodnii 2019-04-03 18:52:59 UTC
Why do you set this environment variable anyway?
Comment 3 David Edmundson 2019-04-03 18:56:14 UTC
Use this instead: QT_SCREEN_SCALE_FACTORS
Comment 4 David Edmundson 2019-04-04 01:03:48 UTC
Git commit 79ce5dac9a2af0823c16f80dfff19ef3494d08c3 by David Edmundson.
Committed on 04/04/2019 at 01:03.
Pushed by davidedmundson into branch 'Plasma/5.15'.

Also unset QT_SCALE_FACTOR

Summary:
Qt scaling and kwin on X11 is never going to work so it is disabled.

However, Qt uses multiple environment variables for subtly different
internal things. We don't set QT_SCALE_FACTOR in Plasma, using different ones.

An XFCE user was setting this, which kinda makes sense if your DE doesn't
have an appropriate UI.

I don't think it's relevant for main_wayland as wl_output.scale should
trump the environment variable.

Reviewers: zzag

Reviewed By: zzag

Subscribers: zzag, kwin

Tags: #kwin

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

M  +1    -0    main_x11.cpp

https://commits.kde.org/kwin/79ce5dac9a2af0823c16f80dfff19ef3494d08c3
Comment 5 Niccolo Brogi 2019-04-05 09:00:10 UTC
Thanks, guys!