1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

macOS: Fix global menu with multiple windows.

- Closes #2261
This commit is contained in:
srazi 2017-03-20 11:37:33 +03:30
parent 9af542aa03
commit 345d03105f
4 changed files with 8 additions and 3 deletions

View File

@ -346,20 +346,20 @@ void BrowserWindow::setupMenu()
if (!macMainMenu) {
macMainMenu = new MainMenu(this, 0);
macMainMenu->initMenuBar(new QMenuBar(0));
connect(mApp, SIGNAL(activeWindowChanged(BrowserWindow*)), macMainMenu, SLOT(setWindow(BrowserWindow*)));
}
else {
macMainMenu->setWindow(this);
}
m_mainMenu = macMainMenu;
m_mainMenu->initSuperMenu(m_superMenu);
#else
setMenuBar(new MenuBar(this));
m_mainMenu = new MainMenu(this, this);
m_mainMenu->initMenuBar(menuBar());
m_mainMenu->initSuperMenu(m_superMenu);
#endif
m_mainMenu->initSuperMenu(m_superMenu);
// Setup other shortcuts
QShortcut* reloadBypassCacheAction = new QShortcut(QKeySequence(QSL("Ctrl+F5")), this);

View File

@ -845,6 +845,8 @@ void MainApplication::onFocusChanged()
if (activeBrowserWindow) {
m_lastActiveWindow = activeBrowserWindow;
emit activeWindowChanged(m_lastActiveWindow);
}
}

View File

@ -121,6 +121,7 @@ public slots:
signals:
void settingsReloaded();
void activeWindowChanged(BrowserWindow* window);
private slots:
void postLaunch();

View File

@ -38,13 +38,15 @@ class QUPZILLA_EXPORT MainMenu : public QMenu
public:
explicit MainMenu(BrowserWindow* window, QWidget* parent = 0);
void setWindow(BrowserWindow* window);
void initMenuBar(QMenuBar* menuBar) const;
void initSuperMenu(QMenu* superMenu) const;
QAction* action(const QString &name) const;
public slots:
void setWindow(BrowserWindow* window);
private slots:
// Standard actions
void showAboutDialog();