+is($x->input_focus, $win3->id,
+ 'focus did not switch to window 1 on a hidden workspace when message source was an application');
+
+ok(get_ws($ws1)->{urgent}, 'urgent hint set on ws 1');
+
+
+################################################################################
+# Make sure the ClientMessage only works with managed windows, and specifying a
+# window that is not managed does not crash i3 (#774)
+################################################################################
+
+my $dock = open_window(window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'));
+
+send_net_active_window($dock->id);
+
+does_i3_live;
+is($x->input_focus, $win3->id, 'dock did not get input focus');
+
+send_net_active_window($x->get_root_window());
+
+does_i3_live;
+is($x->input_focus, $win3->id, 'root window did not get input 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');
+
+################################################################################
+# Verify that the _NET_ACTIVE_WINDOW property is updated on the root window
+# correctly.
+################################################################################
+
+fresh_workspace;
+
+sync_with_i3;
+
+is(get_net_active_window(), 0, 'workspace content focus is indicated by the root property as "None" window');
+
+my $win4 = open_window;
+
+cmd '[id="' . $win4->id . '"] focus';
+
+sync_with_i3;
+
+is(get_net_active_window(), $win4->id, 'window 4 is indicated as focused by the root property');
+
+# make a branch
+open_window;
+open_window;
+cmd 'split h';
+open_window;
+cmd 'focus parent';
+
+sync_with_i3;
+
+is(get_net_active_window(), 0, 'branch focus is indicated by the root property as "None" window');