Bug 389585 - Window is too small when KCMs are opened standalone (e.g. using `kcmshell5), and contents get cut off
Summary: Window is too small when KCMs are opened standalone (e.g. using `kcmshell5), ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcmutils
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords: junior-jobs
: 386433 391564 392314 392673 393891 395422 395602 396748 397157 397361 397437 401718 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-29 05:04 UTC by Andres Betts
Modified: 2021-03-10 03:22 UTC (History)
24 users (show)

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


Attachments
wifikcm (48.00 KB, image/png)
2018-01-29 05:04 UTC, Andres Betts
Details
Network KCM looks fine to me now (81.93 KB, image/png)
2018-09-06 02:31 UTC, Nate Graham
Details
Network kcm on neon dev unstable. Hidden buttons on bottom. (958.60 KB, video/webm)
2018-09-06 16:08 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Betts 2018-01-29 05:04:15 UTC
Created attachment 110197 [details]
wifikcm

The window is too small.
Comment 1 Nate Graham 2018-01-29 16:07:40 UTC
Yeah, looks like the list should be much more narrow, and the rest of the window a bit wider.
Comment 2 Øystein Steffensen-Alværvik 2018-02-21 15:10:24 UTC
This is the default window size on my system too (Neon User). I agree, this looks clunky.
Comment 3 Jan Grulich 2018-05-28 11:46:27 UTC
*** Bug 392314 has been marked as a duplicate of this bug. ***
Comment 4 Andres Betts 2018-05-28 15:39:30 UTC
How is this bug coming along?
Comment 5 Jan Grulich 2018-05-28 17:00:05 UTC
This bug is actually not plasma-nm specific, other KCMs are small as well, when opened. I spent some time trying to fix it from our side, but failed, managed to do so only in kcmshell itself (if I remember correctly), I just didn't consider it as a proper fix so didn't push for review.
Comment 6 Andres Betts 2018-05-28 17:01:44 UTC
Thank you Jan. We will likely tackle this soon as we continue working on the KCMs.
Comment 7 Patrick Silva 2018-06-15 21:22:38 UTC
*** Bug 395422 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2018-06-19 21:33:15 UTC
*** Bug 395602 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2018-06-19 21:34:06 UTC
I think you just need to update the sizeHint, no?
Comment 10 Nate Graham 2018-07-25 20:12:46 UTC
*** Bug 393891 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2018-07-25 20:12:48 UTC
*** Bug 392673 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2018-07-25 20:12:50 UTC
*** Bug 391564 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2018-07-25 20:13:46 UTC
Jan, could you maybe submit your patch anyway just to solicit feedback? This is a pretty high-profile issue and especially since it affects other KCMs too, it would be nice to get it resolved!
Comment 14 trmdi 2018-08-04 17:11:12 UTC
*** Bug 397157 has been marked as a duplicate of this bug. ***
Comment 15 Patrick Silva 2018-08-05 12:36:14 UTC
bug 396076 seems related/duplicate.
Comment 16 Nate Graham 2018-08-05 13:44:25 UTC
*** Bug 396076 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2018-08-05 13:59:41 UTC
*** Bug 379858 has been marked as a duplicate of this bug. ***
Comment 18 Patrick Silva 2018-08-05 15:10:27 UTC
*** Bug 395454 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2018-08-05 17:34:45 UTC
*** Bug 394747 has been marked as a duplicate of this bug. ***
Comment 20 Valerii Malov 2018-08-06 19:05:35 UTC
There seem to be multiple problems

First, there seems to be a problem with QDialog + QScrollArea having some kind of implicit preferred maximum size, after which dialog stops growing to fit content. For example, all kcmshell5 dialogs open at 637x518 max for me no matter what's the size of the widget inside.

Second, some widgets that have QML contents report incorrect size hint because QML content takes time to initialize. This is why KScreen KCM has size hint explicitly set, and it stops it from opening as extremely tiny window, but issue 1 stops it from opening as a large enough window to fit all contents.

Third, few widgets already seem to have scrollable content (e.g. opengl kcm) and they probably just need manual minimum size set.

First problem is the biggest issue I suppose, since it affects all KCMs with large content and network manager KCM in particular, but I don't know where this preferred size comes from so I don't know how to fix it yet :/
Comment 21 Valerii Malov 2018-08-08 12:40:13 UTC
Proposed fix for first issue: https://phabricator.kde.org/D14692

Second and third need to be hunt down per-KCM I suppose
Comment 22 Valerii Malov 2018-08-13 08:55:48 UTC
Git commit 23ba2b37ef825f0efccc169455f45b0dcdac97cf by Valeriy Malov.
Committed on 13/08/2018 at 08:55.
Pushed by valeriymalov into branch 'master'.

Use custom QScrollArea with size hint not limited by font size

Summary:
For some reason original QScrollArea has constraint on a size hint
This causes large KCMShell pages open in relatively small windows,
because QScrollArea inside reports small size hint

