diff --git a/containment.cpp b/containment.cpp index 00a8a77b2..9e3a50511 100644 --- a/containment.cpp +++ b/containment.cpp @@ -987,7 +987,9 @@ void ContainmentPrivate::setScreen(int newScreen, int newDesktop, bool preventIn //kDebug() << activity() << "setting screen to " << newScreen << newDesktop << "and type is" << type; Containment *swapScreensWith(0); - if (type == Containment::DesktopContainment || type >= Containment::CustomContainment) { + const bool isDesktopContainment = type == Containment::DesktopContainment || + type == Containment::CustomContainment; + if (isDesktopContainment) { // we want to listen to changes in work area if our screen changes if (toolBox) { if (screen < 0 && newScreen > -1) { @@ -1011,8 +1013,7 @@ void ContainmentPrivate::setScreen(int newScreen, int newDesktop, bool preventIn } } - if (newScreen < numScreens && newScreen > -1 && - (type == Containment::DesktopContainment || type >= Containment::CustomContainment)) { + if (newScreen < numScreens && newScreen > -1 && isDesktopContainment) { q->resize(corona->screenGeometry(newScreen).size()); }