Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mixxxdj/mixxx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a94fe730bfa08315794029d12c707d9032d9970a
Choose a base ref
..
head repository: mixxxdj/mixxx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7e58af72e1e8b181e60bcad38940b693e1483d60
Choose a head ref
Showing with 35 additions and 0 deletions.
  1. +31 −0 src/mixxx.cpp
  2. +4 −0 src/mixxx.h
31 changes: 31 additions & 0 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
@@ -168,6 +168,9 @@ MixxxMainWindow::MixxxMainWindow(QApplication* pApp, const CmdlineArgs& args)
m_toolTipsCfg(mixxx::TooltipsPreference::TOOLTIPS_ON),
m_runtime_timer("MixxxMainWindow::runtime"),
m_cmdLineArgs(args),
#ifdef __LINUX__
m_recreateMenubarOnFullscreenToggle(false),
#endif
m_pTouchShift(nullptr) {
m_runtime_timer.start();
mixxx::Time::start();
@@ -213,6 +216,18 @@ MixxxMainWindow::MixxxMainWindow(QApplication* pApp, const CmdlineArgs& args)
initializeKeyboard();
installEventFilter(m_pKeyboard);

#ifdef __LINUX__
// If true this will recreate and reconnect the mainmenu bar when toggling
// fullscreen in order to fix
// "No menu bar with ubuntu unity in full screen mode"
// https://github.com/mixxxdj/mixxx/issues/6072 (bugs #885890 and #1076789).
// Before touching anything here, please read those bugs.
// 'unity' seems to be the only affectde desktop environment
// Alternative global menus work without this currently, e.g. vala-panel-appmenu
m_recreateMenubarOnFullscreenToggle =
QString::fromLocal8Bit(qgetenv("XDG_SESSION_DESKTOP")) == "unity";
#endif

// Menubar depends on translations.
mixxx::Translations::initializeTranslations(
m_pSettingsManager->settings(), pApp, args.getLocale());
@@ -1426,10 +1441,26 @@ void MixxxMainWindow::slotViewFullScreen(bool toggle) {
if (isFullScreen() == toggle) {
return;
}
qInfo() << " ~" << m_recreateMenubarOnFullscreenToggle;

if (toggle) {
showFullScreen();
#ifdef __LINUX__
if (m_recreateMenubarOnFullscreenToggle) {
createMenuBar();
connectMenuBar();
if (m_pMenuBar->isNativeMenuBar()) {
m_pMenuBar->setNativeMenuBar(false);
}
}
#endif
} else {
#ifdef __LINUX__
if (m_recreateMenubarOnFullscreenToggle) {
createMenuBar();
connectMenuBar();
}
#endif
showNormal();
}
emit fullScreenChanged(toggle);
4 changes: 4 additions & 0 deletions src/mixxx.h
Original file line number Diff line number Diff line change
@@ -181,6 +181,10 @@ class MixxxMainWindow : public QMainWindow {

const CmdlineArgs& m_cmdLineArgs;

#ifdef __LINUX__
bool m_recreateMenubarOnFullscreenToggle;
#endif

ControlPushButton* m_pTouchShift;
mixxx::ScreenSaverPreference m_inhibitScreensaver;