Fix build for Xcode.

This commit is contained in:
John Preston 2019-06-06 15:01:01 +03:00
parent 0868a9f7b9
commit b674003868
3 changed files with 7 additions and 6 deletions

View File

@ -1060,10 +1060,10 @@ QPoint Application::getPointForCallPanelCenter() const {
// macOS Qt bug workaround, sometimes no leaveEvent() gets to the nested widgets. // macOS Qt bug workaround, sometimes no leaveEvent() gets to the nested widgets.
void Application::registerLeaveSubscription(QWidget *widget) { void Application::registerLeaveSubscription(QWidget *widget) {
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
if (auto topLevel = widget->window()) { if (const auto topLevel = widget->window()) {
if (topLevel == _window.get()) { if (topLevel == _window->widget()) {
auto weak = make_weak(widget); auto weak = make_weak(widget);
auto subscription = _window->leaveEvents( auto subscription = _window->widget()->leaveEvents(
) | rpl::start_with_next([weak] { ) | rpl::start_with_next([weak] {
if (const auto window = weak.data()) { if (const auto window = weak.data()) {
QEvent ev(QEvent::Leave); QEvent ev(QEvent::Leave);

View File

@ -39,6 +39,8 @@ public:
void updateWindowIcon() override; void updateWindowIcon() override;
class Private;
public slots: public slots:
void psShowTrayMenu(); void psShowTrayMenu();
@ -82,7 +84,6 @@ protected:
void closeWithoutDestroy() override; void closeWithoutDestroy() override;
private: private:
class Private;
friend class Private; friend class Private;
void initTouchBar(); void initTouchBar();

View File

@ -643,7 +643,7 @@ void MainWindow::createGlobalMenu() {
psContacts = window->addAction(lang(lng_mac_menu_contacts)); psContacts = window->addAction(lang(lng_mac_menu_contacts));
connect(psContacts, &QAction::triggered, psContacts, crl::guard(this, [=] { connect(psContacts, &QAction::triggered, psContacts, crl::guard(this, [=] {
if (isHidden()) { if (isHidden()) {
showFromTray(); App::wnd()->showFromTray();
} }
if (!account().sessionExists()) { if (!account().sessionExists()) {
return; return;
@ -652,7 +652,7 @@ void MainWindow::createGlobalMenu() {
box->addButton(langFactory(lng_close), [box] { box->closeBox(); }); box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); }); box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
})); }));
}); }));
psAddContact = window->addAction(lang(lng_mac_menu_add_contact), App::wnd(), SLOT(onShowAddContact())); psAddContact = window->addAction(lang(lng_mac_menu_add_contact), App::wnd(), SLOT(onShowAddContact()));
window->addSeparator(); window->addSeparator();
psNewGroup = window->addAction(lang(lng_mac_menu_new_group), App::wnd(), SLOT(onShowNewGroup())); psNewGroup = window->addAction(lang(lng_mac_menu_new_group), App::wnd(), SLOT(onShowNewGroup()));