From 41eb810531567083633e5d897692bcae5cbe9577 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 11 Dec 2010 17:07:20 +0100 Subject: [PATCH] =?utf8?q?Bugfix:=20Don=E2=80=99t=20update=20focus=20when?= =?utf8?q?=20container=20is=20not=20mapped?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/x.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/x.c b/src/x.c index 979b8734..fa003020 100644 --- a/src/x.c +++ b/src/x.c @@ -589,10 +589,15 @@ void x_push_changes(Con *con) { if (focused->window != NULL) to_focus = focused->window->id; + DLOG("focused_id = 0x%08x, to_focus = 0x%08x\n", focused_id, to_focus); if (focused_id != to_focus) { - 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); - 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); + xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME); + focused_id = to_focus; + } } xcb_flush(conn); -- 2.39.5