Manually resize KCMUtilDialog to sizeHint()
ClosedPublic

Authored by valeriymalov on Sep 10 2018, 2:46 PM.

Details

Summary

Workaround for https://bugreports.qt.io/browse/QTBUG-3459

Currently adjustSize() is limited to 2/3 of the screen size for windows
This adds unnecessary scrollbars on dialogs that would otherwise fit the
screen
Manually resize the window after adjustSize() happens to avoid this
limitation

CCBUG: 389585

Test Plan

Tested on a 1366x768 laptop, with this patch networkmanagement window opens
in full screen height (respecting the panel)

Diff Detail

Repository
R295 KCMUtils
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
valeriymalov created this revision.Sep 10 2018, 2:46 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 10 2018, 2:46 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
valeriymalov requested review of this revision.Sep 10 2018, 2:46 PM
acrouthamel added a subscriber: acrouthamel.
ngraham accepted this revision.Sep 10 2018, 11:20 PM

Awesome. Tested it out, and this definitely helps for 1366x768. Doesn't regress the 1920x1090 or larger case, either.

To get High DPI support working, I bet we need to multiply some of these values by QApplication::devicePixelRatio(), but that's only a theory at this point...

This revision is now accepted and ready to land.Sep 10 2018, 11:20 PM

neither QWidget::adjustSize() nor QWidget::adjustedSize() seem to use devicePixelRatio (https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/kernel/qwidget.cpp#n8665), but I can't test that to vouch that it works on HiDPI as intended
I can land it as is but I don't really want to break kcmshell further for HiDPI users

@acrouthamel, could you test this patch to make sure it doesn't regress anything for High DPI users?

@acrouthamel, could you test this patch to make sure it doesn't regress anything for High DPI users?

I can test it out tonight.

neither QWidget::adjustSize() nor QWidget::adjustedSize() seem to use devicePixelRatio

They shouldn't.

Both qwidget sizes and qscreen sizes are in logical pixels.

I've tested this patch on my system. Although it does not resolve the scaling issue I experience, it does not cause any regressions I see. Ship it! :)

This revision was automatically updated to reflect the committed changes.