From: Michael Stapelberg Date: Sat, 21 Dec 2013 20:32:23 +0000 (+0100) Subject: Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim) X-Git-Tag: 4.7~1^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85321bdf1d1e3ea734875b2a50030005148a5e2a;p=i3%2Fi3 Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim) fixes: #1136 --- diff --git a/src/handlers.c b/src/handlers.c index 72ef291c..fce66276 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -682,6 +682,11 @@ static void handle_client_message(xcb_client_message_event_t *event) { return; } + if (con_is_internal(ws)) { + DLOG("Workspace is internal, ignoring _NET_ACTIVE_WINDOW\n"); + return; + } + if (ws != con_get_workspace(focused)) workspace_show(ws); diff --git a/testcases/t/195-net-active-window.t b/testcases/t/195-net-active-window.t index c62d4fda..c3061c00 100644 --- a/testcases/t/195-net-active-window.t +++ b/testcases/t/195-net-active-window.t @@ -17,6 +17,7 @@ # Verifies that the _NET_ACTIVE_WINDOW message only changes focus when the # window is on a visible workspace. # ticket #774, bug still present in commit 1e49f1b08a3035c1f238fcd6615e332216ab582e +# ticket #1136, bug still present in commit fd07f989fdf441ef335245dd3436a70ff60e8896 use i3test; sub send_net_active_window { @@ -65,4 +66,21 @@ send_net_active_window($win1->id); is($x->input_focus, $win3->id, 'window 3 still has focus'); +################################################################################ +# Move a window to the scratchpad, send a _NET_ACTIVE_WINDOW for it and verify +# that focus is still unchanged. +################################################################################ + +my $scratch = open_window; + +is($x->input_focus, $scratch->id, 'to-scratchpad window has focus'); + +cmd 'move scratchpad'; + +is($x->input_focus, $win3->id, 'focus reverted to window 3'); + +send_net_active_window($scratch->id); + +is($x->input_focus, $win3->id, 'window 3 still focused'); + done_testing;