]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0505: GTK4: text looks blurry on HiDPI displays v9.2.0505
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Wed, 20 May 2026 18:26:14 +0000 (18:26 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 20 May 2026 18:26:14 +0000 (18:26 +0000)
commitaed758986de7e677d63b1f6caa845938a2fabbdc
tree8ea408e5a409d45ac8010b097442359135b98296
parent146f46e26446f75a25457d8b00065f7057352d8e
patch 9.2.0505: GTK4: text looks blurry on HiDPI displays

Problem:  GTK4: text looks blurry on HiDPI displays
          (Foxe Chen, after v9.2.0501)
Solution: Allocate the cairo surface at physical resolution and set the
          device scale, recreate it on scale-factor changes
          (Yasuhiro Matsumoto).

The backing cairo image surface was created at logical pixel size, so
GTK4 upscaled it when blitting to the physical framebuffer. Allocate
the surface at width*scale x height*scale and apply
cairo_surface_set_device_scale() so drawing code keeps using logical
coordinates while the surface itself has full physical resolution.
Also recreate the surface on notify::scale-factor when the window
moves between monitors with different scales.

fixes:  #20252
closes: #20258

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui_gtk4.c
src/version.c