Merge branch 'master' into next

This commit is contained in:
Michael Stapelberg 2012-01-17 23:39:04 +00:00
commit f32cc6f4ae
1 changed files with 18 additions and 15 deletions

11
src/x.c
View File

@ -823,6 +823,12 @@ void x_push_changes(Con *con) {
DLOG("Not updating focus (to %p / %s), focused window is not mapped.\n", focused, focused->name);
/* Invalidate focused_id to correctly focus new windows with the same ID */
focused_id = XCB_NONE;
} else {
if (focused->window != NULL &&
focused->window->needs_take_focus) {
DLOG("Updating focus by sending WM_TAKE_FOCUS to window 0x%08x only (focused: %p / %s)\n",
to_focus, focused, focused->name);
send_take_focus(to_focus);
} else {
DLOG("Updating focus (focused: %p / %s)\n", focused, focused->name);
/* We remove XCB_EVENT_MASK_FOCUS_CHANGE from the event mask to get
@ -838,12 +844,9 @@ void x_push_changes(Con *con) {
xcb_change_window_attributes(conn, focused->window->id, XCB_CW_EVENT_MASK, values);
}
if (focused->window != NULL &&
focused->window->needs_take_focus) {
send_take_focus(to_focus);
ewmh_update_active_window(to_focus);
}
ewmh_update_active_window(to_focus);
focused_id = to_focus;
}
}