Skip to content

Commit

Permalink
Avoid constructing invalid work areas.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jun 16, 2024
1 parent 100be1b commit b55b094
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/wmmgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2425,10 +2425,12 @@ void YWindowManager::updateArea(int workspace, int screen_number,
}
for (int ws = low; ws <= lim; ++ws) {
WorkAreaRect *wa = fWorkArea[ws] + screen_number;
if (l > wa->fMinX) wa->fMinX = l;
if (t > wa->fMinY) wa->fMinY = t;
if (r < wa->fMaxX) wa->fMaxX = r;
if (b < wa->fMaxY) wa->fMaxY = b;
if (l < wa->fMaxX && t < wa->fMaxY && r > wa->fMinX && b > wa->fMinY) {
if (l > wa->fMinX) wa->fMinX = l;
if (t > wa->fMinY) wa->fMinY = t;
if (r < wa->fMaxX) wa->fMaxX = r;
if (b < wa->fMaxY) wa->fMaxY = b;
}
}
}

Expand Down Expand Up @@ -2520,7 +2522,8 @@ bool YWindowManager::updateWorkAreaInner() {
MSG(("strut %d %d %d %d", w->strutLeft(), w->strutTop(),
w->strutRight(), w->strutBottom()));
MSG(("limit %d %d %d %d", l, t, r, b));
updateArea(ws, s, l, t, r, b);
if (l < r && t < b)
updateArea(ws, s, l, t, r, b);
}

if ((w->doNotCover() ||
Expand Down Expand Up @@ -2559,7 +2562,8 @@ bool YWindowManager::updateWorkAreaInner() {
}
}
MSG(("dock limit %d %d %d %d", l, t, r, b));
updateArea(ws, s, l, t, r, b);
if (l < r && t < b)
updateArea(ws, s, l, t, r, b);
}
debugWorkArea("updated");
}
Expand Down Expand Up @@ -3828,6 +3832,9 @@ void YWindowManager::doWMAction(WMAction action) {
XClientMessageEvent& xev = event.xclient;

xev.type = ClientMessage;
xev.serial = YWindow::getLastEnterNotifySerial();
xev.send_event = True;
xev.display = xapp->display();
xev.window = xapp->root();
xev.message_type = _XA_ICEWM_ACTION;
xev.format = 32;
Expand Down

0 comments on commit b55b094

Please sign in to comment.