config: make attach-mode global
This commit is contained in:
parent
75814eb876
commit
2e7c1dbe6a
7 changed files with 13 additions and 12 deletions
|
@ -41,7 +41,7 @@ complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a map-point
|
|||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a unmap -d 'Remove the mapping defined by the arguments'
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a unmap-pointer -d 'Remove the pointer mapping defined by the arguments'
|
||||
# Configuration
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a attach-mode -d 'Configure where new views should attach to the view stack for the currently focused output'
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a attach-mode -d 'Configure where new views should attach to the view stack'
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a background-color -d 'Set the background color'
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a border-color-focused -d 'Set the border color of focused views'
|
||||
complete -c riverctl -x -n '__fish_riverctl_complete_no_subcommand' -a border-color-unfocused -d 'Set the border color of unfocused views'
|
||||
|
|
|
@ -47,7 +47,7 @@ _riverctl() {
|
|||
'unmap:Remove the mapping defined by the arguments'
|
||||
'unmap-pointer:Remove the pointer mapping defined by the arguments'
|
||||
# Configuration
|
||||
'attach-mode:Configure where new views should attach to the view stack for the currently focused output'
|
||||
'attach-mode:Configure where new views should attach to the view stack'
|
||||
'background-color:Set the background color'
|
||||
'border-color-focused:Set the border color of focused views'
|
||||
'border-color-unfocused:Set the border color of unfocused views'
|
||||
|
|
|
@ -209,8 +209,7 @@ A complete list may be found in _/usr/include/linux/input-event-codes.h_
|
|||
## CONFIGURATION
|
||||
|
||||
*attach-mode* *top*|*bottom*
|
||||
Configure where new views should attach to the view stack for the
|
||||
currently focused output.
|
||||
Configure where new views should attach to the view stack.
|
||||
|
||||
*background-color* _#RRGGBB_|_#RRGGBBAA_
|
||||
Set the background color.
|
||||
|
|
|
@ -23,6 +23,7 @@ const util = @import("util.zig");
|
|||
|
||||
const Server = @import("Server.zig");
|
||||
const Mode = @import("Mode.zig");
|
||||
const AttachMode = @import("view_stack.zig").AttachMode;
|
||||
|
||||
pub const FocusFollowsCursorMode = enum {
|
||||
disabled,
|
||||
|
@ -64,6 +65,9 @@ focus_follows_cursor: FocusFollowsCursorMode = .disabled,
|
|||
/// Output.layout_namespace is null.
|
||||
default_layout_namespace: []const u8 = &[0]u8{},
|
||||
|
||||
/// Determines where new views will be attached to the view stack.
|
||||
attach_mode: AttachMode = .top,
|
||||
|
||||
opacity: struct {
|
||||
/// The opacity of focused views
|
||||
focused: f32 = 1.0,
|
||||
|
|
|
@ -35,7 +35,6 @@ const Layout = @import("Layout.zig");
|
|||
const LayoutDemand = @import("LayoutDemand.zig");
|
||||
const View = @import("View.zig");
|
||||
const ViewStack = @import("view_stack.zig").ViewStack;
|
||||
const AttachMode = @import("view_stack.zig").AttachMode;
|
||||
const OutputStatus = @import("OutputStatus.zig");
|
||||
|
||||
const State = struct {
|
||||
|
@ -83,9 +82,6 @@ layouts: std.TailQueue(Layout) = .{},
|
|||
/// Call handleLayoutNamespaceChange() after setting this.
|
||||
layout_namespace: ?[]const u8 = null,
|
||||
|
||||
/// Determines where new views will be attached to the view stack.
|
||||
attach_mode: AttachMode = .top,
|
||||
|
||||
/// Bitmask that whitelists tags for newly spawned views
|
||||
spawn_tagmask: u32 = std.math.maxInt(u32),
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ pub fn sendToOutput(self: *Self, destination_output: *Output) void {
|
|||
const node = @fieldParentPtr(ViewStack(Self).Node, "view", self);
|
||||
|
||||
self.output.views.remove(node);
|
||||
destination_output.views.attach(node, destination_output.attach_mode);
|
||||
destination_output.views.attach(node, server.config.attach_mode);
|
||||
|
||||
self.output.sendViewTags();
|
||||
destination_output.sendViewTags();
|
||||
|
@ -466,7 +466,7 @@ pub fn map(self: *Self) void {
|
|||
|
||||
// Add the view to the stack of its output
|
||||
const node = @fieldParentPtr(ViewStack(Self).Node, "view", self);
|
||||
self.output.views.attach(node, self.output.attach_mode);
|
||||
self.output.views.attach(node, server.config.attach_mode);
|
||||
|
||||
// Focus the new view, assuming the seat is focusing the proper output
|
||||
// and there isn't something else like a fullscreen view grabbing focus.
|
||||
|
|
|
@ -19,6 +19,8 @@ const std = @import("std");
|
|||
|
||||
const util = @import("../util.zig");
|
||||
|
||||
const server = &@import("../main.zig").server;
|
||||
|
||||
const Error = @import("../command.zig").Error;
|
||||
const Seat = @import("../Seat.zig");
|
||||
|
||||
|
@ -32,9 +34,9 @@ pub fn attachMode(
|
|||
if (args.len > 2) return Error.TooManyArguments;
|
||||
|
||||
if (std.mem.eql(u8, "top", args[1])) {
|
||||
seat.focused_output.attach_mode = .top;
|
||||
server.config.attach_mode = .top;
|
||||
} else if (std.mem.eql(u8, "bottom", args[1])) {
|
||||
seat.focused_output.attach_mode = .bottom;
|
||||
server.config.attach_mode = .bottom;
|
||||
} else {
|
||||
return Error.UnknownOption;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue