From be043a4437e06d92216fa201a3183ee7a78b9714 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 19 Jul 2018 17:27:09 +0300 Subject: [PATCH] Remove BypassWindowManagerHint in MediaView / Passport. It makes all kinds of usages buggy, including choose file dialog. Fixes #4936. I hope fixes #4950, I hope fixes #4955, I hope fixes #3553. --- Telegram/SourceFiles/boxes/peer_list_box.cpp | 3 ++- Telegram/SourceFiles/boxes/peer_list_box.h | 1 + Telegram/SourceFiles/calls/calls_panel.cpp | 2 +- .../dialogs/dialogs_inner_widget.cpp | 2 +- .../admin_log/history_admin_log_inner.cpp | 2 +- .../history/history_inner_widget.cpp | 2 +- .../view/history_view_context_menu.cpp | 2 +- .../feed/info_feed_channels_controllers.cpp | 3 ++- .../feed/info_feed_channels_controllers.h | 1 + .../info/media/info_media_list_widget.cpp | 15 ++++++++---- .../info/media/info_media_list_widget.h | 6 ++--- .../info_profile_members_controllers.cpp | 4 +++- Telegram/SourceFiles/mediaview.cpp | 9 +++---- .../platform/linux/file_utilities_linux.cpp | 9 ++++--- .../platform/linux/specific_linux.cpp | 2 -- .../profile/profile_block_group_members.cpp | 2 +- .../profile/profile_channel_controllers.cpp | 3 ++- .../profile/profile_channel_controllers.h | 1 + .../SourceFiles/ui/widgets/input_fields.cpp | 6 ++--- Telegram/SourceFiles/ui/widgets/labels.cpp | 2 +- .../SourceFiles/ui/widgets/popup_menu.cpp | 24 +++++++++++-------- Telegram/SourceFiles/ui/widgets/popup_menu.h | 4 ++-- .../SourceFiles/ui/widgets/separate_panel.cpp | 1 - Telegram/SourceFiles/window/main_window.cpp | 1 - .../window/notifications_manager_default.cpp | 5 +++- 25 files changed, 66 insertions(+), 46 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index bdc3ff835..3c6afd5d7 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -251,6 +251,7 @@ void PeerListController::setSearchNoResultsText(const QString &text) { } base::unique_qptr PeerListController::rowContextMenu( + QWidget *parent, not_null row) { return nullptr; } @@ -1020,7 +1021,7 @@ void PeerListContent::contextMenuEvent(QContextMenuEvent *e) { } if (const auto row = getRow(_contexted.index)) { - _contextMenu = _controller->rowContextMenu(row); + _contextMenu = _controller->rowContextMenu(this, row); if (_contextMenu) { _contextMenu->setDestroyedCallback(crl::guard( this, diff --git a/Telegram/SourceFiles/boxes/peer_list_box.h b/Telegram/SourceFiles/boxes/peer_list_box.h index 889a15cbc..ea453acc0 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.h +++ b/Telegram/SourceFiles/boxes/peer_list_box.h @@ -345,6 +345,7 @@ public: virtual void itemDeselectedHook(not_null peer) { } virtual base::unique_qptr rowContextMenu( + QWidget *parent, not_null row); bool isSearchLoading() const { return _searchController ? _searchController->isLoading() : false; diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 65b97134e..e006eb5d5 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -415,7 +415,7 @@ void Panel::reinitControls() { } void Panel::initLayout() { - setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) | Qt::WindowStaysOnTopHint | Qt::BypassWindowManagerHint | Qt::NoDropShadowWindowHint | Qt::Dialog); + setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) | Qt::WindowStaysOnTopHint | Qt::NoDropShadowWindowHint | Qt::Dialog); setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_NoSystemBackground, true); setAttribute(Qt::WA_TranslucentBackground, true); diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 7286273a1..47983d1e4 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -1514,7 +1514,7 @@ void DialogsInner::contextMenuEvent(QContextMenuEvent *e) { mousePressReleased(_pressButton); } - _menu = base::make_unique_q(nullptr); + _menu = base::make_unique_q(this); if (const auto history = key.history()) { Window::FillPeerMenu( _controller, diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index bdea6dbe4..8af1a4a38 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -941,7 +941,7 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { isUponSelected = hasSelected; } - _menu = base::make_unique_q(nullptr); + _menu = base::make_unique_q(this); const auto link = ClickHandler::getActive(); auto view = App::hoveredItem() diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 0b72042ca..06cbeffb6 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1456,7 +1456,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { isUponSelected = hasSelected; } - _menu = base::make_unique_q(nullptr); + _menu = base::make_unique_q(this); const auto addItemActions = [&](HistoryItem *item) { if (!item diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index cc71185e8..f0d71dd72 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -434,7 +434,7 @@ void AddCopyLinkAction( base::unique_qptr FillContextMenu( not_null list, const ContextMenuRequest &request) { - auto result = base::make_unique_q(nullptr); + auto result = base::make_unique_q(list); const auto link = request.link; const auto view = request.view; diff --git a/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.cpp b/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.cpp index da68598d3..b605eec6f 100644 --- a/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.cpp +++ b/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.cpp @@ -188,11 +188,12 @@ void ChannelsController::rowActionClicked(not_null row) { } base::unique_qptr ChannelsController::rowContextMenu( + QWidget *parent, not_null row) { auto my = static_cast(row.get()); auto channel = my->history()->peer->asChannel(); - auto result = base::make_unique_q(nullptr); + auto result = base::make_unique_q(parent); Window::PeerMenuAddMuteAction(channel, [&]( const QString &text, Fn handler) { diff --git a/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.h b/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.h index 4f5af6943..905190409 100644 --- a/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.h +++ b/Telegram/SourceFiles/info/feed/info_feed_channels_controllers.h @@ -33,6 +33,7 @@ public: std::unique_ptr createRestoredRow( not_null peer) override; base::unique_qptr rowContextMenu( + QWidget *parent, not_null row) override; std::unique_ptr saveState() const override; diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index c9774cd36..c84847800 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -929,6 +929,10 @@ void ListWidget::markLayoutsStale() { } } +bool ListWidget::preventAutoHide() const { + return (_contextMenu != nullptr) || (_actionBoxWeak != nullptr); +} + void ListWidget::saveState(not_null memento) { if (_universalAroundId != kDefaultAroundId) { auto state = countScrollState(); @@ -1165,7 +1169,6 @@ void ListWidget::showContextMenu( QContextMenuEvent *e, ContextMenuSource source) { if (_contextMenu) { - _contextMenu->deleteLater(); _contextMenu = nullptr; repaintItem(_contextUniversalId); } @@ -1217,7 +1220,7 @@ void ListWidget::showContextMenu( auto link = ClickHandler::getActive(); - _contextMenu = new Ui::PopupMenu(nullptr); + _contextMenu = base::make_unique_q(this); _contextMenu->addAction( lang(lng_context_to_msg), [itemFullId = item->fullId()] { @@ -1347,7 +1350,6 @@ void ListWidget::showContextMenu( _contextMenu->setDestroyedCallback(crl::guard( this, [this, universalId] { - _contextMenu = nullptr; mouseActionUpdate(QCursor::pos()); repaintItem(universalId); _checkForHide.fire({}); @@ -2121,7 +2123,12 @@ auto ListWidget::findSectionAfterBottom( [](const Section §ion) { return section.top(); }); } -ListWidget::~ListWidget() = default; +ListWidget::~ListWidget() { + if (_contextMenu) { + // We don't want it to be called after ListWidget is destroyed. + _contextMenu->setDestroyedCallback(nullptr); + } +} } // namespace Media } // namespace Info diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.h b/Telegram/SourceFiles/info/media/info_media_list_widget.h index 2940e16fe..249258494 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.h +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.h @@ -61,9 +61,7 @@ public: rpl::producer<> checkForHide() const { return _checkForHide.events(); } - bool preventAutoHide() const { - return (_contextMenu != nullptr) || (_actionBoxWeak != nullptr); - } + bool preventAutoHide() const; void saveState(not_null memento); void restoreState(not_null memento); @@ -304,7 +302,7 @@ private: DragSelectAction _dragSelectAction = DragSelectAction::None; bool _wasSelectedText = false; // was some text selected in current drag action - Ui::PopupMenu *_contextMenu = nullptr; + base::unique_qptr _contextMenu; rpl::event_stream<> _checkForHide; QPointer _actionBoxWeak; rpl::lifetime _actionBoxWeakLifetime; diff --git a/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp b/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp index 775fd4c27..108a3ec73 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp @@ -40,6 +40,7 @@ public: void rowClicked(not_null row) override; void rowActionClicked(not_null row) override; base::unique_qptr rowContextMenu( + QWidget *parent, not_null row) override; rpl::producer onlineCountValue() const override { @@ -266,12 +267,13 @@ void ChatMembersController::rowActionClicked( } base::unique_qptr ChatMembersController::rowContextMenu( + QWidget *parent, not_null row) { auto my = static_cast(row.get()); auto user = my->user(); auto canRemoveMember = my->canRemove(); - auto result = base::make_unique_q(nullptr); + auto result = base::make_unique_q(parent); result->addAction( lang(lng_context_view_profile), [weak = base::make_weak(this), user] { diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 313d6a922..385ea4413 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -117,7 +117,7 @@ MediaView::MediaView() }); handleAuthSessionChange(); - setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::Tool | Qt::NoDropShadowWindowHint); + setWindowFlags(Qt::FramelessWindowHint); moveToScreen(); setAttribute(Qt::WA_NoSystemBackground, true); setAttribute(Qt::WA_TranslucentBackground, true); @@ -125,7 +125,7 @@ MediaView::MediaView() hide(); createWinId(); - if (cPlatform() == dbipWindows) { + if (cPlatform() != dbipMac && cPlatform() != dbipMacOld) { setWindowState(Qt::WindowFullScreen); } @@ -165,7 +165,8 @@ void MediaView::moveToScreen() { if (activeWindowScreen && myScreen && myScreen != activeWindowScreen) { windowHandle()->setScreen(activeWindowScreen); } - auto available = activeWindow ? Sandbox::screenGeometry(activeWindow->geometry().center()) : QApplication::desktop()->screenGeometry(); + const auto screen = activeWindowScreen ? activeWindowScreen : QApplication::primaryScreen(); + const auto available = screen->geometry(); if (geometry() != available) { setGeometry(available); } @@ -2847,7 +2848,7 @@ void MediaView::contextMenuEvent(QContextMenuEvent *e) { _menu->deleteLater(); _menu = 0; } - _menu = new Ui::PopupMenu(nullptr, st::mediaviewPopupMenu); + _menu = new Ui::PopupMenu(this, st::mediaviewPopupMenu); updateActions(); for_const (auto &action, _actions) { _menu->addAction(action.text, this, action.member); diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index df4cfbe9a..26ffcb7fb 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -247,9 +247,6 @@ GtkDialog *QGtkDialog::gtkDialog() const { } void QGtkDialog::exec() { - if (auto w = App::wnd()) { - w->reActivateWindow(); - } if (modality() == Qt::ApplicationModal) { // block input to the whole app, including other GTK dialogs Libs::gtk_dialog_run(gtkDialog()); @@ -413,6 +410,12 @@ int GtkFileDialog::exec() { show(); + if (const auto parent = parentWidget()) { + App::CallDelayed(200, parent, [=] { + parent->activateWindow(); + }); + } + QPointer guard = this; d->exec(); if (guard.isNull()) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 8122b7f14..759b9e815 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -94,11 +94,9 @@ QRect psDesktopRect() { } void psShowOverAll(QWidget *w, bool canFocus) { - w->show(); } void psBringToBack(QWidget *w) { - w->hide(); } QAbstractNativeEventFilter *psNativeEventFilter() { diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp index 709c48961..5565384cb 100644 --- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp +++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp @@ -221,7 +221,7 @@ Ui::PopupMenu *GroupMembersWidget::fillPeerMenu(PeerData *selectedPeer) { return nullptr; } auto user = selectedPeer->asUser(); - auto result = new Ui::PopupMenu(nullptr); + auto result = new Ui::PopupMenu(this); result->addAction(lang(lng_context_view_profile), [selectedPeer] { Ui::showPeerProfile(selectedPeer); }); diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp index 165e3ae17..92b8695d1 100644 --- a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp +++ b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp @@ -704,11 +704,12 @@ bool ParticipantsBoxController::canRestrictUser( } base::unique_qptr ParticipantsBoxController::rowContextMenu( + QWidget *parent, not_null row) { Expects(row->peer()->isUser()); auto user = row->peer()->asUser(); - auto result = base::make_unique_q(nullptr); + auto result = base::make_unique_q(parent); result->addAction( lang(lng_context_view_profile), [weak = base::make_weak(this), user] { diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.h b/Telegram/SourceFiles/profile/profile_channel_controllers.h index d7a975691..a63d17ace 100644 --- a/Telegram/SourceFiles/profile/profile_channel_controllers.h +++ b/Telegram/SourceFiles/profile/profile_channel_controllers.h @@ -70,6 +70,7 @@ public: void rowClicked(not_null row) override; void rowActionClicked(not_null row) override; base::unique_qptr rowContextMenu( + QWidget *parent, not_null row) override; void loadMoreRows() override; diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index c1c4b807a..afcbdd7fd 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -1004,7 +1004,7 @@ void FlatInput::refreshPlaceholder() { void FlatInput::contextMenuEvent(QContextMenuEvent *e) { if (auto menu = createStandardContextMenu()) { - (new Ui::PopupMenu(nullptr, menu))->popup(e->globalPos()); + (new Ui::PopupMenu(this, menu))->popup(e->globalPos()); } } @@ -3170,7 +3170,7 @@ bool InputField::revertFormatReplace() { void InputField::contextMenuEventInner(QContextMenuEvent *e) { if (const auto menu = _inner->createStandardContextMenu()) { addMarkdownActions(menu, e); - _contextMenu = base::make_unique_q(nullptr, menu); + _contextMenu = base::make_unique_q(this, menu); _contextMenu->popup(e->globalPos()); } } @@ -3670,7 +3670,7 @@ void MaskedInputField::setPlaceholder(Fn placeholderFactory) { void MaskedInputField::contextMenuEvent(QContextMenuEvent *e) { if (auto menu = createStandardContextMenu()) { - (new Ui::PopupMenu(nullptr, menu))->popup(e->globalPos()); + (new Ui::PopupMenu(this, menu))->popup(e->globalPos()); } } diff --git a/Telegram/SourceFiles/ui/widgets/labels.cpp b/Telegram/SourceFiles/ui/widgets/labels.cpp index f685aa78c..d1420b94f 100644 --- a/Telegram/SourceFiles/ui/widgets/labels.cpp +++ b/Telegram/SourceFiles/ui/widgets/labels.cpp @@ -539,7 +539,7 @@ void FlatLabel::showContextMenu(QContextMenuEvent *e, ContextMenuReason reason) uponSelection = hasSelection; } - _contextMenu = new Ui::PopupMenu(nullptr); + _contextMenu = new Ui::PopupMenu(this); if (fullSelection && !_contextCopyText.isEmpty()) { _contextMenu->addAction(_contextCopyText, this, SLOT(onCopyContextText())); diff --git a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp index b56767f64..1ce30aa6b 100644 --- a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp +++ b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp @@ -16,20 +16,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Ui { -PopupMenu::PopupMenu(QWidget*, const style::PopupMenu &st) -: _st(st) +PopupMenu::PopupMenu(QWidget *parent, const style::PopupMenu &st) +: RpWidget(parent) +, _st(st) , _menu(this, _st.menu) { init(); } -PopupMenu::PopupMenu(QWidget*, QMenu *menu, const style::PopupMenu &st) -: _st(st) +PopupMenu::PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st) +: RpWidget(parent) +, _st(st) , _menu(this, menu, _st.menu) { init(); for (auto action : actions()) { if (auto submenu = action->menu()) { - auto it = _submenus.insert(action, new PopupMenu(nullptr, submenu, st)); + auto it = _submenus.insert(action, new PopupMenu(parentWidget(), submenu, st)); it.value()->deleteOnHide(false); } } @@ -274,7 +276,6 @@ void PopupMenu::childHiding(PopupMenu *child) { _activeSubmenu = SubmenuPointer(); } if (!_hiding && !isHidden()) { - windowHandle()->requestActivate(); activateWindow(); } } @@ -474,16 +475,19 @@ void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource sou psUpdateOverlayed(this); show(); psShowOverAll(this); - windowHandle()->requestActivate(); activateWindow(); } PopupMenu::~PopupMenu() { - for (auto submenu : base::take(_submenus)) { + for (const auto submenu : base::take(_submenus)) { delete submenu; } - if (auto w = App::wnd()) { - w->reActivateWindow(); + if (const auto parent = parentWidget()) { + crl::on_main(parent, [=] { + if (!parent->isHidden()) { + parent->activateWindow(); + } + }); } if (_destroyedCallback) { _destroyedCallback(); diff --git a/Telegram/SourceFiles/ui/widgets/popup_menu.h b/Telegram/SourceFiles/ui/widgets/popup_menu.h index 99da81690..4e550de1c 100644 --- a/Telegram/SourceFiles/ui/widgets/popup_menu.h +++ b/Telegram/SourceFiles/ui/widgets/popup_menu.h @@ -16,8 +16,8 @@ namespace Ui { class PopupMenu : public Ui::RpWidget, private base::Subscriber { public: - PopupMenu(QWidget*, const style::PopupMenu &st = st::defaultPopupMenu); - PopupMenu(QWidget*, QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu); + PopupMenu(QWidget *parent, const style::PopupMenu &st = st::defaultPopupMenu); + PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu); QAction *addAction(const QString &text, const QObject *receiver, const char* member, const style::icon *icon = nullptr, const style::icon *iconOver = nullptr); QAction *addAction(const QString &text, Fn callback, const style::icon *icon = nullptr, const style::icon *iconOver = nullptr); diff --git a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp index bdf422f5c..5ef59b6bf 100644 --- a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp +++ b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp @@ -143,7 +143,6 @@ bool SeparatePanel::eventHook(QEvent *e) { void SeparatePanel::initLayout() { setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) | Qt::WindowStaysOnTopHint - | Qt::BypassWindowManagerHint | Qt::NoDropShadowWindowHint | Qt::Dialog); setAttribute(Qt::WA_MacAlwaysShowToolWindow); diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 8242e0918..e423a690f 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -427,7 +427,6 @@ void MainWindow::reActivateWindow() { if (auto f = QApplication::focusWidget()) { f->clearFocus(); } - windowHandle()->requestActivate(); w->activate(); if (auto f = QApplication::focusWidget()) { f->clearFocus(); diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index ffd513171..631f9fd05 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -360,7 +360,10 @@ Widget::Widget(Manager *manager, QPoint startPosition, int shift, Direction shif , _a_shift(animation(this, &Widget::step_shift)) { setWindowOpacity(0.); - setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) | Qt::WindowStaysOnTopHint | Qt::BypassWindowManagerHint | Qt::NoDropShadowWindowHint | Qt::Tool); + setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) + | Qt::WindowStaysOnTopHint + | Qt::NoDropShadowWindowHint + | Qt::Tool); setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_OpaquePaintEvent);