X11 can perform accurate DPI and fractional scaling by querying physical screen dimensions with XRR and adjusting OpenGL drawing parameters.
By computing a pixel radius from screen width in pixels and millimeters, the author draws a constant two-inch circle across multiple monitors.
The implementation uses XRRGetScreenResourcesCurrent to gather mm_width, resolution, and screen positions, then updates the shader uniform radius on ConfigureNotify events.
Demonstrated consistency across a laptop display, desktop monitor, and 4K TV, highlighting that scaling is possible despite common beliefs.
Consumer display advertised sizes can be inaccurate; the author noted a discrepancy in the TV’s actual width, underscoring the need for calibration.
An onscreen ruler tool was also created using the X11 shape extension to verify terminal line height measurements.
Get notified when new stories are published for "General AI News"