simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Tue Apr 7 09:02:08 BST 2020


TL;DR:
  97a0dc0 GTK 3: handle nontrivial window scale factors.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2020-04-07 09:02:08

commit 97a0dc0fee0b9e7d1cd488309e03a19e942d1a57
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=97a0dc0fee0b9e7d1cd488309e03a19e942d1a57;hp=d71ac73d8a4397c35b21ec08388a1c6f94691b64
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Apr 7 06:50:20 2020 +0100

    GTK 3: handle nontrivial window scale factors.
    
    A user pointed out that if you run a GTK 3 puzzles with "GDK_SCALE=2"
    in the environment, the main game drawing area is blurred. That's
    because we're choosing the size of our backing Cairo surface based on
    the number of _logical_ pixels in the window size, not taking into
    account the fact that the non-unit scale factor means the number of
    physical pixels is larger. Everything 'works' in the basis - Cairo
    happily expands the smaller backing surface into the larger window -
    but resolution is lost in the process.
    
    Now we detect the window's scale factor, construct the backing surface
    appropriately, and compensate for that scaling when drawing to the
    surface and when blitting the surface to the window.

 gtk.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list