ensure disjunct screenedges on overlapping screens

If two or more screens overlap (partially or fully)
we must not create double edges since kwin would
trigger both - since they've the same actions bound
(for sure) the action will called twice (so either
eg. toggle or skip one VD etc.)

BUG: 338381
REVIEW: 120060
This commit is contained in:
Thomas Lübking 2014-09-04 21:13:55 +02:00
parent 66df3eefdf
commit ec8f7e1fac

View file

@ -872,23 +872,27 @@ void ScreenEdges::recreateEdges()
QList<Edge*> oldEdges(m_edges); QList<Edge*> oldEdges(m_edges);
m_edges.clear(); m_edges.clear();
const QRect fullArea(0, 0, displayWidth(), displayHeight()); const QRect fullArea(0, 0, displayWidth(), displayHeight());
QRegion processedRegion;
for (int i=0; i<screens()->count(); ++i) { for (int i=0; i<screens()->count(); ++i) {
const QRect screen = screens()->geometry(i); const QRegion screen = QRegion(screens()->geometry(i)).subtracted(processedRegion);
if (isLeftScreen(screen, fullArea)) { processedRegion += screen;
// left most screen Q_FOREACH (const QRect &screenPart, screen.rects()) {
createVerticalEdge(ElectricLeft, screen, fullArea); if (isLeftScreen(screenPart, fullArea)) {
} // left most screen
if (isRightScreen(screen, fullArea)) { createVerticalEdge(ElectricLeft, screenPart, fullArea);
// right most screen }
createVerticalEdge(ElectricRight, screen, fullArea); if (isRightScreen(screenPart, fullArea)) {
} // right most screen
if (isTopScreen(screen, fullArea)) { createVerticalEdge(ElectricRight, screenPart, fullArea);
// top most screen }
createHorizontalEdge(ElectricTop, screen, fullArea); if (isTopScreen(screenPart, fullArea)) {
} // top most screen
if (isBottomScreen(screen, fullArea)) { createHorizontalEdge(ElectricTop, screenPart, fullArea);
// bottom most screen }
createHorizontalEdge(ElectricBottom, screen, fullArea); if (isBottomScreen(screenPart, fullArea)) {
// bottom most screen
createHorizontalEdge(ElectricBottom, screenPart, fullArea);
}
} }
} }
// copy over the effect/script reservations from the old edges // copy over the effect/script reservations from the old edges