Visitar URL original
fix: Release the current ToolTip when it closes (backport #25137, #26096) by ajpinedam · Pull Request #26098 · unoplatform/uno · GitHub
Skip to content

fix: Release the current ToolTip when it closes (backport #25137, #26096) - #26098

Merged
ajpinedam merged 3 commits into
unoplatform:servicing/6.8from
ajpinedam:dev/anpi/tooltip-release-closed-6.8
Nov 5, 2026
Merged

ajpinedam merged 3 commits into
unoplatform:servicing/6.8from
ajpinedam:dev/anpi/tooltip-release-closed-6.8

Conversation

@ajpinedam

@ajpinedam ajpinedam commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes unoplatform/kahua-private#565

PR Type:

🐞 Bugfix

What changed? 🚀

servicing/6.8 fix for the ToolTipService leak that #25137 fixes on master, together with the WinUI parity from #26096. #25137 also carries other ToolTip changes (#24592: popup parenting and DataContext) that servicing/6.8 does not have, so this is a standalone fix rather than a cherry-pick.

ToolTipService kept the last ToolTip it handled in its m_CurrentToolTip static after that ToolTip closed. A ToolTip references its owner, so once the owner left the visual tree the closed ToolTip still kept it alive, along with everything reachable from the owner's automation peer chain. It stayed rooted until another ToolTip took its place.

Changes

  • CloseToolTipImpl releases the ToolTip from the service, as WinUI's CancelAutomaticToolTip does. This also covers a pending ToolTip (hovered, not yet open). The show-duration timer closes through the same path.
  • Ported WinUI's m_bIsOpenAsAutomaticToolTip / s_bOpeningAutomaticToolTip. A ToolTip the service opened releases itself from the service when it closes by any other route (owner click, IsOpen = false). A ToolTip the app opens or closes is left to the app.
  • If the app opens the ToolTip itself while it waits to open, the service's timer no longer takes it over. In WinUI, OpenAutomaticToolTip's put_IsOpen(TRUE) changes nothing, so the service never holds that ToolTip. Before this change, the show-duration timer closed the app's ToolTip.

Testing

  • When_ToolTip_Closed_And_Owner_Removed_Then_Owner_Not_Rooted (rows: pending, owner removed, click, IsOpen = false): the owner is collected. All four rows fail on servicing/6.8 without the fix.
  • When_Automatic_ToolTip_Reopened_By_App_Then_ShowDuration_Does_Not_Close_It fails without the fix.
  • When_Pending_ToolTip_Opened_And_Closed_By_App_Then_Still_Opens_Automatically covers the parity: it is the test that fails on master after fix(tooltip): Let go of a ToolTip in the service when it closes, however it closed #25137. It opens and closes the ToolTip back to back, so it does not race the show delay. It also checks right away that the service still holds the pending ToolTip, using an internal ToolTipService.CurrentToolTipForTesting, as on master. It fails on that check if any close releases the ToolTip, which is master's behavior after fix(tooltip): Let go of a ToolTip in the service when it closes, however it closed #25137.
  • When_Pending_ToolTip_Opened_By_App_Then_ShowDuration_Does_Not_Close_It covers the app opening the ToolTip during the show delay. It fails without the fix.
  • Given_ToolTip passes 19/19 on Skia desktop (SamplesApp.Skia.Generic, net10.0).

PR Checklist ✅

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@Xiaoy312 Xiaoy312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything from #26096 is carried over: releasing on close only a ToolTip the service opened, not taking over a ToolTip the app opened during the show delay, the race-free pending test, and the two show-duration tests (with [GitHubWorkItem]).

@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ajpinedam
ajpinedam merged commit 22a6aeb into unoplatform:servicing/6.8 Nov 5, 2026
42 checks passed
@ajpinedam
ajpinedam deleted the dev/anpi/tooltip-release-closed-6.8 branch November 5, 2026 22:31
@ajpinedam

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Nov 10, 2026
…6.7/pr-26098

fix: Release the current ToolTip when it closes (backport #25137, #26096) (backport #26098)
mikernet added a commit to Singulink/uno that referenced this pull request Nov 14, 2026
Takes Uno's servicing/6.8 from 6951c2c up to 5254ace (42 pull
requests). Conflicts, by area:

IME and TextBox (unoplatform#25984, backport of unoplatform#25804; unoplatform#25952, backport of unoplatform#25619;
unoplatform#25976, backport of unoplatform#25818)
- Takes upstream's composition design (unoplatform#25804): the browser's input is
  the source of truth for the text, compositions included. This drops
  the composition parts of the unoplatform#24502 port (90746b8): its
  TypeScript composition handling, the StartIndex/TextChangePending
  event arguments, the IsReadOnly forwarding to the hidden input, and
  its Given_TextBox.BrowserSoftKeyboard tests.
- Keeps the non-IME browser fixes on top of it, in the form their
  master pull requests have on unoplatform#25804: Enter raised once per press and
  tracked by key code (unoplatform#25174, with Given_TextBox.BrowserEnterKey from
  master in place of the Enter tests that lived in the dropped file),
  the iOS refocus on tap (unoplatform#25185), pastes without text and isIOS from
  BrowserInputHelper.
- Moves the unoplatform#26005 MaxLength fixes onto unoplatform#25804's native input path, as
  master has them: a refused browser edit keeps the TextBox's selection,
  TextBoxView.UpdateTextFromNative reports whether the edit went in, and
  the IME keeps its range on the applied text (master be85699, which
  d226897 had ported onto the unoplatform#24502 IME). Adds that commit's browser
  and platform-applied IME tests.
- TextBox.pointers.skia.cs: upstream's file (unoplatform#25619 iOS touch editing,
  unoplatform#25818, unoplatform#25804), with the unoplatform#25126 port (the hold acts when it starts,
  a touch right-tap keeps the caret) in the form master's unoplatform#25126 branch
  has it on unoplatform#25619, including focusing before the iOS hold timer acts
  and its iOS not-focusable test.

Pointers (unoplatform#25976, backport of unoplatform#25818)
- Tapped and RightTapped are raised once the PointerReleased bubbled
  (unoplatform#25818), with the unoplatform#25732 port's window coordinates (2-argument
  routed event args, RawPosition for ContextRequested), as master's
  unoplatform#25732 branch has them.
- The release wrapper of unoplatform#25818 keeps the unoplatform#25126 port's
  StopContextMenuTimer at the start of the release.

DependencyObject (unoplatform#26142, backport of unoplatform#26123)
- Takes upstream, then the code of unoplatform#25839 (97a2f17), which replaces
  this branch's unoplatform#25102 ports (800247f, be41da6, fd40bf9,
  7546379). DependencyObjectStore.Binder.cs, .alc.cs,
  Application.Alc.cs, ResourceDictionary.alc.cs and their tests now
  match unoplatform#25839; this drops 800247f's own
  SingleParentNonFE_Parent_Removes_Value_Then_Next_Parent_Starts_Clean
  test, which unoplatform#25839 doesn't have.

Imaging (unoplatform#25597, unoplatform#25915, unoplatform#25911, unoplatform#25897)
- Keeps this branch's side: it has the later forms of these fixes
  (unoplatform#25124, unoplatform#25559, unoplatform#25633 and unoplatform#26370 ports), where upstream has the
  6.8-only unoplatform#25597 design and earlier snapshots. Upstream's shared
  download, IgnoreImageCache and failed-load fixes are covered by
  SharedImageDecode. Adds upstream's When_Source_Outlives_Brushes test.

ToolTip (unoplatform#26098, backport of unoplatform#25137 and unoplatform#26096)
- Keeps this branch's unoplatform#25137 port and adds unoplatform#26096 in master's form: the
  service releases only a ToolTip it opened, and leaves one the app
  opened during the show delay to the app. Keeps both sides' tests.

Flyout (unoplatform#26062, backport of unoplatform#26060)
- This branch had the same commits already; keeps the "Keep
  non-resizable flyouts in window" port and its tests.

Also removes a helper pair in Given_AccessibleTextBox that both sides
added.
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.

3 participants