Skip to content

Commit

Permalink
Don't use probably broken QMenuBar::setNativeMenuBar(false)
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 5, 2023
1 parent a8abcc6 commit 010abe8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ MixxxMainWindow::MixxxMainWindow(QApplication* pApp, const CmdlineArgs& args)
mixxx::Translations::initializeTranslations(
m_pSettingsManager->settings(), pApp, args.getLocale());

#ifdef __LINUX__
// If the desktop features a global menubar and we go fullscreen during
// startup, move the menubar to the window like in slotViewFullScreen()
bool fullscreenPref = m_pSettingsManager->settings()->getValue<bool>(
ConfigKey("[Config]", "StartInFullscreen"));
QApplication::setAttribute(
Qt::AA_DontUseNativeMenuBar,
args.getStartInFullscreen() || fullscreenPref);
#endif // __LINUX__
createMenuBar();
m_pMenuBar->hide();

Expand Down Expand Up @@ -265,13 +274,6 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) {
ConfigKey("[Config]", "StartInFullscreen"));
if (args.getStartInFullscreen() || fullscreenPref) {
showFullScreen();
#ifdef __LINUX__
// If the desktop features a global menubar and we go fullscreen during
// startup, move the menubar to the window like in slotViewFullScreen()
if (m_pMenuBar->isNativeMenuBar()) {
m_pMenuBar->setNativeMenuBar(false);
}
#endif
}

QString resourcePath = pConfig->getResourcePath();
Expand Down Expand Up @@ -1438,14 +1440,13 @@ void MixxxMainWindow::slotViewFullScreen(bool toggle) {
// Fix for "No menu bar with ubuntu unity in full screen mode" Bug
// #885890 and Bug #1076789. Before touching anything here, please read
// those bugs.
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
createMenuBar();
connectMenuBar();
if (m_pMenuBar->isNativeMenuBar()) {
m_pMenuBar->setNativeMenuBar(false);
}
#endif
} else {
#ifdef __LINUX__
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
createMenuBar();
connectMenuBar();
#endif
Expand Down

0 comments on commit 010abe8

Please sign in to comment.