+ /* If the root window is clicked, find the relevant output from the
+ * click coordinates and focus the output's active workspace. */
+ if (event->event == root) {
+ Con *output, *ws;
+ TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
+ if (con_is_internal(output) ||
+ !rect_contains(output->rect, event->event_x, event->event_y))
+ continue;
+
+ ws = TAILQ_FIRST(&(output_get_content(output)->focus_head));
+ if (ws != con_get_workspace(focused)) {
+ workspace_show(ws);
+ tree_render();
+ }
+ return 1;
+ }
+ return 0;
+ }
+