Created attachment 154079 [details] Screenshot showing lack of icons SUMMARY After updating to krusader 2.8.0, none of the tabs show folder or file icons anymore. (Still show fine everywhere else) SOFTWARE/OS VERSIONS Linux/KDE Plasma: Slackware64-current (available in About System) KDE Plasma Version: 5.26.3 KDE Frameworks Version: 5.100.0 Qt Version: 5.15.7
Could you try running krusader from console and check if it's the same? If so, please provide the output of env | grep QT Do you use any HiDPI-related settings or interface scaling features?
Yes, it's happening when run from the console as well. I do have HiDPI settings enabled, scaling is set to 2. Here's the output: QT_SCREEN_SCALE_FACTORS=eDP-1=2;HDMI-1=2;DP-1=2;DP-2=2;DP-3=2;DP-4=2; PLASMA_USE_QT_SCALING=1 QT_IM_MODULE=fcitx QT5DIR=/usr/lib64/qt5 QT_AUTO_SCREEN_SCALE_FACTOR=0
ah, the scaling factor seems to indeed be somewhat related. I do see icons if I start krusader with QT_SCREEN_SCALE_FACTORS="eDP-1=1;HDMI-1=1;DP-1=1;DP-2=1;DP-3=1;DP-4=1" krusader
I have the same issue on Manjaro, scaling set to 200%;
For me it happens at scaling of 150%. Setting to 100% 'fixes' the issue.
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
I'm also having incorrect rendering behavior in krusader v2.8.0 on debian/bookworm. I have a 4k screen, so global scaling is set at 150% and font rendering DPI is set at 192. Interestingly, the Icons are being rendered as if the line height isn't scaled, because what is see is the bottom ½ of the icons rendered on the top ½ of the line if that makes sense. In other words, it looks like the icon is shifted up by 50% and the top portion gets cut off. I can also confirm that setting the scaling back to 100% fixes the rendering in the file/folder frame, but then of course the action buttons across the top get too small to see/use. QT_SCREEN_SCALE_FACTORS=eDP-1=1.5;DP-1=1.5;HDMI-1=1.5;DP-2=1.5;DP-3=1.5;DP-4=1.5;DP-5=1.5;eDP-1-2=1.5;DP-1-6=1.5;DP-1-7=1.5;HDMI-1-2=1.5;DP-1-8=1.5; QT_AUTO_SCREEN_SCALE_FACTOR=0 Global Scaling 150% Force Font DPI = 192 KDE Plasma v5.26.4 KDE Framework v5.101.0 QT v5.15.6
Created attachment 154784 [details] Screenshot with incorrect icon rendering Incorrect icon rendering at 150% scaling. Interestingly, the active panel renders the bottom ½ of the icon and the inactive panel renders the top ½.
(In reply to Steven from comment #7) > I'm also having incorrect rendering behavior in krusader v2.8.0 on > debian/bookworm. > I have a 4k screen, so global scaling is set at 150% and font rendering DPI > is set at 192. > > Interestingly, the Icons are being rendered as if the line height isn't > scaled, because what is see is the bottom ½ of the icons rendered on the top > ½ of the line if that makes sense. In other words, it looks like the icon > is shifted up by 50% and the top portion gets cut off. > > I can also confirm that setting the scaling back to 100% fixes the rendering > in the file/folder frame, but then of course the action buttons across the > top get too small to see/use. > > QT_SCREEN_SCALE_FACTORS=eDP-1=1.5;DP-1=1.5;HDMI-1=1.5;DP-2=1.5;DP-3=1.5;DP- > 4=1.5;DP-5=1.5;eDP-1-2=1.5;DP-1-6=1.5;DP-1-7=1.5;HDMI-1-2=1.5;DP-1-8=1.5; > QT_AUTO_SCREEN_SCALE_FACTOR=0 > > Global Scaling 150% > Force Font DPI = 192 > > KDE Plasma v5.26.4 > KDE Framework v5.101.0 > QT v5.15.6 (In reply to Bug Janitor Service from comment #6) > Dear Bug Submitter, > > This bug has been in NEEDSINFO status with no change for at least > 15 days. Please provide the requested information as soon as > possible and set the bug status as REPORTED. Due to regular bug > tracker maintenance, if the bug is still in NEEDSINFO status with > no change in 30 days the bug will be closed as RESOLVED > WORKSFORME > due to lack of needed information. > > For more information about our bug triaging procedures please read the > wiki located here: > https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging > > If you have already provided the requested information, please > mark the bug as REPORTED so that the KDE team knows that the bug is > ready to be confirmed. > > Thank you for helping us make KDE software even better for everyone! Status -> CONFIRMED
Coming form bug 462794 (https://bugs.kde.org/show_bug.cgi?id=462794). For me switching to Root mode Krusader solves the icon issue, but i have no idea why. Root mode in Krusader changes the scaling mode too, just for that specific session?
*** Bug 448261 has been marked as a duplicate of this bug. ***
*** Bug 462721 has been marked as a duplicate of this bug. ***
*** Bug 462794 has been marked as a duplicate of this bug. ***
*** Bug 464282 has been marked as a duplicate of this bug. ***
The actual bug seems to be in `QItemDelegate::paint`. There a `decorationRect` is calculated which apparently ignores the `devicePixelRatio` property. The following workaround draws the icon in the right size and at the right place. However, they become blurred. diff --git a/app/Panel/PanelView/listmodel.cpp b/app/Panel/PanelView/listmodel.cpp index d6ad6c5f..209fcfb8 100644 --- a/app/Panel/PanelView/listmodel.cpp +++ b/app/Panel/PanelView/listmodel.cpp @@ -177,7 +177,18 @@ QVariant ListModel::data(const QModelIndex& index, int role) const if (properties()->displayIcons) { if (_justForSizeHint) return QPixmap(_view->fileIconSize(), _view->fileIconSize()); - return _view->getIcon(fileitem); + auto pixmap = _view->getIcon(fileitem); + + // BUG 462307 Workaround BEGIN + // KrViewItemDelegate::paint does the paint by QItemDelegate::paint + // which seams to have a bug that ignores the devicePixelRatio + // in calculating the decorationRect + pixmap = pixmap.scaled(pixmap.size() / pixmap.devicePixelRatio(), + Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + pixmap.setDevicePixelRatio(1); + // BUG 462307 Workaround END + + return pixmap; } break; }
Yes, Benjamin, it works. But blurry pictures look very bad. I think the program should use icons of size 16, 22, 32, 48 without resizing. I've been seeing the problem with icons for 2 years now. 'Toolbar settings' do not function properly for the third year. Is the Krusader still alive?
Thanks Benjamin for finding the cause! I found a shorter workaround — just wrap a pixmap into QIcon. diff --git a/app/Panel/PanelView/listmodel.cpp b/app/Panel/PanelView/listmodel.cpp index d6ad6c5f..7731e895 100644 --- a/app/Panel/PanelView/listmodel.cpp +++ b/app/Panel/PanelView/listmodel.cpp @@ -177,7 +177,7 @@ QVariant ListModel::data(const QModelIndex& index, int role) const if (properties()->displayIcons) { if (_justForSizeHint) return QPixmap(_view->fileIconSize(), _view->fileIconSize()); - return _view->getIcon(fileitem); + return QIcon(_view->getIcon(fileitem)); } break; } It might be more efficient to change all the inner calls of it to directly return QIcon (because this is what the things inside operate with), however that would be a lot more complicated solution.
PR: https://invent.kde.org/utilities/krusader/-/merge_requests/118
Thank you very much for fixing this bug that has been bugging me for a long time! I have been using Krusader (2.9.0-dev) for several days with following 2 fixes: https://bugs.kde.org/show_bug.cgi?id=462307#c17 https://invent.kde.org/utilities/krusader/-/merge_requests/118/diffs?diff_id=613721&start_sha=2bd5cd0db362db944bdea639bf0be33f6f439268 No any problem. Debian 11 QT_SCREEN_SCALE_FACTORS=DisplayPort-0=2;DisplayPort-1=2;DisplayPort-2=2;DisplayPort-3=2;HDMI-A-0=2;H DMI-A-1=2;
Merged: https://invent.kde.org/utilities/krusader/-/commit/e5a71586952049ac92fab6f05ed1ab05c1e733c4 Somehow Bugzilla tag didn't trigger, closing manually.
*** Bug 467987 has been marked as a duplicate of this bug. ***
*** Bug 466465 has been marked as a duplicate of this bug. ***
With the latest krusader (gitrev: d03aed26) 16 and 22 sized icons in the view panes use colorful versions designed for big sizes, which is a regression from pre 2.8 (and a deviation from unscaled) behavior where icons up to 22 use simplified mostly monochrome versions designed for small sizes.
I tried to look into the problem about colorful 16 and 22, mentioned above, and I think I came a little bit closer to actual reason of the current bug. The reason is that when you request icon of size 16, its requested size is converted by Qt to icon of size 32 before reaching `IconEngine` (Krusader's icon.cpp), and it loads icon of size 32 from the system theme, disregarding already applied scale ratio. And icon of size 32 is already colorful. And in the end looks like icons are double-scaled (which caused the original issue of this bug, all loaded icons are 4x size of requested icon size, even though my screen is 2x density). At first, `KrView::getIcon` calls `QIcon::pixmap(size)`, which internally multiplies size by 2 because of `Qt::AA_UseHighDpiPixmaps` flag and returns double-sized icon size, see Qt source details here: https://github.com/qt/qtbase/blob/5.15/src/gui/image/qicon.cpp#L911 Then, Krusader's `IconEngine::pixmap` (icon.cpp), which is part of `Icon` implementation (and is called within `QIcon::pixmap`), and which gets that double size as input argument, calls `QIcon::pixmap(size)` again on a found theme icon. It doubles icon size again for the same reason, and quadruple-sized icon is loaded. I found that overriding `IconEngine::scaledPixmap` (via `QIconEngine::virtualHook`) and bringing back the size to original (because we can't avoid scaling under `Qt::AA_UseHighDpiPixmaps`) helps to fix the issue, and correctly colored icons are returned. Moreover, it partially makes workaround from https://invent.kde.org/utilities/krusader/-/merge_requests/118 unnecessary (partially, because even though icon sizes are correct, icon positions are still wrong, so it is not final solution). Looks like Qt6 has some better apis for setting explicit devicePixelRatio, and it would help to make less hacky approach (https://doc.qt.io/qt-6/qicon.html#pixmap-3). Without that, need a hack to override `scaledPixmap` and bring size down. I'll try to clean up my code soon, test it a little bit and make another PR. It will incrementally improve state of things (e.g. fix colored icons usage), and partially fix root cause of current bug, but not completely fix it. (Note: all multipliers in my comment above are 2, because my screen density reports 2 in Qt. For some other configurations, numbers can be different, so don't consider that value as universally used)
I also ran into this issue after upgrading to Kubuntu 23.04. It is quite annoying because it looks strange but it's only fixable if not using scaling. Not sure if using Wayland is also a cause.
Git commit 83dd925e4d9d83a4a69239ae10830168d50b522e by Nikita Melnichenko. Committed on 10/11/2023 at 09:33. Pushed by melnichenko into branch 'stable'. Fixed file icon rendering in case application scaling is enabled FIXED: [ 462307 ] File icons are drawn at wrong position if desktop scaling is active Discussion: https://invent.kde.org/utilities/krusader/-/merge_requests/118 (cherry picked from commit e5a71586952049ac92fab6f05ed1ab05c1e733c4) M +0 -1 app/Panel/PanelView/krinterbriefview.cpp M +1 -1 app/Panel/PanelView/listmodel.cpp https://invent.kde.org/utilities/krusader/-/commit/83dd925e4d9d83a4a69239ae10830168d50b522e
*** Bug 482292 has been marked as a duplicate of this bug. ***