diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/canvas.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/canvas.rkt index 0a84def6..4a9a7937 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/canvas.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/canvas.rkt @@ -158,6 +158,8 @@ (define hwnd (or panel-hwnd canvas-hwnd)) (define dc #f) + (define next-scroll-is-change? #f) + (super-new [parent parent] [hwnd hwnd] [extra-hwnds (if panel-hwnd @@ -237,7 +239,15 @@ (when vscroll? (on-scroll-change SB_VERT (LOWORD wParam))) 0] - [else (super wndproc w msg wParam lParam default)])) + [else + (when (= msg WM_GESTURE) + ;; The fall-though wndproc might generate a WM_*SCROLL + ;; event for us, but we need to force an update, + ;; because the generated event happens after the position + ;; is changed. And if it doesn't generate a scroll, then + ;; it's ok to have an occassional spurious update. + (set! next-scroll-is-change? #t)) + (super wndproc w msg wParam lParam default)])) (define/override (wndproc-for-ctlproc w msg wParam lParam default) ;; act on clicks for a combo field: @@ -492,7 +502,9 @@ [(= part SB_PAGEDOWN) (min (SCROLLINFO-nMax i) (+ (SCROLLINFO-nPos i) (SCROLLINFO-nPage i)))] [(= part SB_THUMBTRACK) (SCROLLINFO-nTrackPos i)] [else (SCROLLINFO-nPos i)])]) - (unless (= new-pos (SCROLLINFO-nPos i)) + (unless (or (= new-pos (SCROLLINFO-nPos i)) + next-scroll-is-change?) + (set! next-scroll-is-change? #f) (set-SCROLLINFO-nPos! i new-pos) (set-SCROLLINFO-fMask! i SIF_POS) (SetScrollInfo canvas-hwnd dir i #t) diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/const.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/const.rkt index 0bbba5c8..db8a20c7 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/const.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/const.rkt @@ -65,6 +65,8 @@ (define WM_POWER #x0048) +(define WM_GESTURE #x0119) + ;; wParam for WM_POWER window message and DRV_POWER driver notification (define PWR_OK 1) (define PWR_FAIL -1)