diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 049e6c46de..43c7b34864 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -301,7 +301,7 @@ QImage Panel::Button::prepareRippleMask() const { } Panel::Panel(not_null call) -: RpWidget(App::wnd()) +: RpWidget(Core::App().getModalParent()) , _call(call) , _user(call->user()) , _answerHangupRedial(this, st::callAnswer, &st::callHangup) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 4f54e30ebf..5c0713ec70 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -767,6 +767,13 @@ void Application::notifyFileDialogShown(bool shown) { } } +QWidget *Application::getModalParent() { + return QGuiApplication::platformName().startsWith(qsl("wayland"), Qt::CaseInsensitive) + ? App::wnd() + : nullptr; +} + + void Application::checkMediaViewActivation() { if (_mediaView && !_mediaView->isHidden()) { _mediaView->activateWindow(); diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index b4cf4c11d2..b3be0aa4bf 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -101,6 +101,7 @@ public: bool minimizeActiveWindow(); QWidget *getFileDialogParent(); void notifyFileDialogShown(bool shown); + QWidget *getModalParent(); // Media view interface. void checkMediaViewActivation(); diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp index ccc0f867df..38e166246b 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp @@ -431,7 +431,7 @@ NotificationsCount::~NotificationsCount() { NotificationsCount::SampleWidget::SampleWidget( NotificationsCount *owner, const QPixmap &cache) -: QWidget(App::wnd()) +: QWidget(Core::App().getModalParent()) , _owner(owner) , _cache(cache) { const QSize size( diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index 32eb32dbb4..51303a908e 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -375,7 +375,7 @@ Widget::Widget( QPoint startPosition, int shift, Direction shiftDirection) -: TWidget(App::wnd()) +: TWidget(Core::App().getModalParent()) , _manager(manager) , _startPosition(startPosition) , _direction(shiftDirection)