Fix SeparatePanel fullscreen origin on Windows - #342
Conversation
…ows. Frameless showFullScreen() can resize without moving to the screen origin (QTBUG-39537), leaving Mini Apps unusable mid-screen. Force the panel onto the current screen geometry after entering fullscreen. Fixes telegramdesktop/tdesktop#30963. Co-authored-by: Cursor <cursoragent@cursor.com>
| if (fullscreen) { | ||
| showFullScreen(); | ||
| // On Windows, frameless showFullScreen() may resize without moving to | ||
| // the screen origin (QTBUG-39537). Mini apps then stay anchored at the |
There was a problem hiding this comment.
You're referencing a fixed Qt bug
QTBUG-39357 is fixed long time ago while QTBUG-86899 seem to be completely unrelated (it claims maximized windows behave like fullscreen ones on non-primary monitors and hide taskbar which doesn't seem to be the problem here)? |
|
The root cause could be not a Qt bug at all but our bug: Qt positions windows automatically only unless setGeometry() or move() are called, RpWidget initializes with zero geometry. The Linux transient parent code path already works around that by setting WA_Moved attribute to false, maybe the same should be done before showFullscreen(). |
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, instead of forcing geometry after the fact. Fixes telegramdesktop/tdesktop#30963. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks, that matches what the Qt sources do.
The previous patch also fought Qt: Updated to the same workaround as the Linux transient-parent path in |
|
@ilya-fedin thanks again for the review. #342 was the wrong approach (QTBUG citations + Opened a clean PR with the |
|
Superseded by #343. |
Summary
showFullScreen(), explicitly move/resize the framelessSeparatePanelto the current screen geometry.Context
Reported in telegramdesktop/tdesktop#30963 (also referenced by #31041 / #31114).
Root cause matches QTBUG-39537 / QTBUG-86899 for frameless windows:
QWidget::showFullScreen()applies the fullscreen size but drops the move to the screen origin. Media viewer already works around this by setting screen geometry explicitly; Mini Apps useSeparatePanel, which previously only called plainshowFullScreen().Test plan
web_app_request_fullscreen— panel should cover the full screen from the monitor origin.Made with Cursor