Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim)

fixes: #1136
next
Michael Stapelberg 2013-12-21 21:32:23 +01:00
parent fd07f989fd
commit 85321bdf1d
2 changed files with 23 additions and 0 deletions

View File

@ -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);

View File

@ -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;