STR #3273

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | Post Text | Post File | Prev | Next ]

STR #3273

Application:FLTK Library
Status:5 - New
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:X11
Summary:Fl::screen_dpi() returns generic Xinerama values
Version:1.3.3
Created By:kub
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
 
#1 kub
05:37 Jan 07, 2016
XRandRfl.cxx
1k
 
 
#2 kub
00:00 Jan 10, 2016
XRandRfl_v2.cxx
2k
 
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
 
#1 kub
04:15 Jan 07, 2016
src/screen_xywh.cxx screen_init() uses Xinarama to detect DPI values (DisplayWidthMM()...). These are just generic ones. This code could be improved by using the XRandR API to detect mm_width and mm_height, which appear more useful.


Goal provide scaling infos about high resolution displays, like retina or other high DPI ones. That will allow to adjust font sizes and window geometries.


Basic code snippet:
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]);
  printf( "width(mm): %li  height(mm): %li\n",
          output_info->mm_width, output_info->mm_height );
  XRRFreeOutputInfo( output_info );
}
XRRFreeScreenResources(res);
 
 
#2 kub
12:07 Jan 07, 2016
Here a link to a patch for implementing proper high DPI scaling in a application. Fl::screen_dpi() is not used if XRandR is available:
https://github.com/oyranos-cms/icc-examin/commit/2aa0c727b1010171caed40931d0a2a8a7df196a4#diff-3fb5e3d98b305e43d14ae092abd95ef2R2061

Instead the proposed XRandR based DPI detection is implemented.
 
 
#3 kub
00:01 Jan 10, 2016
Added a second version of the DPI detection code to prefere explicite Xft.dpi XResource setting, as used by for instance KDE, over XRandR.  
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.