mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-07 18:15:05 +00:00
Don't show PopupMenu for inactive window on macOS.
On macOS context menu (right click) doesn't activate the window that was clicked. - You can't activate it yourself if some other application is active. - It's hard to make menu work while window still is inactive (like macOS menus). Because when you left-click anything after right click Qt makes the window something-like-focused (it shows on top and receives input), but not really (it still displays as inactive, cursor not blinking and all). Looks like Qt bug.
This commit is contained in:
parent
8cc0fbc687
commit
06bf67c146
@ -423,6 +423,12 @@ void PopupMenu::popup(const QPoint &p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource source) {
|
void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource source) {
|
||||||
|
if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) {
|
||||||
|
if (!parent && !static_cast<QApplication*>(QApplication::instance())->activeWindow()) {
|
||||||
|
crl::on_main(this, [=] { show(); hideFast(); });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
_parent = parent;
|
_parent = parent;
|
||||||
|
|
||||||
auto origin = PanelAnimation::Origin::TopLeft;
|
auto origin = PanelAnimation::Origin::TopLeft;
|
||||||
|
Loading…
Reference in New Issue
Block a user