Skip to content

fix(tooltip): tooltip not appearing in RunMode::Lazy#179

Closed
Tom94 wants to merge 2 commits intomitsuba-renderer:masterfrom
Tom94:fix-lazy-tooltip
Closed

fix(tooltip): tooltip not appearing in RunMode::Lazy#179
Tom94 wants to merge 2 commits intomitsuba-renderer:masterfrom
Tom94:fix-lazy-tooltip

Conversation

@Tom94
Copy link
Copy Markdown
Contributor

@Tom94 Tom94 commented Sep 6, 2025

This commit adds a background thread that triggers a redraw m_tooltip_delay seconds after the last user interaction if the user was hovering a widget with tooltip at that point.

I settled on void* type erasure to avoid including <thread> -- let me know if you'd rather I use another method.

wjakob and others added 2 commits September 5, 2025 21:16
NanoGUI potentially spends a significant amount of runtime in the
functions ``nvgTextBounds()`` and ``nvgTextBoxBounds()`` that are used
to compute the preferred size of widgets.

This commit adopts a strategy that caches the preferred size in
bottom-level widgets (i.e., ones that don't layout a set of child
widgets).

The main complication is that various kinds of changes (setting
different captions, themes, etc.) can invalidate the precomputed
preferred size, so a relatively large number of setters need touchups.

;#
This commit adds a background thread that triggers a redraw 200ms after
the last user interaction if the user was hovering a widget with tooltip
at that point.
@wjakob wjakob force-pushed the master branch 4 times, most recently from c75898b to 1bbd038 Compare September 6, 2025 21:26
@wjakob
Copy link
Copy Markdown
Member

wjakob commented Sep 6, 2025

Hi Thomas -- I ended up implementing this slightly differently (but I am open to feedback/changes). See 9e27364. The idea is to sleep on a condition variable until a deadline, and this deadline which can be further postponed without having to explicitly talk to the other thread (it will just wake up after 200msec and realize that it can wait even longer). I think that this will be cheaper (fewer CPU wakeups, less work for the OS scheduler) than polling with 1 msec period.

@wjakob wjakob closed this Sep 6, 2025
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.

2 participants