take care of non-existant old workspaces
This commit is contained in:
parent
74d596e0fc
commit
464d387044
4
docs/ipc
4
docs/ipc
|
@ -646,7 +646,9 @@ This event consists of a single serialized map containing a property
|
||||||
+change (string)+ which indicates the type of the change ("focus", "init",
|
+change (string)+ which indicates the type of the change ("focus", "init",
|
||||||
"empty", "urgent"). Additionally, when the change is "focus", an +old
|
"empty", "urgent"). Additionally, when the change is "focus", an +old
|
||||||
(object)+ and a +current (object)+ properties will be present with the
|
(object)+ and a +current (object)+ properties will be present with the
|
||||||
previous and current workspace respectively.
|
previous and current workspace respectively. When the first switch
|
||||||
|
occurs (when i3 focuses the workspace visible at the beginning) there is
|
||||||
|
no previous workspace, and the +old+ property will be set to +null+.
|
||||||
|
|
||||||
*Example:*
|
*Example:*
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -350,7 +350,10 @@ static void _workspace_focus_event(Con *current, Con *old) {
|
||||||
dump_node(gen, current, false);
|
dump_node(gen, current, false);
|
||||||
|
|
||||||
ystr("old");
|
ystr("old");
|
||||||
dump_node(gen, old, false);
|
if (old == NULL)
|
||||||
|
y(null);
|
||||||
|
else
|
||||||
|
dump_node(gen, old, false);
|
||||||
|
|
||||||
y(map_close);
|
y(map_close);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue