Skip to content

Commit

Permalink
Merge pull request #3493 from ronso0/fullscreen-menu-hotkeys
Browse files Browse the repository at this point in the history
only start in fullscreen if enabled in Preferences or via command line arg
uklotzde authored Jan 3, 2021
2 parents 830195d + d9889f8 commit ef3d950
Showing 2 changed files with 17 additions and 11 deletions.
18 changes: 17 additions & 1 deletion src/mixxx.cpp
Original file line number Diff line number Diff line change
@@ -700,7 +700,23 @@ void MixxxMainWindow::finalize() {
m_pTrackCollectionManager->stopLibraryScan();
m_pLibrary->stopPendingTasks();

// Save the current window state (position, maximized, etc)
// Save the current window state (position, maximized, etc)
// Note(ronso0): Unfortunately saveGeometry() also stores the fullscreen state.
// On next start restoreGeometry would enable fullscreen mode even though that
// might not be requested (no '--fullscreen' command line arg and
// [Config],StartInFullscreen is '0'.
// https://bugs.launchpad.net/mixxx/+bug/1882474
// https://bugs.launchpad.net/mixxx/+bug/1909485
// So let's quit fullscreen if StartInFullscreen is not checked in Preferences.
bool fullscreenPref = m_pSettingsManager->settings()->getValue<bool>(
ConfigKey("[Config]", "StartInFullscreen"));
if (isFullScreen() && !fullscreenPref) {
slotViewFullScreen(false);
// After returning from fullscreen the main window incl. window decoration
// may be too large for the screen.
// Maximize the window so we can store a geometry that fits the screen.
showMaximized();
}
m_pSettingsManager->settings()->set(ConfigKey("[MainWindow]", "geometry"),
QString(saveGeometry().toBase64()));
m_pSettingsManager->settings()->set(ConfigKey("[MainWindow]", "state"),
10 changes: 0 additions & 10 deletions src/preferences/dialog/dlgprefinterface.cpp
Original file line number Diff line number Diff line change
@@ -73,10 +73,7 @@ DlgPrefInterface::DlgPrefInterface(QWidget * parent, MixxxMainWindow * mixxx,
m_bRebootMixxxView(false) {
setupUi(this);

//
// Locale setting
//

// Iterate through the available locales and add them to the combobox
// Borrowed following snippet from http://qt-project.org/wiki/How_to_create_a_multi_language_application
const auto translationsDir = QDir(
@@ -188,15 +185,11 @@ DlgPrefInterface::DlgPrefInterface(QWidget * parent, MixxxMainWindow * mixxx,
spinBoxScaleFactor->hide();
labelScaleFactor->hide();

//
// Start in fullscreen mode
//
checkBoxStartFullScreen->setChecked(m_pConfig->getValueString(
ConfigKey("[Config]", "StartInFullscreen")).toInt()==1);

//
// Screensaver mode
//
comboBoxScreensaver->clear();
comboBoxScreensaver->addItem(tr("Allow screensaver to run"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_OFF));
@@ -208,10 +201,7 @@ DlgPrefInterface::DlgPrefInterface(QWidget * parent, MixxxMainWindow * mixxx,
int inhibitsettings = static_cast<int>(mixxx->getInhibitScreensaver());
comboBoxScreensaver->setCurrentIndex(comboBoxScreensaver->findData(inhibitsettings));

//
// Tooltip configuration
//

// Initialize checkboxes to match config
loadTooltipPreferenceFromConfig();
slotSetTooltips(); // Update disabled status of "only library" checkbox

0 comments on commit ef3d950

Please sign in to comment.