diff --git a/docs/ipc b/docs/ipc index f0829dc2..ce38a546 100644 --- a/docs/ipc +++ b/docs/ipc @@ -156,7 +156,7 @@ following properties: num (integer):: The logical number of the workspace. Corresponds to the command - to switch to this workspace. + to switch to this workspace. For named workspaces, this will be -1. name (string):: The name of this workspace (by default num+1), as changed by the user. Encoded in UTF-8. diff --git a/src/ipc.c b/src/ipc.c index 03b3d5ad..6dab654c 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -617,10 +617,7 @@ IPC_HANDLER(get_workspaces) { y(map_open); ystr("num"); - if (ws->num == -1) - y(null); - else - y(integer, ws->num); + y(integer, ws->num); ystr("name"); ystr(ws->name); diff --git a/testcases/t/139-ws-numbers.t b/testcases/t/139-ws-numbers.t index 6829a147..f76ee04b 100644 --- a/testcases/t/139-ws-numbers.t +++ b/testcases/t/139-ws-numbers.t @@ -24,7 +24,7 @@ sub check_order { my ($msg) = @_; my @ws = @{$i3->get_workspaces->recv}; - my @nums = map { $_->{num} } grep { defined($_->{num}) } @ws; + my @nums = map { $_->{num} } grep { $_->{num} != -1 } @ws; my @sorted = sort @nums; is_deeply(\@nums, \@sorted, $msg);