view: use a mode enum instead of floating bool
This is in preperation for fullscreen support which will add another mode to this enum. This commit also fixes a bug that allowed clicking floating views though layout views in some cases.
This commit is contained in:
@ -30,7 +30,10 @@ pub fn toggleFloat(
|
||||
) Error!void {
|
||||
if (args.len > 1) return Error.TooManyArguments;
|
||||
if (seat.focused_view) |view| {
|
||||
view.setFloating(!view.floating);
|
||||
switch (view.mode) {
|
||||
.layout => view.setMode(.float),
|
||||
.float => view.setMode(.layout),
|
||||
}
|
||||
view.output.root.arrange();
|
||||
}
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ pub fn zoom(
|
||||
const output = seat.focused_output;
|
||||
const focused_node = @fieldParentPtr(ViewStack(View).Node, "view", current_focus);
|
||||
|
||||
// Don't zoom floating views
|
||||
if (current_focus.floating) return;
|
||||
// Only zoom views that are part of the layout
|
||||
if (current_focus.mode != .layout) return;
|
||||
|
||||
var it = ViewStack(View).iterator(output.views.first, output.current_focused_tags);
|
||||
const zoom_node = if (focused_node == it.next())
|
||||
|
Reference in New Issue
Block a user