KDE/High-dpi issues

Jump to: navigation, search



With pixel densities of 200 ppi and more already established on smartphones and notebooks finally catching up with high-dpi screens (think of Intel's new UltraBooks or MacBooks with "Retina" aka "Reasonable resolution" screen), the need for a more scalable and less pixel-dependent user experience increases.

This wiki page collects all places in KDE that have hard-coded pixel sizes so we have a central list of things we need to fix.

Tips for developers

  • Do not use QFont setPixelSize but use setPointSize, and better, avoid setting a custom size at all. Try to stick with the possibilities from KGlobalSettings (KGlobalSettings::generalFont(), KGlobalSettings::largeFont() etc.)
  • Do not use a fixed QSize with images (QPixmap, QIcon...)
  • Do not use KIconLoader::StdSizes. Even though it would sound like a good idea to use it, it suffers from the same issue: Hardcoded pixel sizes.
  • To get a user's configured icon size, include <kiconloader.h> and use the IconSize function (note: this is not a member function): IconSize(KIconLoader::Small). However, be aware that the user might be able to mess up your apps look by setting some insane values here.
  • If you use svg images for icons (for example in plasma) get the standard sizes from some theme elements (e.g. buttons, fonts) and scale your images accordingly. (Don't do this when using pixel based images)

How you can help

Even if you do not have a high-dpi screen (which is most likely the case for desktop monitors, which is sad, actually), you can still help:

  • Increase font dpi (System Settings → Application Appearance → Fonts → Force font dpi, enter a number such as 125 or 150)
  • Increase icon sizes (System Settings → Application Appearance → Icons → Advanced, here choose a higher icon size for all icons, eg. just increase each icon type by one step)

Use KDE this way or look for a particular application you use regularly and test if it still looks nice. If it does not, look in the list below if the issue is already listed, if not, file a bug on bugs.kde.org and add it to the list.

As a reference, the Retina Screen on MacBook Pros doubles the pixel count. That means, to completely see how an app would look on it, you should double the font DPI and the icon sizes. For a real setup, additionally to the the above settings, you may also increase Window Decoration sizes (System Settings → Workspace Appearance → Window Decorations → Configure Decoration)


User settable, overall DPI

Ideally the screen size (width and height of the monitor screen) is automatically detected using the monitor's EDID information. This may not work correctly or not be to the user's preferences. KDE currently lacks a convenient way to scale everything uniformly. Such a feature would also help to test proper scaling behaviour.


Modify the X server's settings. In /etc/X11/xorg.conf add DisplaySize and Option "UseEdidDpi" to the monitor section so that it looks somewhat like this:

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
	Option       "UseEdidDpi"    "false"
	DisplaySize  464 292

where the display size (width and height) is in millimeters. The DPI value is then calculated from these numbers and the monitor image's resolution in pixels. Use smaller numbers than the real dimension to simulate high DPI (make everything appear larger) or bigger numbers for low DPI (make everything appear smaller). The X server needs to be restarted for the changes to take effect.

To make things more interesting, many distributions these days do not create a /etc/X11/xorg.conf file, used to configure the X server, by default. The X configuration is automatically determined each time X is started. In most cases, this works well and there is no need to manually specify X configuration information. To create it, run as root

Xorg :1 -configure
then copy xorg.conf.new to /etc/X11/xorg.conf and modify it as shown above.


Status Component Summary Claimed By
DONE Play/Pause button in sidebar The Play/Pause button in the sidebar when showing a media file is hardcoded to 16px. Bug #309498 Fixed in 4.9.4
TODO Places panel icons using StdSizes The Icon Size menu of the places panel introduced for 4.10 uses KIconLoader::StdSizes which are just returning a fixed int.


Status Component Summary Claimed By
DONE Addressbar edit mode The blue tick in the address bar to switch back from edit mode to breadcrumb mode is hardcoded to 16px. Fixed in 4.9.3
TODO KIconLoader KIconLoader::StdSizes is an enum with hardcoded pixel sizes. Should be replaced by a function which uses screen DPIs to calculate "standard sizes"
TODO KMessageBox IconLabel size is using QStyle::PM_MessageBoxIconSize which just returns a StdSize which returns a fixed int - fix QStyle there and get the other places fixed for free ;)
TODO KColorButton Widget size fixed, or: style()->sizeFromContents(QStyle::CT_PushButton, &opt, QSize(40, 15), this) doesnt work?! [kdelibs] kdeui/colors/kcolorbutton.cpp
IN PROGRESS KIconButton Button that lets you choose an icon for something (eg. folder icon) hardcoded to 48px [kdelibs] kio/kfile/kicondialog.cpp Review 108442 and Review 108443 (Dolphin) <kde@privat.broulik.de>
IN PROGRESS KIconDialog Dialog that lets you choose an icon for something has hardcoded grid size, hardcoded icon size, hardcoded sizeHint, etc A bit more complicated and probably KDE Frameworks 5 stuff and urging for a rewrite of the entire dialog <kde@privat.broulik.de>


Status Component Summary Claimed By
DONE Bouncing Cursor The startup feedback cursor does not respect the small icon size and is hardcoded to 16px. Bug #305611 Review 106166 Fixed in 4.9.1 <kde@privat.broulik.de>

TODO Tabbox Hardcoded sizes: Small sizes are really tiny, Big ones are rather small

TODO Decorations Window icon pixmap (the little icon in the top left corner of the window) seems hardcoded 16px


Status Component Summary Claimed By
TODO Widget Theme Scroll bar up/down buttons don't scale with eg. the width of the scrollbar


Status Component Summary Claimed By
TODO System Tray System tray does not scale according to user's dpi/icon settings
TODO System Tray Popup arrow is hardcoded to 12px. The problem lies in [kde-workspace] plasma/generic/applets/systemtray/package/contents/ui/ArrowArea.qml - Instead of hardcoding 12px it should probably do something like IconSize(KIconLoader::Small) * 0.75 --Broulik
TODO Tooltips Icon in tooltip hardcoded From what I can see the tooltips in Plasma use IconSize(KIconLoader::Desktop) and they adapt to that setting --Broulik
IN PROGRESS Plasma NM Almost all sizes are hardcoded Review 106961 (4.10),Review 107249 (4.11) <mzanetti@kde.org>
TODO Task plasmoid Preview window hardcoded size; this is in kdelibs/plasma/private/windowpreview* as WINDOW_WIDTH and WINDOW_HEIGHT. Could be scaled according to screen resolution.
TODO Kickoff plasmoid All icons hardcoded size. (aseigo: Uses Plasma::Delegate from libplasma; but probably irrelevant as it is being replaced with a QML UI. Focus attention / efforts on QML components.)
DONE Panel options Icons for Screen Edge and Height hardcoded size. Review 107414 Fixed in 4.9.4 <kde@privat.broulik.de>
TODO libplasmaclock Popup calendar initial size hardcoded and too small (should be calculated from theme font size). Library is in kde-workspace/libs/plasmaclock
IN PROGRESS Device notifier plasmoid Popup too small and fonts overlapping Review 107428 <mzanetti@kde.org>
TODO Notifications plasmoid Default size too small. Simple text notifications wordwrap text after each word. Doesnt seem to be an issue with the new QML notification applet in 4.10, tested with 300 dpi and the dialog/popup grows accordingly? --Broulik
TODO Notifications plasmoid / Tooltip Notifications plasmoid icon uses theme.largeIconSize whereas tooltips use IconSize(KIconLoader::Desktop). The former seems to be theme dependent and doesn't respect the dpi, whereas the latter one is a fixed theme-independent size.

TODO Plasmoid handles (scale, rotate, settings, close...) Icons hardcoded sizes. The handle background seems to scale, so probably the icons could just be changed to fill the available space in there. Look in [kdelibs] plasma/private/applethandle.cpp

TODO New battery plasmoid All spacings and margins are hardcoded pixel sizes.


Status Component Summary Claimed By
TODO KMail Accounts Incoming Font size in the delegate is hardcoded


Status Component Summary Claimed By
TODO ktp kded module (kcm) Draggable Listening To elements list is hardcoded, causing scrollbars and the widget being unusable Bug #305714 https://git.reviewboard.kde.org/r/107417/ Fixes?
DONE ktp contactlist Contact list ListView mostly hardcoded sizes. https://git.reviewboard.kde.org/r/106855/
TODO ktp text-ui Avatars etc hardcoded sizes


Status Component Summary Claimed By
TODO kdm Almost everything hardcoded


Status Component Summary Claimed By
TODO Browser part Find an appropriate default zoomlevel for webpages. Currently every page has to be zoomed in to be readable


Status Component Summary Claimed By
TODO Browser part Find an appropriate default zoomlevel for webpages. Currently every page has to be zoomed in to be readable
TODO Tabs Tabs previews and icons/buttons on tabs hardcoded sizes
TODO New Tab/Favourites Favourites previews hardcoded size


Status Component Summary Claimed By
TODO Splash screen hardcoded size
TODO Welcome page "Learn KDevelop" button off the layout
TODO Tabs (Review/Debug/Code) and Working set buttons Hardcoded sizes

System Settings

Status Component Summary Claimed By
IN PROGRESS Title above kcm_modules content Icon on the right in the title is hardcoded/small. Review 108434 <kde@privat.broulik.de>
TODO Initial setup Be aware of huge DPI sizes and initialize settings with sane values (Window theme sizes, Icons, Panel sizes, etc)

DONE ToolTipManager Tooltip icons are hardcoded to 32x32 (for main title) and 24x24 (for categories inside). Review 108427 Fixed in 4.10 RC3 <kde@privat.broulik.de>

KCM Modules

Status Component Summary Claimed By
TODO Account details Password & User Account -> Avatar button hardcoded size
TODO Akonadi resources icons in ListView delegates hardcoded sizes
TODO Desktop Theme Font doesn't fit on previews in "Details" tab with high DPI settings
TODO Splash screen Preview hardcoded size Problem is that themes provide only a 400x300 screenshot so they cannot be arbitrarily sized. For ksplashqml it would be of course cool to directly show the theme resized smaller in the preview area
TODO Window Behavior Font doesn't fit on elements in task switcher previews
TODO Workspace Behavior Screen Edges: Screen picture hardcoded size

TODO Colors Icons hardcoded sizes
IN PROGRESS Colors Table row height in "Colors" and "Disabled" tabs hardcoded sizes Review 108433 <kde@privat.broulik.de>
TODO Login Manager Theme previews hardcoded size
TODO Partition manager Icons on buttons hardcoded sizes
TODO Power Management Combo boxes for suspend session, lidaction and powerbutton handling are hardcoded. Since those actions are all independent widgets we cannot align them to some global layout. Best approach imho would be to use the font mSize and multiply it by some value so it matches the fixed 300px that it uses currently and then scale nicely with the user's font size --Broulik
IN PROGRESS Bluetooth Device list has overlapping text. Review 107415 <kde@privat.broulik.de>
TODO User Management TableView too small and column widths hardcoded


Status Component Summary Claimed By
TODO Status window for indexer Label height hardcoded, font doesn't fit in.


Status Component Summary Claimed By
DONE KMix Icons above and below the sliders are hardcoded to 22px Fixed in 4.11.9

This page was last modified on 2 January 2015, at 00:24. This page has been accessed 33,575 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal