From 9d1b8b0a93a5d8df10ea6ea55159efbbe3bd65e1 Mon Sep 17 00:00:00 2001 From: Leon Richardt Date: Tue, 22 Nov 2022 02:15:08 +0100 Subject: [PATCH] fix: don't parent popup windows on Windows OS (#4181) Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: pajlada fix https://github.com/Chatterino/chatterino2/issues/3863 fix https://github.com/Chatterino/chatterino2/issues/4180 --- CHANGELOG.md | 1 + src/singletons/WindowManager.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3777a74ae..972eb3443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Bugfix: Fixed being unable to see the usercard of VIPs who have Asian language display names. (#4174) - Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177) +- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181) ## 2.4.0-beta diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index 4d4b61ae3..49b7e58de 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -262,12 +262,18 @@ Window &WindowManager::createWindow(WindowType type, bool show, QWidget *parent) return parent; } + // FIXME: On Windows, parenting popup windows causes unwanted behavior (see + // https://github.com/Chatterino/chatterino2/issues/4179 for discussion). Ideally, we + // would use a different solution rather than relying on OS-specific code but this is + // the low-effort fix for now. +#ifndef Q_OS_WIN if (type == WindowType::Popup) { // On some window managers, popup windows require a parent to behave correctly. See // https://github.com/Chatterino/chatterino2/pull/1843 for additional context. return &(this->getMainWindow()); } +#endif // If no parent is set and something other than a popup window is being created, we fall // back to the default behavior of no parent.