tiling_drag: con_rect_plus_deco_height: Fix underflow (#5129)

Fixes #5069
This commit is contained in:
Orestis Floros 2022-09-17 13:00:29 +02:00 committed by GitHub
parent 5ce8e3241b
commit 0ac5e248f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,11 @@ static xcb_window_t create_drop_indicator(Rect rect);
static Rect con_rect_plus_deco_height(Con *con) {
Rect rect = con->rect;
rect.height += con->deco_rect.height;
rect.y -= con->deco_rect.height;
if (rect.y < con->deco_rect.height) {
rect.y = 0;
} else {
rect.y -= con->deco_rect.height;
}
return rect;
}