]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Prevent a division through zero (Thanks xeen)
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 28 Oct 2009 23:33:20 +0000 (00:33 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 28 Oct 2009 23:33:20 +0000 (00:33 +0100)
src/click.c

index b3a00afab1558983bbca54cfb214b9405873393f..28737f3b7d73303861b70c86e37ff0986ff5c380 100644 (file)
@@ -84,6 +84,11 @@ static bool button_press_stackwin(xcb_connection_t *conn, xcb_button_press_event
         CIRCLEQ_FOREACH(client, &(container->clients), 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)
                 destination = (event->event_x / (container->width / num_clients));
         else if (container->mode == MODE_STACK &&