fix bar offset oops

This commit is contained in:
vaxerski 2021-12-17 23:31:12 +01:00
parent 962819b049
commit 380ee051c9
2 changed files with 6 additions and 1 deletions

View file

@ -384,6 +384,11 @@ void ConfigManager::loadConfigLoadVars() {
configValues["bar:height"].intValue = 15;
}
if (configValues["bar:monitor"].intValue > g_pWindowManager->monitors.size()) {
configValues["bar:monitor"].intValue = 0;
Debug::log(ERR, "Incorrect value in MonitorID for the bar. Setting to 0.");
}
g_pWindowManager->statusBar->setup(configValues["bar:monitor"].intValue);
} else if (g_pWindowManager->statusBar) {
g_pWindowManager->statusBar->destroy();

View file

@ -680,7 +680,7 @@ void CWindowManager::setEffectiveSizePosUsingConfig(CWindow* pWindow) {
return;
const auto MONITOR = getMonitorFromWindow(pWindow);
const auto BARHEIGHT = (MONITOR->ID == pWindow->getMonitor() ? (ConfigManager::getInt("bar:enabled") == 1 ? ConfigManager::getInt("bar:height") : ConfigManager::parseError == "" ? 0 : ConfigManager::getInt("bar:height")) : 0);
const auto BARHEIGHT = (MONITOR->ID == ConfigManager::getInt("bar:monitor") ? (ConfigManager::getInt("bar:enabled") == 1 ? ConfigManager::getInt("bar:height") : ConfigManager::parseError == "" ? 0 : ConfigManager::getInt("bar:height")) : 0);
// set some flags.