-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fullscreen toggle rework #11313
Fullscreen toggle rework #11313
Conversation
bc163cf
to
5114479
Compare
31239c8
to
1a4d335
Compare
4cc5a19
to
70dbd1a
Compare
aedea6f
to
689c085
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just tested this a bit, with some results:
- "Enter" is still not equal pressing Ok
- The Menu bar disappears when going to fullscreen, which is OK, but it does not com back on window mode, which was my expectation. Maybe we should store the menu bar visible state for both independently. Default: Windowed = menu bar visible; Full-screen = menu bar hidden.
QKeySequence k; | ||
|
||
if (e->key() >= 0x01000020 && e->key() <= 0x01000023) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (e->key() >= 0x01000020 && e->key() <= 0x01000023) { | |
if (e->key() >= Qt::Key_Shift && e->key() <= Qt::Key_Alt) { |
And how about Qt::Key_AltGr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adopted in #11526
|
||
pLabelLayout->addStretch(); | ||
|
||
m_pOkayBtn = new QPushButton(tr("&Okay"), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_pOkayBtn = new QPushButton(tr("&Okay"), this); | |
m_pOkayBtn = new QPushButton(tr("&Ok"), this); |
@daschuer Thanks for testing! I'll respond to your comment in #11304 |
Ah, I was wondering why my pending review comments where lost. There where not lost. just picked the wrong branch. |
This modal popup is displayed every time when going fullscreen as long as the "Remind me again" checkbox is ticked when Okay is clicked. It can be styled to match the skin.
Now, slotViewFullScreen() just toggles fullscreen and eventFilter() catches ALL fullscreen changes, no matter the origin. Previously, slotViewFullScreen() was also reponsible for recreating and reconnecting the menu bar and for refreshing the Fullscreen checkbox. This is okay if only Mixxx could change the fullscreen state. However, it can happen that the (Linux) window manager consumes the fullscreen hotkey, makes Mixxx go fullscreen and slotViewFullScreen() is never called.
No-op QWindowStateChangeEvent can occur if another window (preferences, About, ...) is shown above MixxxMainWindow. The event's oldState() is QWindowNoState even though the window is and was fullscreen. Ignore these event to not recreate and reconnect the menu bar unnecessarily. Also, that avoids flickering, at least on desktops that feature a global menu (when going fullscreen the menu is moved to the main window and hidden immediately = rapid resizing of window content)
Closing in favor of #11566 |
This PR makes
MixxxMainWindow::slotViewFullScreen()
just toggle fullscreen.MixxxMainWindow::eventFilter()
catches ALL fullscreen changes (QWindowStateChangeEvent
), no matter the origin, and also emits a signal to recreate & connect the menu bar (only on Linux desktops that use a global menu) and hide it when going fullscreen (Linux & Windows).This works perfectly fine for me, and I'm curious how it performs on Windows and macOS. Please test!
Motivation
While working on #11304 I noticed that my window manager (xfwm4 on Ubuntu Studio) consumes the fullscreen hotkey F11 and
MixxxMainWindow::slotViewFullScreen()
never gets called, except when I click the menu checkbox.This happens because the fullscreen hotkey in Mixxx and in my window manager are identical.
(so most of my fullscreen testing was kinda worthless... : \ )
TODO
Testing
View
>Fullscreen
as well as all hotkeys printed next to it should toggle fullscreen without any unusual flickering--f
or--full-screen
, regardless the preferences option "Start in fullscreen"This is based on #11304, so you'll also see full keypress/release logging.
Since this is actually a bugfix/workaround I can imagine to rebase onto 2.3 but I need CI builds to test in a Ubuntu 22.04 VM.