Commit 9477974
committed
[GTK] Use primary monitor for device zoom on multi-monitor setups
Display._getDeviceZoom(long) ignored its monitor argument and always
queried the monitor at virtual coordinate (0,0), so every monitor
returned by getMonitors() reported the (0,0) monitor's scale factor on
X11/Xwayland. Device.getDeviceZoom() did the same on GTK3 for the
initial Display zoom.
On mixed-DPI multi-monitor setups this caused shells opened on a
non-(0,0) monitor to be sized for the wrong scale: e.g. a HiDPI laptop
panel sitting at the top-left of the virtual screen made shells on a
standard-density secondary monitor render at 2x.
Honor the passed monitor handle in _getDeviceZoom and pick the GDK
primary monitor for the initial zoom on GTK3, falling back to the
(0,0) monitor only when no primary is available (e.g. on Wayland).
Fixes #32731 parent 81a811a commit 9477974
2 files changed
Lines changed: 24 additions & 6 deletions
File tree
- bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt
- graphics
- widgets
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
1107 | 1108 | | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | | - | |
| 1111 | + | |
1111 | 1112 | | |
1112 | 1113 | | |
1113 | 1114 | | |
| |||
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6256 | 6256 | | |
6257 | 6257 | | |
6258 | 6258 | | |
6259 | | - | |
| 6259 | + | |
6260 | 6260 | | |
6261 | 6261 | | |
6262 | 6262 | | |
6263 | 6263 | | |
6264 | 6264 | | |
6265 | | - | |
6266 | | - | |
6267 | | - | |
6268 | | - | |
| 6265 | + | |
| 6266 | + | |
| 6267 | + | |
| 6268 | + | |
| 6269 | + | |
| 6270 | + | |
| 6271 | + | |
6269 | 6272 | | |
6270 | 6273 | | |
6271 | 6274 | | |
| 6275 | + | |
| 6276 | + | |
| 6277 | + | |
| 6278 | + | |
| 6279 | + | |
| 6280 | + | |
| 6281 | + | |
| 6282 | + | |
| 6283 | + | |
| 6284 | + | |
| 6285 | + | |
| 6286 | + | |
| 6287 | + | |
| 6288 | + | |
6272 | 6289 | | |
6273 | 6290 | | |
6274 | 6291 | | |
| |||
0 commit comments