From fa43134aa89beca07cf3976b4230a3717cfa3b18 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 25 Sep 2014 13:53:36 -0600 Subject: [PATCH] racket/gui win32: enable clipping-problem workaround for 32-bit mode The specialization to Win64 to work around a Cairo clipping problem probably had more to do with the version of Cairo, instead of the variant of Windows, since both variants need the workarounds after a Cairo upgrade. original commit: 641fa5f744bc61916c257ed8ca59f7480a91a75f --- pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/dc.rkt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/dc.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/dc.rkt index 541b0bd4..7b287b45 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/dc.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/dc.rkt @@ -31,6 +31,8 @@ (define hwnd-param (make-parameter #f)) +(define need-clip-workarounds? #t) + (define win32-bitmap% (class win32-no-hwnd-bitmap% (init w h hwnd [gl-config #f]) @@ -74,9 +76,8 @@ ;; Work around a Cairo(?) bug. When a clipping ;; region is set, we draw text, and then the clipping ;; region is changed, the change doesn't take - ;; until we draw more text --- but only under Win64, - ;; and only with DDB surfaces. - (when win64? + ;; until we draw more text --- but only with DDB surfaces. + (when need-clip-workarounds? (let ([bm (internal-get-bitmap)]) (when (bm . is-a? . win32-bitmap%) (SelectClipRgn (cairo_win32_surface_get_dc @@ -130,11 +131,11 @@ (define sh (->screen (unbox h))) (define r (make-RECT 0 0 sw sh)) (define clip-type - (if win64? + (if need-clip-workarounds? (GetClipBox hdc r) SIMPLEREGION)) (cond - [(and win64? + [(and need-clip-workarounds? (not (and (= clip-type SIMPLEREGION) (= (RECT-left r) 0) (= (RECT-top r) 0)