mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-02 12:42:16 +00:00
Set parent for dialogs only on Wayland
This commit is contained in:
parent
b7aa60bedf
commit
be96bf2812
@ -301,7 +301,7 @@ QImage Panel::Button::prepareRippleMask() const {
|
||||
}
|
||||
|
||||
Panel::Panel(not_null<Call*> call)
|
||||
: RpWidget(App::wnd())
|
||||
: RpWidget(Core::App().getModalParent())
|
||||
, _call(call)
|
||||
, _user(call->user())
|
||||
, _answerHangupRedial(this, st::callAnswer, &st::callHangup)
|
||||
|
@ -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();
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
bool minimizeActiveWindow();
|
||||
QWidget *getFileDialogParent();
|
||||
void notifyFileDialogShown(bool shown);
|
||||
QWidget *getModalParent();
|
||||
|
||||
// Media view interface.
|
||||
void checkMediaViewActivation();
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user