racket / racket/gui

Flickering problems of canvas without focus on MacOS

Open
#198 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

To reproduce:

  1. run this program
#lang racket/gui
(require mrlib/hierlist)

(define f (new frame% [label ""] [width 640] [height 480]))
(define hl (new hierarchical-list% [parent f]))
;(send hl set-scroll-via-copy #t)
(for ([i (in-range 1000)])
  (send+ hl
         (new-item)
         (get-editor)
         (insert (number->string i))))
(send f show #t)
  1. focus on other windows
  2. move the cursor to this window without focusing on it
  3. scrolling

This problem only occurs on Mac when racket window doesn't have focus. Also, uncomment the (send hl set-scroll-via-copy #t) can avoid this problem. Though I use hierlist in this example, it seems other canvas also have similar problems when updating without focus.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided racket/gui reproduction with mrlib/hierlist on macOS, then compare scrolling while the window is focused and unfocused. Check the effect of set-scroll-via-copy and whether other canvas updates show the same flicker. Done means unfocused scrolling and canvas updates no longer flicker without requiring that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.