Skip to content
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

only start in fullscreen if enabled in Preferences or via command line arg #3493

Merged
merged 1 commit into from
Jan 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,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"),
Expand Down
10 changes: 0 additions & 10 deletions src/preferences/dialog/dlgprefinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
QString translationsFolder = m_pConfig->getResourcePath() + "translations/";
Expand Down Expand Up @@ -161,15 +158,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));
Expand All @@ -181,10 +174,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
Expand Down