diff --git a/src/wmtaskbar.cc b/src/wmtaskbar.cc index 5d9f004ef..9199d418f 100644 --- a/src/wmtaskbar.cc +++ b/src/wmtaskbar.cc @@ -692,7 +692,10 @@ void TaskBar::updateLocation() { int dx, dy; unsigned dw, dh; - desktop->getScreenGeometry(&dx, &dy, &dw, &dh, -1); + int screen = + inrange(xineramaPrimaryScreen, 0, desktop->getScreenCount() - 1) + ? xineramaPrimaryScreen : -1; + desktop->getScreenGeometry(&dx, &dy, &dw, &dh, screen); int x = dx; unsigned int w = 0;