| [ 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: | |
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
|
| 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); | |
|
| 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. | |
|
| Added a second version of the DPI detection code to prefere explicite Xft.dpi XResource setting, as used by for instance KDE, over XRandR. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |