Skip to content

Large type tooltips cause visual artifacting on hover. #832

Open

Description

@Ryan-Ficklin
#lang typed/racket

(define zz
  (hash ;; hover here
   '+ + 
   '* *
   '- -
   '/ /))

zz ;; or hover here

Sufficiently large tooltips cause visual artifacts on hover. The easiest way I have found to reproduce this is a hash with values that have a huge union type capturing a large number of case->'s (as is the type for mapping to multiple arithmetic operators as seen above). The visual artifacts depend on the drracket font size. Hovering over the hash itself or the variable binding it (in this case zz) and using Ctrl+- or Ctrl+= to change the font size will cause stretching, blurring, or other artifacts of the tooltip text.
Image

Image

Regular hovering with no font size changing can also recreate the artifacts, but with a large enough tooltip, sometimes hovering will cease to draw the yellow canvas box at all (although do note that there is some visual warping at the bottom of the window).

Image

When reproducing this issue from a drracket instance launched from the command line, each attempt at hovering will cause the following warning to be thrown to the console:

$ drracket bug.rkt
(drracket:5582): Gdk-WARNING **: 17:34:24.589: Native Windows wider or taller than 32767 pixels are not supported

Environment

Version: Racket 9.3
OS: Debian 12
Desktop Environment: KDE Plasma

Activity

  1. rfindler commented on Oct 23, 2026

    @rfindler
    Member

    I've pushed a change to drracket that just drops the data when there are more than 100 lines or when any line is more than 100 characters wide. I think this should solve the problem, although I was not able to reproduce the exact bad behavior (I did get "cairo_t->C: argument is not non-null `cairo_t' pointer" errors under linux but not the strange artifacts), so I didn't close the PR. I would be curious to see if this helps your machine @Ryan-Ficklin. (If you don't build drracket from source, there will be a snapshot available tomorrow with this change, hopefully.)

    @greghendershott, the change I made was on the UI side, not the part that's reused by the racket mode. I tried this example out in racket-hash-lang-mode with racket-xp-mode turned on and I didn't see any problems; the type filled the visible portion of the buffer on my laptop screen but it didn't seem to cause any problems. Not sure I tried all the relevant things, however.

  2. greghendershott commented on Oct 23, 2026

    @greghendershott
    Contributor

    @rfindler Thanks for the heads up! And, thanks for making this change only in the UI.

    Although I don't want to jinx myself, I believe eldoc and eye candy like eldoc-box are fine with very large amounts of text.

    In fact one value for the Racket Mode customization variable racket-xp-eldoc-level is 'complete, which shows not just a bluebox but the full section of documentation including prose.

    When testing that I've seen quite a few overflows, and even crazy big examples (like the docs for match) just get clipped with no ill effects AFAICT.

  3. Ryan-Ficklin commented on Oct 25, 2026

    @Ryan-Ficklin
    Author

    @rfindler This fix seemed to work very nicely for every text size I tried. I could no longer reproduce the artifacts on hover, including hover during font size change. I have attached a few examples for sake of completion.

    Very Small Text
    Image

    Regular Text
    Image

    Somewhat Zoomed Text
    Image

  4. rfindler commented on Oct 25, 2026

    @rfindler
    Member

    Okay! Maybe the giant string was somehow turning into memory corruption somehow. Probably there is still some checks that need to be done at some lower level to guard against that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions