Skip to content

fix(launcher): recreate tooltip window on resize so it tracks the new scaling (#2111) - #2352

Closed
Anai-Guo wants to merge 1 commit into
LostRuins:concedo_experimentalfrom
Anai-Guo:fix-tooltip-resize-2111
Closed

fix(launcher): recreate tooltip window on resize so it tracks the new scaling (#2111)#2352
Anai-Guo wants to merge 1 commit into
LostRuins:concedo_experimentalfrom
Anai-Guo:fix-tooltip-resize-2111

Conversation

@Anai-Guo

Copy link
Copy Markdown

Summary

Fixes #2111. After the user resizes the KoboldCpp launcher window, the floating tooltip windows shrink to a sliver too narrow to display any text.

Root cause: actually_resize calls ctk.set_widget_scaling(smallratio), which updates the global scaling for every CustomTkinter widget. The singleton tooltip (CTkToplevel + CTkLabel) was created before the resize and its internal geometry is now stale — on the next hover, update_idletasks() measures the outdated size and wm_geometry preserves it, leaving a near-zero-width window.

Fix: Declare gtooltip_box / gtooltip_label as nonlocal inside actually_resize and destroy/reset the pair immediately after set_widget_scaling. The next mouse-enter recreates the window cleanly under the new scale.

Test plan

  • Resize the launcher window to a smaller size
  • Hover over any setting to verify the tooltip displays correctly at the new window scale
  • Resize back to original size and verify tooltips still work

Assisted-by: Claude

🤖 Generated with Claude Code

… scaling (LostRuins#2111)

After a window resize, ctk.set_widget_scaling() updates the global
widget scale for every CustomTkinter widget.  The cached CTkToplevel
tooltip and its CTkLabel were created before the resize and their
internal geometry is stale — on the next hover update_idletasks()
measures the outdated size and wm_geometry preserves it, leaving a
near-zero-width window that cannot display any text.

Fix: add nonlocal gtooltip_box/gtooltip_label to actually_resize and
destroy/reset the pair right after set_widget_scaling().  The next
mouse-enter recreates the tooltip window cleanly under the new scale.

Signed-off-by: Tai An <antai12232931@anaiguo.com>
@Anai-Guo

Copy link
Copy Markdown
Author

Note for reviewer: the actual fix is just 4 lines in the actually_resize function. The large diff is because my fork base is behind upstream; the functional change is:

 def actually_resize(windowwidth,windowheight,lastpos,smallratio):
+    nonlocal gtooltip_box, gtooltip_label
     root.geometry(str(windowwidth) + "x" + str(windowheight) + str(lastpos))
     ctk.set_widget_scaling(smallratio)
+    if gtooltip_box:
+        gtooltip_box.destroy()
+        gtooltip_box = None
+        gtooltip_label = None

This destroys and resets the cached tooltip window after scale change so it is recreated fresh on the next hover.

@wbruna

wbruna commented Jul 20, 2026

Copy link
Copy Markdown

The large diff is because my fork base is behind upstream

Can't you rebase the PR branch on top of current concedo_experimental?

@LostRuins
LostRuins changed the base branch from concedo to concedo_experimental July 20, 2026 10:22
LostRuins added a commit that referenced this pull request Jul 20, 2026
@LostRuins

Copy link
Copy Markdown
Owner

rebase would be good but since this patch is tiny, i went ahead and added it directly. 01f2fa5

@LostRuins LostRuins closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After launcher window resized in Linux, tooltips popup windows become so narrow they cannot show a single letter

3 participants