Bugfix: Don’t update focus when container is not mapped

This commit is contained in:
Michael Stapelberg 2010-12-11 17:07:20 +01:00
parent 8d5421e6a4
commit 41eb810531
1 changed files with 8 additions and 3 deletions

View File

@ -589,11 +589,16 @@ void x_push_changes(Con *con) {
if (focused->window != NULL) if (focused->window != NULL)
to_focus = focused->window->id; to_focus = focused->window->id;
DLOG("focused_id = 0x%08x, to_focus = 0x%08x\n", focused_id, to_focus);
if (focused_id != to_focus) { if (focused_id != to_focus) {
if (!focused->mapped) {
DLOG("Not updating focus (to %p / %s), focused window is not mapped.\n", focused, focused->name);
} else {
LOG("Updating focus (focused: %p / %s)\n", focused, focused->name); LOG("Updating focus (focused: %p / %s)\n", focused, focused->name);
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME); xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME);
focused_id = to_focus; focused_id = to_focus;
} }
}
xcb_flush(conn); xcb_flush(conn);
LOG("\n\n ENDING CHANGES\n\n"); LOG("\n\n ENDING CHANGES\n\n");