Test Plan:
patched 5.48.0 with this, tested networkmanager and few other kcms,
they now seem to open in full size (except for kscreen which has custom sizehint,
it probably needs size hint for the QML area specifically, not the whole window;
and except for opengl that has it's own scrollable area which needs a size hint too)

Reviewers: #frameworks, ngraham

Reviewed By: ngraham

Subscribers: ngraham, kde-frameworks-devel

Tags: #frameworks

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

M  +1    -1    src/kcmultidialog.cpp
M  +22   -0    src/kcmultidialog.h

https://commits.kde.org/kcmutils/23ba2b37ef825f0efccc169455f45b0dcdac97cf
Comment 23 trmdi 2018-08-14 06:38:00 UTC
*** Bug 397437 has been marked as a duplicate of this bug. ***
Comment 24 Christoph Feck 2018-08-17 21:54:35 UTC
*** Bug 396748 has been marked as a duplicate of this bug. ***
Comment 25 Øystein Steffensen-Alværvik 2018-08-18 09:08:57 UTC
Good work.
Comment 26 Andrew Crouthamel 2018-08-19 13:33:02 UTC
I've noticed this issue when using scaling on a hidpi system. Does this patch solve when scaling?
Comment 27 Nate Graham 2018-08-19 14:06:14 UTC
Yes, the patch resolves the issue with HiDPI as well (at least for me).
Comment 28 Andrew Crouthamel 2018-08-19 14:48:57 UTC
(In reply to Nate Graham from comment #27)
> Yes, the patch resolves the issue with HiDPI as well (at least for me).

Awesome! This was one of those minor nuisances that I wasn't sure where to file it. I'll have to test in the coming weeks.
Comment 29 Patrick Silva 2018-08-26 20:21:47 UTC
*** Bug 397361 has been marked as a duplicate of this bug. ***
Comment 30 Patrick Silva 2018-09-05 16:14:33 UTC
is the fix available on neon dev unstable?
bug persists in such distro.
Comment 31 Nate Graham 2018-09-05 16:23:58 UTC
(In reply to Dr. Chapatin from comment #30)
> is the fix available on neon dev unstable?
> bug persists in such distro.

1x scale or a different scale?
Comment 32 Patrick Silva 2018-09-05 18:19:47 UTC
Tested both 1x and 1.2x scale:

"per-activity power management" window opened via krunner is too small (bug 379858)

power saving kcm has horizontal scroll bar

network manager kcm: vertical scroll bar when scale is 1x, 
therefore the buttons on botton are hidden (bug 393891, bug 395602, bug 392314). When display scale is 1.2x, both horizontal and vertical scroll bars are active.

"desktop effects" opened via krunner is too small (bug 396076)

touchpad kcm has horizontal scroll bar when scale is 1.2x (bug 397361).
Comment 33 Andrew Crouthamel 2018-09-05 23:27:42 UTC
I also still have this issue.

I just tested on a Dell XPS 13 (4k), with latest Neon Unstable (Frameworks 5.50) booted natively (no VM), and I have vertical scrollbars in most standalone KCM apps. Displays is the worst for me.

The issue seems to get worse as scaling is increased. I usually run at 2x.

The horizontal scrollbars seem to go away for me though, so that's a positive note.

I think we should reopen this...
Comment 34 Nate Graham 2018-09-06 02:31:11 UTC
Created attachment 114800 [details]
Network KCM looks fine to me now

I'm attaching an image of what `kcmshell5 kcm_networkmanagement` shows at 1x scaling for me now. Looks fine to me. Andrew and bugseforuns, can you confirm that this is what it looks like for you at 1x? If it looks bad at > 1x, that's a separate bug, or an issue with the patch that we didn't catch (oops), in which case we should track that with a new bug.

I do notice that some other KCMs such as Applications, Desktop Effects, and Displays are a bit too small at 1x, but they're not absolutely tiny the way they used to be. I suspect what's happening here is that we fixed the general bug about kcmshell not respecting KCMs' sizeHints that was preventing KCMs from being able to be sized correctly within kcmshell at all, but now we need to adjust some individual KCMs so that they pass an appropriate sizeHint to the shell. Probably we should un-dupe the bugs that were tracking the individual KCMs that still need adjustment so we can fix their sizeHints.
Comment 35 Valerii Malov 2018-09-06 12:52:33 UTC
Seems like a lot of KCMs that are still bugged are QML ones that rely on rely on KQuickAddons::ConfigModule

kcm_fileindexermonitor
kcm_fonts
kcm_launchfeedback
kcm_translations
kcm_workspace

Some QML KCMs work fine though, like Networks or Mouse. Both have some sort of top level UI or QWidget, e.g. mouse KCM propagates sizeHint from QML properties into a QWidget

KQuickAddons::ConfigModule on the other hand is just a QObject with no concept of size hint. It seems like something should be done with ConfigModule, but just turning it into a QWidget with sizeHint makes no difference since no one ever asks it it's sizeHint anyway. I'm not really familiar with QML to fix this right away :/ This probably should be split out into a separate bug?
Comment 36 Patrick Silva 2018-09-06 16:08:20 UTC
Created attachment 114815 [details]
Network kcm on neon dev unstable. Hidden buttons on bottom.
Comment 37 Andrew Crouthamel 2018-09-06 17:40:25 UTC
(In reply to Nate Graham from comment #34)
> Created attachment 114800 [details]
> Network KCM looks fine to me now
> 
> I'm attaching an image of what `kcmshell5 kcm_networkmanagement` shows at 1x
> scaling for me now. Looks fine to me. Andrew and bugseforuns, can you
> confirm that this is what it looks like for you at 1x? If it looks bad at >
> 1x, that's a separate bug, or an issue with the patch that we didn't catch
> (oops), in which case we should track that with a new bug.

I confirm it looks OK at 1x. 2x I get scrollbars.
Comment 38 Valerii Malov 2018-09-07 13:31:31 UTC
(In reply to Dr. Chapatin from comment #36)
> Created attachment 114815 [details]
> Network kcm on neon dev unstable. Hidden buttons on bottom.

Ok, when dialog is adjusted based on the size hint, its size is limited by 2/3 of the desktop size (hardcoded in QWidgetPrivate::adjustedSize: https://bugreports.qt.io/browse/QTBUG-3459). That's probably the cause of issue here. I guess it can be worked around by a custom adjustSize() function.

No idea if that's related to hi-dpi issues, can't test that.
Comment 39 trmdi 2018-09-07 15:18:06 UTC
(In reply to Dr. Chapatin from comment #36)
> Created attachment 114815 [details]
> Network kcm on neon dev unstable. Hidden buttons on bottom.

Confirm this.
Comment 40 Nate Graham 2018-09-07 15:25:19 UTC
(In reply to Dr. Chapatin from comment #36)
> Created attachment 114815 [details]
> Network kcm on neon dev unstable. Hidden buttons on bottom.

Looks like this particular issue is caused by https://bugreports.qt.io/browse/QTBUG-3459, as Valeriy indicates.

I'd prefer to go the route of fixing it in Qt rather than working around it locally (though that's an option too, if worse comes to worst).


So it seems that we have three angles of attack:

1. Fix individual KCMs that don't give us proper SizeHints, now that kcmshell *pays attention to sizeHints. Bugseforuns, since you're carefully tracking the issues here, would you like to un-dupe the bugs for individual KCMs that still need adjustment and add appropriate comments?

2. Fix or work around https://bugreports.qt.io/browse/QTBUG-3459 so that KCMs sizeHints are actually properly respected on short screens. Valeriy, would you be interested in tackling that?

3. Fix the issue with the fix for this bug not working for HiDPI. Andrew, since you have a HiDPI screen, would you like to investigate this part?
Comment 41 Andrew Crouthamel 2018-09-08 01:30:15 UTC
I'd love to help, but this is honestly outside of my capabilities at the moment. I'd be glad to work with someone and test though.
Comment 42 Valerii Malov 2018-09-10 14:50:46 UTC
Workaround for QTBUG-3459

https://phabricator.kde.org/D15406
Comment 43 Valerii Malov 2018-09-12 02:20:42 UTC
Git commit cc4ecfdcd48a52a67f60eb69ed69e91ca42ee405 by Valeriy Malov.
Committed on 12/09/2018 at 02:20.
Pushed by valeriymalov into branch 'master'.

Manually resize KCMUtilDialog to sizeHint()

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

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

Reviewers: #frameworks, ngraham

Reviewed By: ngraham

Subscribers: davidedmundson, acrouthamel, kde-frameworks-devel

Tags: #frameworks

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

M  +13   -2    src/kcmultidialog.cpp

https://commits.kde.org/kcmutils/cc4ecfdcd48a52a67f60eb69ed69e91ca42ee405
Comment 44 Nate Graham 2018-09-12 02:40:17 UTC
Awesome. Now we're down to two issues:
- Fix High DPI
- Fix individual KCMs that provide incorrect sizeHints. For this we should probably un-dupe any bugs for individual KCMs that still have a problem at 1x with current git master.
Comment 45 Nate Graham 2018-09-18 21:26:00 UTC
New bug for QML KCMs not properly passing on their sizeHints: Bug 398820

New bugs for individual other KCMs with inappropriate sizeHint values:
- Formats: Bug 398805
- Applications: Bug 398799
- Bluetooth: Bug 398798
- Per-activity power settings: Bug 398793
- Icons: Bug 398797

Thanks for filing these bugs, Dr. Chapatin.
Comment 46 Nate Graham 2018-09-19 02:45:33 UTC
Desktop effects: Bug 396076
Comment 47 trmdi 2018-10-27 12:09:58 UTC
Maybe relate: https://bugs.kde.org/show_bug.cgi?id=400355
Comment 48 Patrick Silva 2018-11-20 12:37:32 UTC
*** Bug 401163 has been marked as a duplicate of this bug. ***
Comment 49 Patrick Silva 2018-12-04 12:17:07 UTC
*** Bug 401718 has been marked as a duplicate of this bug. ***
Comment 50 Nate Graham 2021-03-10 03:22:15 UTC
*** Bug 386433 has been marked as a duplicate of this bug. ***