Skip to content

Commit

Permalink
fullscreen DEBUG output
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Mar 1, 2023
1 parent 6451fae commit 31239c8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/controllers/keyboard/keyboardeventfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
18 changes: 18 additions & 0 deletions src/mixxxmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ MixxxMainWindow::MixxxMainWindow(std::shared_ptr<mixxx::CoreServices> pCoreServi
}

void MixxxMainWindow::initialize() {
qWarning() << " $ initialize";
m_pCoreServices->getControlIndicatorTimer()->setLegacyVsyncEnabled(true);

UserSettingsPointer pConfig = m_pCoreServices->getSettings();
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -441,6 +443,7 @@ MixxxMainWindow::~MixxxMainWindow() {
}

void MixxxMainWindow::initializeWindow() {
qWarning() << " $ initializeWindow";
// be sure createMenuBar() is called first
DEBUG_ASSERT(m_pMenuBar);

Expand Down Expand Up @@ -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<WMainMenuBar>(
Expand All @@ -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,
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions src/widget/wmainmenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}

Expand All @@ -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
Expand Down

0 comments on commit 31239c8

Please sign in to comment.