focus:
TOK_FOCUS
{
+ owindow *current;
+
printf("should focus\n");
+ if (match_is_empty(¤t_match)) {
+ /* TODO: better error message */
+ LOG("Error: The foucs command requires you to use some criteria.\n");
+ return;
+ }
+
+ /* TODO: warning if the match contains more than one entry. does not
+ * make so much sense when focusing */
+ TAILQ_FOREACH(current, &owindows, owindows) {
+ LOG("focusing %p / %s\n", current->con, current->con->name);
+ con_focus(current->con);
+ }
}
;
#
# Tests focus switching (next/prev)
#
-use i3test tests => 13;
+use i3test tests => 14;
use X11::XCB qw(:all);
use v5.10;
($nodes, $focus) = get_ws_content($tmp);
is($focus->[0], $right, 'right container focused');
+# Test focus command
+
+$i3->command(qq|[con_id="$mid"] focus|)->recv;
+($nodes, $focus) = get_ws_content($tmp);
+is($focus->[0], $mid, 'middle container focused');
+
+
diag( "Testing i3, Perl $], $^X" );