Bug 416078 - Broken UI since 4d09f48
Summary: Broken UI since 4d09f48
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-10 08:12 UTC by Christophe Marin
Modified: 2020-01-26 13:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
broken UI and menus (182.93 KB, image/png)
2020-01-10 08:12 UTC, Christophe Marin
Details
settings dialog (46.14 KB, image/png)
2020-01-10 08:12 UTC, Christophe Marin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Marin 2020-01-10 08:12:09 UTC
Created attachment 125006 [details]
broken UI and menus

Using master and Qt 5.14.

The UI is broken with a recent kwrite build.

Bisecting tells https://cgit.kde.org/kate.git/commit/?id=68a2de71 is the first commit showing the issue.

Screenshots attached. This change breaks the toolbars, menus, aside preview, etc.

The window is usable again if kwrite or kate are started with QT_AUTO_SCREEN_SCALE_FACTOR=0 kwrite
Comment 1 Christophe Marin 2020-01-10 08:12:44 UTC
Created attachment 125007 [details]
settings dialog
Comment 2 Christophe Marin 2020-01-10 08:14:25 UTC
Ups, wrong commit, it started with https://cgit.kde.org/kate.git/commit/?id=4d09f48
Comment 3 Christoph Cullmann 2020-01-10 08:17:29 UTC
Hmm, bad :/
Comment 4 Christoph Cullmann 2020-01-10 08:18:11 UTC
What is your screen scale factor?
Comment 5 Christophe Marin 2020-01-10 08:48:02 UTC
Running kwrite with QT_AUTO_SCREEN_SCALE_FACTOR=0 helps btw.

I'm using a dual monitor setup but didn't change the scaling.
Comment 6 Christoph Cullmann 2020-01-10 08:54:34 UTC
:( This is all crap

I use at home 1.5 scaling with dual-head and I thought it works even after this patch, need to re-try that, not that I have actually used a Qt < 5.14 :/
Comment 7 Christophe Marin 2020-01-10 09:25:34 UTC
Playing with the "global scale" settings in systemsettings/display & monitor "fixes" the broken UI elements but the font are (obviously) way too big
Comment 8 Christoph Cullmann 2020-01-10 10:06:10 UTC
I don't actually understand why this change should trigger that :/
Comment 9 Christophe Marin 2020-01-10 11:27:27 UTC
Note that previously, startkde was setting QT_AUTO_SCREEN_SCALE_FACTOR, this was disabled in https://cgit.kde.org/plasma-workspace.git/commit/?id=a0a80c67f
Comment 10 Christoph Cullmann 2020-01-10 11:48:07 UTC
If we can fix that in kate/kwrite/... code, I am happy to do so, but what is actually the correct sequence of stuff to setup hidpi support?

So far, it seemed to be:

    /**
     * enable high dpi support
     */
    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);

And from Qt 5.14 on, one can allow e.g. stuff like 1.5 via (at least on Windows, on X11 it was always possible already before that):


    /**
     * allow fractional scaling
     */
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
Comment 11 Christoph Cullmann 2020-01-10 13:15:57 UTC
See more complaints about this in bug 373232.

Konsole doesn't set setHighDpiScaleFactorRoundingPolicy yet, just the usual 

    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);

That worked perfectly well before Qt 5.14 on my desktop with 1.5 scaling, now it is strange :/
Comment 12 Christoph Cullmann 2020-01-10 13:19:19 UTC
I think

QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);

with

QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);

leads to doom.

Shall I remove the QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true)?
Comment 13 Christoph Cullmann 2020-01-10 13:25:05 UTC
Hmm, I guess I need to test this more extensive at home, at least in our company our UI guy has the same issue at the moment with the 5.14 update and our internal stuff. Some things look blurry now.
Comment 14 Christophe Marin 2020-01-22 20:43:19 UTC
Now that plasma-workspace was updated to also set QT_AUTO_SCREEN_SCALE_FACTOR to 0 with Qt 5.14, I don't know what to do with this report.
Comment 15 Christoph Cullmann 2020-01-22 20:59:10 UTC
No idea.
I tried a bit more with the Qt flags, but without QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); scaling is problematic in other cases :/
Comment 16 Christoph Cullmann 2020-01-26 13:09:15 UTC
Seems that the pass-through is a bad idea for unices :/
Let's just enable that at the moment for Windows, there it seems to properly work.
Comment 17 Christoph Cullmann 2020-01-26 13:09:32 UTC
Git commit 577b74c7d8d4163c76c8d5f1511ce44520e03c85 by Christoph Cullmann.
Committed on 26/01/2020 at 13:08.
Pushed by cullmann into branch 'release/19.12'.

only allow the new pass through policy for windows

for unices (X11) this seems to cause issues

M  +4    -1    kate/main.cpp
M  +4    -1    kwrite/main.cpp

https://invent.kde.org/kde/kate/commit/577b74c7d8d4163c76c8d5f1511ce44520e03c85
Comment 18 Christoph Cullmann 2020-01-26 13:09:36 UTC
Git commit 577b74c7d8d4163c76c8d5f1511ce44520e03c85 by Christoph Cullmann.
Committed on 26/01/2020 at 13:08.
Pushed by scmsync into branch 'release/19.12'.

only allow the new pass through policy for windows

for unices (X11) this seems to cause issues

M  +4    -1    kate/main.cpp
M  +4    -1    kwrite/main.cpp

https://commits.kde.org/kate/577b74c7d8d4163c76c8d5f1511ce44520e03c85
Comment 19 Christoph Cullmann 2020-01-26 13:10:24 UTC
Should now be fixed in 19.12 branch + master