Skip to content

Fix WebView dialog size feedback loop on Wayland - #147

Open
NEO-LAX wants to merge 1 commit into
desktop-app:masterfrom
NEO-LAX:agent/fix-wayland-webview-dialog-sizing
Open

Fix WebView dialog size feedback loop on Wayland#147
NEO-LAX wants to merge 1 commit into
desktop-app:masterfrom
NEO-LAX:agent/fix-wayland-webview-dialog-sizing

Conversation

@NEO-LAX

@NEO-LAX NEO-LAX commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • consume only the initial VerticalLayout::heightValue() emission when sizing WebView dialogs
  • prevent dialog content size changes from feeding back into the native window size

Problem

For WebView confirmation dialogs on Wayland, setInnerSize() can trigger another layout height update. Subscribing to every heightValue() emission feeds that update back into setInnerSize(), creating a positive size loop that rapidly stretches the dialog far beyond the monitor bounds.

The content height is needed for the initial dialog size only. Taking the first emission breaks the feedback loop for both blocking and asynchronous popup paths.

Validation

  • built and tested through Telegram Desktop 7.0.6 on Arch Linux
  • reproduced with a BotFather Mini App confirmation dialog under Hyprland 0.56.1
  • before: the dialog height grew from 2,958 px to 12,974 px
  • after: the same dialog remained stable at 355 x 142 px for repeated observations
  • confirmed the patch applies cleanly to the current master branch

@NEO-LAX
NEO-LAX marked this pull request as ready for review July 31, 2026 14:44
@ilya-fedin

Copy link
Copy Markdown
Contributor

Are you sure the bug is here? The description sounds you're fixing manifestation instead of the root cause as setting to the same value shouldn't enlarge it

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