Fail when there's no fence to move

This commit is contained in:
Bastien Dejean 2016-08-12 09:26:38 +02:00
parent 8f9e50877e
commit 5a98b655ec

View file

@ -549,6 +549,9 @@ bool resize_client(coordinates_t *loc, resize_handle_t rh, int dx, int dy)
} else if (rh & HANDLE_BOTTOM) {
horizontal_fence = find_fence(n, DIR_SOUTH);
}
if (vertical_fence == NULL && horizontal_fence == NULL) {
return false;
}
if (vertical_fence != NULL) {
double sr = vertical_fence->split_ratio + (double) dx / vertical_fence->rectangle.width;
sr = MAX(0, sr);