- SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
- if (stack_win->window == event->event) {
- /* A stack window was clicked. We calculate the destination client by
- dividing the Y position of the event through the height of a window
- decoration and then set the focus to this client. */
- i3Font *font = load_font(conn, config.font);
- int decoration_height = (font->height + 2 + 2);
- int destination = (event->event_y / decoration_height),
- c = 0;
- Client *client;
-
- LOG("Click on stack_win for client %d\n", destination);
- CIRCLEQ_FOREACH(client, &(stack_win->container->clients), clients)
- if (c++ == destination) {
- set_focus(conn, client);
- return true;
- }
+ SLIST_FOREACH(stack_win, &stack_wins, stack_windows) {
+ if (stack_win->window != event->event)
+ continue;