aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2023-01-02 00:54:53 +0100
committerIsaac Freund <mail@isaacfreund.com>2023-01-02 00:58:25 +0100
commit39104ae9e3db55e5c3e8428bfdad67153b58737d (patch)
tree6c0999d3c628b58fd0a697c708e0c5a7037a6162
parent931405abe46e12485f2439135bd0fa20ea7fc984 (diff)
downloadriver-39104ae9e3db55e5c3e8428bfdad67153b58737d.tar.gz
river-39104ae9e3db55e5c3e8428bfdad67153b58737d.tar.xz
command/spawn-tagmask: apply globally
Currently the spawn-tagmask applies to the currently focused output. This however means that it is lost if the monitor is unplugged and makes it hard to set for all outputs. Change this to make the command apply to all outputs. This is a breaking change.
-rw-r--r--doc/riverctl.1.scd9
-rw-r--r--river/Config.zig3
-rw-r--r--river/Output.zig3
-rw-r--r--river/View.zig2
-rw-r--r--river/command/tags.zig5
5 files changed, 10 insertions, 12 deletions
diff --git a/doc/riverctl.1.scd b/doc/riverctl.1.scd
index 3009a16..7fc08dc 100644
--- a/doc/riverctl.1.scd
+++ b/doc/riverctl.1.scd
@@ -137,11 +137,10 @@ are ignored by river.
set bits of _tags_.
*spawn-tagmask* _tagmask_
- Set a _tagmask_ to filter the tags assigned to newly spawned views
- on the focused output. This mask will be applied to the tags of
- new views with a bitwise and. If, for example, the tags 000011111
- are focused on an output with a _tagmask_ of 111110001, a new view
- will be assigned the tags 000010001. If no tags would remain after
+ Set a _tagmask_ to filter the tags assigned to newly spawned views. This mask
+ will be applied to the tags of new views with a bitwise and. If, for example,
+ the tags 000011111 are focused and the spawn _tagmask_ is 111110001, a
+ new view will be assigned the tags 000010001. If no tags would remain after
filtering, the _tagmask_ is ignored.
*focus-previous-tags*
diff --git a/river/Config.zig b/river/Config.zig
index 5b5e387..bf152ca 100644
--- a/river/Config.zig
+++ b/river/Config.zig
@@ -87,6 +87,9 @@ warp_cursor: WarpCursorMode = .disabled,
/// Output.layout_namespace is null.
default_layout_namespace: []const u8 = &[0]u8{},
+/// Bitmask restricting the tags of newly created views.
+spawn_tagmask: u32 = std.math.maxInt(u32),
+
/// Determines where new views will be attached to the view stack.
attach_mode: AttachMode = .top,
diff --git a/river/Output.zig b/river/Output.zig
index be9f575..d1469d9 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -96,9 +96,6 @@ layout_namespace: ?[]const u8 = null,
/// The last set layout name.
layout_name: ?[:0]const u8 = null,
-/// Bitmask that whitelists tags for newly spawned views
-spawn_tagmask: u32 = math.maxInt(u32),
-
/// List of status tracking objects relaying changes to this output to clients.
status_trackers: std.SinglyLinkedList(OutputStatus) = .{},
diff --git a/river/View.zig b/river/View.zig
index 40e4db4..46db9cd 100644
--- a/river/View.zig
+++ b/river/View.zig
@@ -127,7 +127,7 @@ request_activate: wl.Listener(*wlr.XdgActivationV1.event.RequestActivate) =
pub fn init(self: *Self, output: *Output, impl: Impl) void {
const initial_tags = blk: {
- const tags = output.current.tags & output.spawn_tagmask;
+ const tags = output.current.tags & server.config.spawn_tagmask;
break :blk if (tags != 0) tags else output.current.tags;
};
diff --git a/river/command/tags.zig b/river/command/tags.zig
index c8b4338..460a736 100644
--- a/river/command/tags.zig
+++ b/river/command/tags.zig
@@ -39,14 +39,13 @@ pub fn setFocusedTags(
}
}
-/// Set the spawn tagmask
pub fn spawnTagmask(
- seat: *Seat,
+ _: *Seat,
args: []const [:0]const u8,
out: *?[]const u8,
) Error!void {
const tags = try parseTags(args, out);
- seat.focused_output.spawn_tagmask = tags;
+ server.config.spawn_tagmask = tags;
}
/// Set the tags of the focused view.