Reacting to a message (or opening the emoji/reply panel) freezes the app for several seconds; the whole system lags during the stall. Reproducible every time.
Environment:
Telegram macOS 12.8 (282010)
macOS 26.5.1 (25F80)
MacBook Pro Mac15,7, Apple M3 Pro, 18 GB RAM
Built-in Liquid Retina XDR, wide-gamut P3 / EDR
Steps:
Open a chat.
Open the reactions panel on a message.
App hangs several seconds; cursor beachballs, system lags.
Root cause (from a live sample during the freeze): the main thread blocks on synchronous per-pixel color-space conversion while drawing reaction/emoji images:
Repeated CGColorTransformCreateCGCMSConverter too: converters are recreated and run per draw. Image colorspace != XDR wide-gamut destination, so CoreGraphics does a full vImage CMS conversion on every draw, on the main thread. With many images in the reaction grid this serializes into a multi-second UI hang; WindowServer waits on the blocked main thread, causing system-wide lag.
Suggested fix:
Decode/convert reaction/emoji images off the main thread.
Cache the converted bitmap in the destination colorspace so the CMS conversion doesn't run on every CGContextDrawImage.
Pre-tag image colorspace to match the display to skip the CMS path on XDR.