Bug 1525 - SWT High-DPI X11/GTK: Wrong Scaling since SWT 4.36 (update)
Summary: SWT High-DPI X11/GTK: Wrong Scaling since SWT 4.36 (update)
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: swt (show other bugs)
Version: 2.6.0
Hardware: All all
: P4 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2025-08-22 06:17 CEST by Sven Gothel
Modified: 2025-08-22 06:18 CEST (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
21c52cf660ce4c7afbf4fcc796310357bb299d9b
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2025-08-22 06:17:37 CEST
After updating SWT to 4.36 (commit f71c29bace8ce579470b29e8e2aeca99e43f632a)
the dpi scaling on X11/GTK fails, e.g. via GDK_SCALE=2 environment variable.

## DPIUtil.autoScaleUp() and `useCairoAutoScale`
The (new) GTK implementation sets `useCairoAutoScale` to true,
avoiding scaling the window-coordinates up.
Hence we have to duplicate the scaleUp/scaleDown using the device scale-factor.

## GTK Scrollable.getClientAreaInPixels()
SWTAccessor.getClientAreaInPixels() uses Scrollable.getClientAreaInPixels(),
however the current GTK implementation doesn't returned the scaled value.
Hence we have to autoScaleUp.
Comment 1 Sven Gothel 2025-08-22 06:18:37 CEST
Resolved as described