Repository navigation
GSToolTips: size tooltips according to GSScaleFactor - #970
Merged
Merged
Conversation
The tooltip window is made the size of the text as measured in points, but its frame is in screen units. With a user space scale factor other than 1 the window is too small by that factor and the text is cut off. Multiply the measured size by the window's scale factor before making the window.
fredkiefer
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GSToolTips: size the tooltip window for the user space scale factor
With a user space scale factor other than 1, tooltips are cut off: the window is made the size of the text as measured in points, but the window frame is in screen units, so it comes out too small by the scale factor.
To reproduce, run any application that sets a tool tip with
-GSScaleFactor 1.3(or setGSScaleFactorinNSGlobalDomain) and hover the view. A tooltip with cut off text is shown. With this change it is no longer cut off; at scale factor 1 nothing changes.-[GSToolTips _timedOut:]now multiplies the measured text size by the window'suserSpaceScaleFactorbefore creating the tooltip window; the window's content view is in points again, so the text fits it.cc @pkgdemon