Bugfix: Prevent a division through zero (Thanks xeen)
This commit is contained in:
parent
16d33ec9df
commit
a817519c0d
|
@ -84,6 +84,11 @@ static bool button_press_stackwin(xcb_connection_t *conn, xcb_button_press_event
|
||||||
CIRCLEQ_FOREACH(client, &(container->clients), clients)
|
CIRCLEQ_FOREACH(client, &(container->clients), clients)
|
||||||
num_clients++;
|
num_clients++;
|
||||||
|
|
||||||
|
/* If we don’t have any clients in this container, we cannot do
|
||||||
|
* anything useful anyways. */
|
||||||
|
if (num_clients == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (container->mode == MODE_TABBED)
|
if (container->mode == MODE_TABBED)
|
||||||
destination = (event->event_x / (container->width / num_clients));
|
destination = (event->event_x / (container->width / num_clients));
|
||||||
else if (container->mode == MODE_STACK &&
|
else if (container->mode == MODE_STACK &&
|
||||||
|
|
Loading…
Reference in New Issue