From 31239c8f5b957c41086bfc567a35ec251a0f2c96 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Wed, 1 Mar 2023 10:30:44 +0100 Subject: [PATCH] fullscreen DEBUG output --- .../keyboard/keyboardeventfilter.cpp | 2 +- src/mixxxmainwindow.cpp | 18 ++++++++++++++++++ src/widget/wmainmenubar.cpp | 19 +++++++++---------- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/controllers/keyboard/keyboardeventfilter.cpp b/src/controllers/keyboard/keyboardeventfilter.cpp index 18a150f1d166..673431854ea6 100644 --- a/src/controllers/keyboard/keyboardeventfilter.cpp +++ b/src/controllers/keyboard/keyboardeventfilter.cpp @@ -135,7 +135,7 @@ bool KeyboardEventFilter::eventFilter(QObject*, QEvent* e) { // which no [key] PRESS was registered. if (m_altPressedWithoutKey && ke->key() == Qt::Key_Alt) { if (ke->key() != m_prevKeyReleased) { - qWarning() << " >> Alt only release"; + qWarning() << " ALT-only release"; } emit altPressedWithoutKeys(); } diff --git a/src/mixxxmainwindow.cpp b/src/mixxxmainwindow.cpp index e55ca990bc10..50fb2c56701a 100644 --- a/src/mixxxmainwindow.cpp +++ b/src/mixxxmainwindow.cpp @@ -102,6 +102,7 @@ MixxxMainWindow::MixxxMainWindow(std::shared_ptr pCoreServi } void MixxxMainWindow::initialize() { + qWarning() << " $ initialize"; m_pCoreServices->getControlIndicatorTimer()->setLegacyVsyncEnabled(true); UserSettingsPointer pConfig = m_pCoreServices->getSettings(); @@ -136,6 +137,7 @@ void MixxxMainWindow::initialize() { if ((CmdlineArgs::Instance().getStartInFullscreen() || fullscreenPref) && // could be we're fullscreen already after setGeomtery(previousGeometry) !isFullScreen()) { + qWarning() << " init: go fullscreen"; showFullScreen(); } @@ -441,6 +443,7 @@ MixxxMainWindow::~MixxxMainWindow() { } void MixxxMainWindow::initializeWindow() { + qWarning() << " $ initializeWindow"; // be sure createMenuBar() is called first DEBUG_ASSERT(m_pMenuBar); @@ -641,6 +644,7 @@ void MixxxMainWindow::slotUpdateWindowTitle(TrackPointer pTrack) { } void MixxxMainWindow::createMenuBar() { + qWarning() << " $ createMenuBar"; ScopedTimer t("MixxxMainWindow::createMenuBar"); DEBUG_ASSERT(m_pCoreServices->getKeyboardConfig()); m_pMenuBar = make_parented( @@ -654,6 +658,7 @@ void MixxxMainWindow::createMenuBar() { void MixxxMainWindow::connectMenuBar() { // This function might be invoked multiple times on startup // so all connections must be unique! + qWarning() << " $ connectMenuBar"; ScopedTimer t("MixxxMainWindow::connectMenuBar"); connect(this, @@ -905,15 +910,19 @@ void MixxxMainWindow::slotDeveloperToolsClosed() { } void MixxxMainWindow::slotViewFullScreen(bool toggle) { + qWarning() << " $ slotViewFullScreen" << toggle; if (isFullScreen() == toggle) { + qWarning() << " (no-op)"; return; } // Just switch the window state here. eventFilter() will catch the // QWindowStateChangeEvent and inform the menu bar that fullscreen changed. if (toggle) { + qWarning() << " > showFullScreen()"; showFullScreen(); } else { + qWarning() << " > showNormal()"; showNormal(); } } @@ -1128,11 +1137,20 @@ bool MixxxMainWindow::eventFilter(QObject* obj, QEvent* event) { const bool isFullScreenNow = windowState() & Qt::WindowFullScreen; if ((isFullScreenNow && !wasFullScreen) || (!isFullScreenNow && wasFullScreen)) { + qWarning() << " ."; + if (isFullScreenNow && !wasFullScreen) { + qWarning() << " $ WindowStateChange: enter fullscreen"; + } else { + qWarning() << " $ WindowStateChange: leave fullscreen"; + } #ifdef __LINUX__ createMenuBar(); connectMenuBar(); #endif #endif + qWarning() << " > emit fullScreenChanged(" << isFullScreen() << ")"; + qWarning() << " ."; + // This will toggle the Fullscreen checkbox and hide the menubar if // we go fullscreen. // Skip this during startup or the launchimage will be shifted diff --git a/src/widget/wmainmenubar.cpp b/src/widget/wmainmenubar.cpp index dc539f6a1ede..81b13ed3aec3 100644 --- a/src/widget/wmainmenubar.cpp +++ b/src/widget/wmainmenubar.cpp @@ -694,12 +694,13 @@ void WMainMenuBar::onDeveloperToolsHidden() { } void WMainMenuBar::onFullScreenStateChange(bool fullscreen) { - qWarning() << " onFullScreenStateChange" << fullscreen; + qWarning() << " $ onFullScreenStateChange" << fullscreen; if (fullscreen) { #ifdef __LINUX__ // Menu bar has been recreated and reconnected, which is a requirement // to setNativeMenuBar() without issues (reported on Ubuntu with Unity desktop) if (isNativeMenuBar()) { + qWarning() << " > is native, move to window"; // move the menu bar to the window setNativeMenuBar(false); } @@ -721,10 +722,9 @@ void WMainMenuBar::connectMenuToSlotShowMenuBar(const QMenu* pMenu) { } void WMainMenuBar::slotToggleMenuBar() { - qWarning() << " ."; - qWarning() << " .slotToggleMenuBar"; + qInfo() << " $ slotToggleMenuBar"; if (isNativeMenuBar()) { - qWarning() << " ...isNative"; + qInfo() << " > isNative, return"; return; } @@ -738,22 +738,21 @@ void WMainMenuBar::slotToggleMenuBar() { } void WMainMenuBar::showMenuBar() { - qWarning() << " ."; - qWarning() << " .showMenuBar"; + qInfo() << " $ showMenuBar()"; if (isNativeMenuBar()) { - qWarning() << " ...isNative"; + qInfo() << " > isNative, return"; return; } int height = sizeHint().height(); + qInfo() << " > setMinimumHeight(" << height << ")"; setMinimumHeight(height); } void WMainMenuBar::hideMenuBar() { - qWarning() << " ."; - qWarning() << " .hideMenuBar"; + qInfo() << " $ hideMenuBar()"; if (isNativeMenuBar()) { - qWarning() << " ...isNative"; + qInfo() << " > isNative, return"; return; } // don't use setHidden(bool) because hotkeys wouldn't work anymore