[systemsettings] [Bug 357688] New: DPI is always reported to 96 on High Res Display

Kai-Uwe Behrmann via KDE Bugzilla bugzilla_noreply at kde.org
Fri Jan 8 08:54:19 GMT 2016


https://bugs.kde.org/show_bug.cgi?id=357688

            Bug ID: 357688
           Summary: DPI is always reported to 96 on High Res Display
           Product: systemsettings
           Version: 5.4.3
          Platform: openSUSE RPMs
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: kcm_fonts
          Assignee: unassigned-bugs at kde.org
          Reporter: ku.b at gmx.de
                CC: unassigned-bugs at kde.org

The plasma 5 systemsettings fontsettings panel has a checkbox for forcing a DPI
value for fonts and a accompanying DPI value field. So far so good.

On a MacBook-pro with retina display this field is always set to 96 DPI, which
is wrong. This setting forces me to adjust the value manually to 192 doubling
the size to obtain a reasonable desktop. The correct physical DPI value is 227.

After some research for other non Qt based applications, I found that 96 is
always reported by Xinerama on this machine, with all other values like size
and so on computed to match 96 DPI. However XRandR reports the size in
millimeter correctly. Based on this information and the desktops pixel size,
the DPI can be computed correctly.

Reproducible: Always

Steps to Reproduce:
1. install KDE Plasma 5 on MacBookPro Retina
2. see the too small desktop windows rendering
3. go to systemsettings -> font settings -> force DPI box

Actual Results:  
see 96 DPI in the fonts force DPI value box

Expected Results:  
see the xrandr reported DPI value in the fonts force DPI value box

// Here some code showing the correct DPI values by using the XRandR API.
// Hope this helps.
// cc -Wall -g -pedantic XRandRfl.cxx -o XRandRfl -lX11 `pkg-config --libs
xrandr`
#include <X11/extensions/Xrandr.h>
#include <stdio.h>

int main(int argc, char ** argv)
{
  Display * display = XOpenDisplay(":0.0");
  int screen = DefaultScreen( display );
  Window w = RootWindow(display, screen);
  XRRScreenResources * res = XRRGetScreenResources(display, w);
  for(int i=0; i < res->noutput; ++i)
  {
    XRROutputInfo * output_info = XRRGetOutputInfo( display, res,
res->outputs[i]);
    if(output_info->crtc)
    {
      XRRCrtcInfo * crtc_info = XRRGetCrtcInfo( display, res,
                                                output_info->crtc );
      unsigned int pixel_width = crtc_info->width,
                   pixel_height = crtc_info->height;
      float xdpi = pixel_width * 25.4f / (float)output_info->mm_width,
            ydpi = pixel_height * 25.4f / (float)output_info->mm_height;
      printf( "[%d] %upx x %upx  Dimensions: %limm x %limm  DPI: %.02f x
%.02f\n",
              i, pixel_width, pixel_height,
              output_info->mm_width, output_info->mm_height,
              xdpi, ydpi );
    }
    XRRFreeOutputInfo( output_info );
  }
  XRRFreeScreenResources(res);
  XCloseDisplay( display );

  return 0;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.



More information about the Unassigned-bugs mailing list