TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.54K subscribers
Post #20635 95
UnigramDev/Unigram/gallery-close-input • 3dd9796 • 1 files, +39/-6
Stop the gallery from taking input while it closes

Closing the gallery is animated: OnBackRequestedOverride calls Unload()
synchronously, which drops the data context, while Hide() only runs when the
closing animation completes. In between the window is still visible and still
hit-testable, so a click on a caption hyperlink ran Caption_TextEntityClick
with a null ViewModel and crashed in the MessageDelegate constructor
(NullReferenceException, reported by crash telemetry on 12.9.1). The caption
sits outside ScrollingHost, so the tap-to-close handler never consumes it.

Unload() now clears IsHitTestVisible, which closes the whole "input after
unload" family instead of one handler at a time; Caption_TextEntityClick is
guarded as well, because a focused hyperlink can still be invoked from the
keyboard or by automation, neither of which hit tests.

Also fix the same method leaving the window on screen forever: the connected
animation's Completed was subscribed before TryStart, and when TryStart failed
translate became false, so neither Hide() was reachable. Hide() now runs off
the fade batch, which is started on every path, and Completed is subscribed
only when the animation actually started.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

#unigram
More from @tgappsupdates
  1. Oct 13, 2026DrKLO/Telegram/master • 368b6b7 • 76 files, +4839/-2232 update to 13.0.1 (7166) DrKLO/Tele…
  2. Oct 13, 2026DrKLO/Telegram/master • 5e56d34 • 300 files, +66212/-64519 update to 13.0.0 (7158) #androi…
  3. Oct 13, 2026telegramdesktop/tdesktop/dev • 1ac3eeb • 3 files, +36/-1 Keep channel direct messages open…
  4. Oct 13, 2026TelegramMessenger/tgcalls/development • c0b4139 • 6 files, +1117/-379 v2: InstanceV2Compat…
  5. Oct 13, 2026DrKLO/Telegram/master • 8274071 • 4 files, +9/-1 update submodules #android
  6. Oct 13, 2026telegramdesktop/tdesktop/dev • a5b479e • 1 files, +13/-3 Ignore clicks on the busy local p…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →