View: Add attachRelative function
This is used for the above/below attach-modes introduced in d71bebc.
Also remove redundant focusedIndex function in Output.PendingState.
This commit is contained in:
committed by
Isaac Freund
parent
50d4f25eee
commit
26210b2be5
@ -60,20 +60,6 @@ pub const PendingState = struct {
|
||||
///
|
||||
/// This includes both floating/fullscreen views and those arranged in the layout.
|
||||
wm_stack: wl.list.Head(View, .pending_wm_stack_link),
|
||||
///
|
||||
/// Index of the first view in focus_stack in the wm_stack list.
|
||||
pub fn focusedIndex(self: *PendingState) ?u32 {
|
||||
var focus_stack_it = self.focus_stack.iterator(.forward);
|
||||
const focused_view = focus_stack_it.next() orelse return null;
|
||||
|
||||
var it = self.wm_stack.iterator(.forward);
|
||||
var count: u32 = 0;
|
||||
while (it.next()) |other| {
|
||||
if (other == focused_view) break;
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
};
|
||||
|
||||
wlr_output: *wlr.Output,
|
||||
|
||||
Reference in New Issue
Block a user