Implement click on stack/tab decoration to focus

This commit is contained in:
Michael Stapelberg 2010-11-26 18:57:15 +01:00
parent df7788386d
commit db3002fce0
1 changed files with 12 additions and 2 deletions

View File

@ -286,8 +286,18 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
return 1; return 1;
} }
if (con->layout == L_STACKED) { if (con->layout == L_STACKED || con->layout == L_TABBED) {
DLOG("stacked!\n"); DLOG("stacked! click is on %d, %d\n", event->event_x, event->event_y);
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
if (!rect_contains(child->deco_rect, event->event_x, event->event_y))
continue;
con_focus(child);
break;
}
tree_render();
return 1;
} }
#if 0 #if 0