mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
layout: Switch two places to workspaces_mut()
This commit is contained in:
+2
-30
@@ -3457,27 +3457,13 @@ impl<W: LayoutElement> Layout<W> {
|
||||
}
|
||||
}
|
||||
|
||||
match &mut self.monitor_set {
|
||||
MonitorSet::Normal { monitors, .. } => {
|
||||
for mon in monitors {
|
||||
for ws in &mut mon.workspaces {
|
||||
for ws in self.workspaces_mut() {
|
||||
if ws.has_window(window) {
|
||||
ws.set_fullscreen(window, is_fullscreen);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MonitorSet::NoOutputs { workspaces, .. } => {
|
||||
for ws in workspaces {
|
||||
if ws.has_window(window) {
|
||||
ws.set_fullscreen(window, is_fullscreen);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_fullscreen(&mut self, window: &W::Id) {
|
||||
if let Some(InteractiveMoveState::Moving(move_)) = &self.interactive_move {
|
||||
@@ -3486,27 +3472,13 @@ impl<W: LayoutElement> Layout<W> {
|
||||
}
|
||||
}
|
||||
|
||||
match &mut self.monitor_set {
|
||||
MonitorSet::Normal { monitors, .. } => {
|
||||
for mon in monitors {
|
||||
for ws in &mut mon.workspaces {
|
||||
for ws in self.workspaces_mut() {
|
||||
if ws.has_window(window) {
|
||||
ws.toggle_fullscreen(window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MonitorSet::NoOutputs { workspaces, .. } => {
|
||||
for ws in workspaces {
|
||||
if ws.has_window(window) {
|
||||
ws.toggle_fullscreen(window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn workspace_switch_gesture_begin(&mut self, output: &Output, is_touchpad: bool) {
|
||||
let monitors = match &mut self.monitor_set {
|
||||
|
||||
Reference in New Issue
Block a user