From 7acd95b07cac0b84be82892b7decf74c14912b7c Mon Sep 17 00:00:00 2001 From: sraibaby Date: Thu, 20 Aug 2026 13:34:43 +0300 Subject: [PATCH 1/2] Fix SeparatePanel fullscreen staying at pre-fullscreen origin on Windows. 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 --- ui/widgets/separate_panel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/widgets/separate_panel.cpp b/ui/widgets/separate_panel.cpp index 504d29d2b..becd44d78 100644 --- a/ui/widgets/separate_panel.cpp +++ b/ui/widgets/separate_panel.cpp @@ -1388,6 +1388,17 @@ void SeparatePanel::toggleFullScreen(bool fullscreen) { _fullscreen = fullscreen; if (fullscreen) { showFullScreen(); + // On Windows, frameless showFullScreen() may resize without moving to + // the screen origin (QTBUG-39537). Mini apps then stay anchored at the + // pre-fullscreen panel position - see telegramdesktop/tdesktop#30963. + if (const auto current = screen() + ? screen() + : QGuiApplication::primaryScreen()) { + const auto geometry = current->geometry(); + if (this->geometry() != geometry) { + Ui::SetGeometryAndScreen(this, geometry); + } + } } else { showNormal(); } From 233a63f40ee4354e8344c8d11dae8beefb87f664 Mon Sep 17 00:00:00 2001 From: sraibaby Date: Sat, 22 Aug 2026 10:13:16 +0300 Subject: [PATCH 2/2] Fix SeparatePanel fullscreen origin by clearing WA_Moved. 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 --- ui/widgets/separate_panel.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/widgets/separate_panel.cpp b/ui/widgets/separate_panel.cpp index becd44d78..c48fa448a 100644 --- a/ui/widgets/separate_panel.cpp +++ b/ui/widgets/separate_panel.cpp @@ -1387,18 +1387,14 @@ QRect SeparatePanel::innerGeometry() const { void SeparatePanel::toggleFullScreen(bool fullscreen) { _fullscreen = fullscreen; if (fullscreen) { + // RpWidget's constructor calls setGeometry(0, 0, 0, 0), which sets + // WA_Moved. After that Qt treats the panel as explicitly positioned + // and QWidget::show() / QWidgetPrivate::create pass that position to + // the QWindow instead of letting the platform place a fullscreen + // window at the screen origin (resize-only). Same workaround as the + // Linux transient-parent path in initGeometry(). + setAttribute(Qt::WA_Moved, false); showFullScreen(); - // On Windows, frameless showFullScreen() may resize without moving to - // the screen origin (QTBUG-39537). Mini apps then stay anchored at the - // pre-fullscreen panel position - see telegramdesktop/tdesktop#30963. - if (const auto current = screen() - ? screen() - : QGuiApplication::primaryScreen()) { - const auto geometry = current->geometry(); - if (this->geometry() != geometry) { - Ui::SetGeometryAndScreen(this, geometry); - } - } } else { showNormal(); }