diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 7f634a7d4c..335599f754 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -586,7 +586,7 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e ) } if( d != highlightedDesktop ) // Highlight desktop { - if ( (me->buttons() & Qt::LeftButton) && !wasWindowMove ) + if ( (me->buttons() & Qt::LeftButton) && !wasWindowMove && d <= effects->numberOfDesktops() ) { EffectWindowList windows = effects->stackingOrder(); EffectWindowList stack;