river-layout: add user_command_tags event

It is not guaranteed that the next layout_demand event after a user_command
event has the same active tags (for example when there are no views visible).
As an example, a user could trigger a user_command while no views are visible,
then switch to a different tag set which has active views. The active tags of
the previous layout_demand may also be different.

Therefore it is impossible to correctly implement a layout generator which has
user commands apply only to the currently active tag set, which is solved by
this patch.
This commit is contained in:
Leon Henrik Plickat
2022-08-14 16:34:18 +02:00
committed by Isaac Freund
parent 416fdc8d06
commit 844ffce037
4 changed files with 22 additions and 3 deletions

View File

@ -76,6 +76,9 @@ pub fn sendLayoutCmd(
if (mem.eql(u8, layout.namespace, target_namespace)) break layout;
} else return;
if (layout.layout.getVersion() >= 2) {
layout.layout.sendUserCommandTags(output.pending.tags);
}
layout.layout.sendUserCommand(args[2]);
if (layout == output.current.layout) output.arrangeViews();
}