fix: don't parent popup windows on Windows OS (#4181)
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com> fix https://github.com/Chatterino/chatterino2/issues/3863 fix https://github.com/Chatterino/chatterino2/issues/4180
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user