Skip to content

Commit

Permalink
Window: Fix XClearArea.
Browse files Browse the repository at this point in the history
It was broken since 742799d.
Worker's dialogs now render incorrectly again, but that's due
to having operlapping sibling views...
  • Loading branch information
waddlesplash committed Nov 21, 2023
1 parent 144cb3b commit 07f4710
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions xlib/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,19 +755,29 @@ XClearArea(Display *display, Window w,
if (!window)
return BadWindow;

if (!window->view()->Window())
return Success; // Nothing to do.

const XRectangle windowSize = xrect_from_brect(BRect(BPoint(0, 0), window->size()));
if (width == 0)
width = windowSize.width - x;
if (height == 0)
height = windowSize.height - y;

BRect rect(brect_from_xrect(make_xrect(x, y, width, height)));
window->draw_border(rect);
if (exposures && window->view()->Window()) {
window->view()->LockLooper();
window->view()->LockLooper();
if (exposures) {
window->view()->Invalidate(rect);
window->view()->UnlockLooper();
} else {
// TODO: This won't work correctly if there is a background pixmap set.
if (window->view()->LowColor() != window->view()->ViewColor()) {
window->view()->SetLowColor(window->view()->ViewColor());
window->last_gc = NULL;
}
window->view()->FillRect(rect, B_SOLID_LOW);
window->draw_border(rect);
}
window->view()->UnlockLooper();
return Success;
}

Expand Down

0 comments on commit 07f4710

Please sign in to comment.