diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index 77d133a328..c4466fc8c0 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -84,8 +84,9 @@ static Qt::MouseButton buttonToQtMouseButton(uint32_t button) static bool screenContainsPos(const QPointF &pos) { - for (int i = 0; i < screens()->count(); ++i) { - if (screens()->geometry(i).contains(pos.toPoint())) { + const auto outputs = kwinApp()->platform()->enabledOutputs(); + for (const AbstractOutput *output : outputs) { + if (output->geometry().contains(pos.toPoint())) { return true; } }