settings: make slave screen optional and unset by default

This commit is contained in:
Andrzej Rybczak
2014-11-07 23:46:20 +01:00
parent 543dadf3c6
commit 7acc64979e
6 changed files with 22 additions and 14 deletions

View File

@@ -135,10 +135,14 @@ int main(int argc, char **argv)
if (Config.startup_screen_type != myScreen->type())
toScreen(Config.startup_screen_type)->switchTo();
// lock current screen and go to the slave one
if (Config.startup_slave_screen_type != myScreen->type())
if (myScreen->lock())
toScreen(Config.startup_slave_screen_type)->switchTo();
// lock current screen and go to the slave one if applicable
if (Config.startup_slave_screen_type)
{
auto slave_screen = *Config.startup_slave_screen_type;
bool screen_locked = myScreen->lock();
if (screen_locked && slave_screen != myScreen->type())
toScreen(slave_screen)->switchTo();
}
// local variables
bool key_pressed = false;