}
parse_cmd(bind->command);
- tree_render();
return 1;
}
/* see if the user entered the window on a certain window decoration */
int layout = (enter_child ? con->parent->layout : con->layout);
- Con *child;
- TAILQ_FOREACH(child, &(con->nodes_head), nodes)
- if (rect_contains(child->deco_rect, event->event_x, event->event_y)) {
- LOG("using child %p / %s instead!\n", child, child->name);
- con = child;
- break;
- }
-
- /* for stacked/tabbed layout we do not want to change focus when the user
- * enters the window at the decoration of any child window. */
- if (layout == L_STACKED || layout == L_TABBED) {
- con = TAILQ_FIRST(&(con->parent->focus_head));
- LOG("using focused %p / %s instead\n", con, con->name);
+ if (layout == L_DEFAULT) {
+ Con *child;
+ TAILQ_FOREACH(child, &(con->nodes_head), nodes)
+ if (rect_contains(child->deco_rect, event->event_x, event->event_y)) {
+ LOG("using child %p / %s instead!\n", child, child->name);
+ con = child;
+ break;
+ }
}
#if 0
*
*/
static int handle_unmap_notify_event(xcb_unmap_notify_event_t *event) {
+ // XXX: this is commented out because in src/x.c we disable EnterNotify events
/* we need to ignore EnterNotify events which will be generated because a
* different window is visible now */
- add_ignore_event(event->sequence, XCB_ENTER_NOTIFY);
+ //add_ignore_event(event->sequence, XCB_ENTER_NOTIFY);
DLOG("UnmapNotify for 0x%08x (received from 0x%08x), serial %d\n", event->window, event->event, event->sequence);
Con *con = con_by_window_id(event->window);
return 1;
}
- tree_close(con, false, false);
+ tree_close(con, DONT_KILL_WINDOW, false);
tree_render();
x_push_changes(croot);
return 1;
if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
return 1;
- window_update_name(con->window, prop);
+ window_update_name(con->window, prop, false);
x_push_changes(croot);
if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
return 1;
- window_update_name_legacy(con->window, prop);
+ window_update_name_legacy(con->window, prop, false);
x_push_changes(croot);
if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
return 1;
- window_update_class(con->window, prop);
+ window_update_class(con->window, prop, false);
return 0;
}
*
*/
static int handle_expose_event(xcb_expose_event_t *event) {
- Con *parent, *con;
+ Con *parent;
/* event->count is the number of minimum remaining expose events for this
* window, so we skip all events but the last one */
return 1;
}
- if (parent->window)
- x_draw_decoration(parent);
-
- TAILQ_FOREACH(con, &(parent->nodes_head), nodes) {
- DLOG("expose for con %p / %s\n", con, con->name);
- if (con->window)
- x_draw_decoration(con);
- }
-
- /* We also need to render the decorations of other Cons nearby the Con
- * itself to not get overlapping decorations */
- TAILQ_FOREACH(con, &(parent->parent->nodes_head), nodes) {
- DLOG("expose for con %p / %s\n", con, con->name);
- if (con->window)
- x_draw_decoration(con);
- }
+ /* re-render the parent (recursively, if it’s a split con) */
+ x_deco_recurse(parent);
xcb_flush(conn);
return 1;
(event->data.data32[0] == _NET_WM_STATE_ADD ||
event->data.data32[0] == _NET_WM_STATE_TOGGLE))) {
DLOG("toggling fullscreen\n");
- con_toggle_fullscreen(con);
+ con_toggle_fullscreen(con, CF_OUTPUT);
}
tree_render();
con->base_height = base_height;
DLOG("client's base_height changed to %d\n", base_height);
DLOG("client's base_width changed to %d\n", base_width);
+ changed = true;
}
/* If no aspect ratio was set or if it was invalid, we ignore the hints */
/* Check if we need to set proportional_* variables using the correct ratio */
if ((width / height) < min_aspect) {
- con->proportional_width = width;
- con->proportional_height = width / min_aspect;
+ if (con->proportional_width != width ||
+ con->proportional_height != (width / min_aspect)) {
+ con->proportional_width = width;
+ con->proportional_height = width / min_aspect;
+ changed = true;
+ }
} else if ((width / height) > max_aspect) {
- con->proportional_width = width;
- con->proportional_height = width / max_aspect;
+ if (con->proportional_width != width ||
+ con->proportional_height != (width / max_aspect)) {
+ con->proportional_width = width;
+ con->proportional_height = width / max_aspect;
+ changed = true;
+ }
} else goto render_and_return;
render_and_return:
- tree_render();
+ if (changed)
+ tree_render();
return 1;
}