Skip to content

Fix SeparatePanel fullscreen origin by clearing WA_Moved - #343

Open
anriltine wants to merge 1 commit into
desktop-app:masterfrom
HyperlinksSpace:fix-separate-panel-fullscreen-wa-moved
Open

Fix SeparatePanel fullscreen origin by clearing WA_Moved#343
anriltine wants to merge 1 commit into
desktop-app:masterfrom
HyperlinksSpace:fix-separate-panel-fullscreen-wa-moved

Conversation

@anriltine

@anriltine anriltine commented Aug 22, 2026

Copy link
Copy Markdown

Summary

  • Clear Qt::WA_Moved on SeparatePanel before showFullScreen(), so Qt can place the frameless Mini App panel at the screen origin instead of only resizing it.
  • Follows the Linux transient-parent path in initGeometry(), which already clears WA_Moved after RpWidget's constructor setGeometry(0, 0, 0, 0).

Context

Reported in telegramdesktop/tdesktop#30963 (also #31041 / #31114).

This supersedes #342. That PR forced screen geometry after showFullScreen() and blamed QTBUG-39537 / QTBUG-86899. @ilya-fedin pointed out those bugs are unrelated/fixed, and that the real issue is likely ours: Qt only auto-positions unless setGeometry() / move() were called, so WA_Moved from RpWidget keeps Mini Apps anchored at the pre-fullscreen origin.

Forcing SetGeometryAndScreen() after showFullScreen() is also the wrong tool: setGeometry_sys() clears Qt::WindowFullScreen when not inside setWindowState().

Test plan

  • Windows, single monitor: open a Mini App, enter fullscreen via UI or web_app_request_fullscreen — panel should cover the full screen from the monitor origin.
  • Windows, two monitors: main Telegram window mid-primary; open Mini App fullscreen — panel should cover the primary screen, not remain centered over the main window and overflow.
  • Open a Mini App that requests fullscreen immediately — same full-screen origin.
  • Exit fullscreen — panel returns to the normal anchored size/position.
  • Linux/macOS smoke: Mini App fullscreen still enters/exits correctly.

Made with Cursor

RpWidget's zero setGeometry sets WA_Moved, so Qt treats the panel as
explicitly positioned and showFullScreen() only resizes. Clear that
attribute first, matching the Linux transient-parent workaround.

Fixes telegramdesktop/tdesktop#30963.

Co-authored-by: Cursor <cursoragent@cursor.com>
@anriltine

Copy link
Copy Markdown
Author

@ilya-fedin this is the clean follow-up to #342 using setAttribute(Qt::WA_Moved, false) before showFullScreen(), as you suggested.

@ilya-fedin

Copy link
Copy Markdown
Contributor

You checked it works, right?

@anriltine

Copy link
Copy Markdown
Author

No, included the test plan)

@ilya-fedin

Copy link
Copy Markdown
Contributor

Please tell when you have checked it works

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