Skip to content

Commit

Permalink
Merge remote-tracking branch 'mixxx/2.3' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Mar 7, 2023
2 parents f47475a + 572cee8 commit 8bd698c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
29 changes: 20 additions & 9 deletions src/mixxxmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ MixxxMainWindow::MixxxMainWindow(std::shared_ptr<mixxx::CoreServices> pCoreServi
m_toolTipsCfg(mixxx::TooltipsPreference::TOOLTIPS_ON) {
DEBUG_ASSERT(pCoreServices);
// These depend on the settings
#ifdef __LINUX__
// If the desktop features a global menubar and we'll go fullscreen during
// startup, set Qt::AA_DontUseNativeMenuBar so the menubar is placed in the
// window like it's done in slotViewFullScreen(). On other desktops this
// attribute has no effect. This is a safe alternative to setNativeMenuBar()
// which can cause a crash when using menu shortcuts like Alt+F after resetting
// the menubar. See https://github.com/mixxxdj/mixxx/issues/11320
bool fullscreenPref = m_pCoreServices->getSettings()->getValue<bool>(
ConfigKey("[Config]", "StartInFullscreen"));
QApplication::setAttribute(
Qt::AA_DontUseNativeMenuBar,
CmdlineArgs::Instance().getStartInFullscreen() || fullscreenPref);
#endif // __LINUX__
createMenuBar();
m_pMenuBar->hide();

Expand Down Expand Up @@ -127,10 +140,7 @@ void MixxxMainWindow::initialize() {
bool fullscreenPref = m_pCoreServices->getSettings()->getValue<bool>(
ConfigKey("[Config]", "StartInFullscreen"));
if (CmdlineArgs::Instance().getStartInFullscreen() || fullscreenPref) {
// If the desktop features a global menubar and we go fullscreen during
// startup, we need to move the menubar to the window, so instead of
// showFullScreen() simply call slotViewFullScreen(true)
slotViewFullScreen(true);
showFullScreen();
}

initializationProgressUpdate(65, tr("skin"));
Expand Down Expand Up @@ -868,17 +878,18 @@ void MixxxMainWindow::slotViewFullScreen(bool toggle) {
if (toggle) {
showFullScreen();
#ifdef __LINUX__
// Fix for "No menu bar with ubuntu unity in full screen mode" Bug
// #885890 and Bug #1076789. Before touching anything here, please read
// Fix for "No menu bar with ubuntu unity in full screen mode" (issues
// #885890 and #1076789. Before touching anything here, please read
// those bugs.
// Set this attribute instead of calling setNativeMenuBar(false), see
// https://github.com/mixxxdj/mixxx/issues/11320
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
2 changes: 1 addition & 1 deletion src/widget/wsearchlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ void WSearchLineEdit::updateClearAndDropdownButton(const QString& text) {

// Ensure the text is not obscured by the clear button. Otherwise no text,
// no clear button, so the placeholder should use the entire width.
int innerHeight = height() - 2 * kBorderWidth;
const int innerHeight = height() - 2 * kBorderWidth;
const int paddingPx = text.isEmpty() ? 0 : innerHeight;
const QString clearPos(layoutDirection() == Qt::RightToLeft ? "left" : "right");

Expand Down

0 comments on commit 8bd698c

Please sign in to comment.