Use the main window as the parent to all user cards on macOS (#2185)

This commit is contained in:
pajlada
2020-11-15 14:40:34 +01:00
committed by GitHub
parent 540870f9fe
commit 53c96097c9
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -39,6 +39,7 @@
#include "util/Twitch.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/TooltipWidget.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/dialogs/UserInfoPopup.hpp"
#include "widgets/helper/EffectLabel.hpp"
@@ -1965,8 +1966,14 @@ void ChannelView::hideEvent(QHideEvent *)
void ChannelView::showUserInfoPopup(const QString &userName)
{
QWidget *userCardParent = this;
#ifdef Q_OS_MACOS
// Order of closing/opening/killing widgets when the "Automatically close user info popups" setting is enabled is special on macOS, so user info popups should always use the main window as its parent
userCardParent =
static_cast<QWidget *>(&(getApp()->windows->getMainWindow()));
#endif
auto *userPopup =
new UserInfoPopup(getSettings()->autoCloseUserPopup, this);
new UserInfoPopup(getSettings()->autoCloseUserPopup, userCardParent);
userPopup->setData(userName, this->hasSourceChannel()
? this->sourceChannel_
: this->underlyingChannel_);