From 8ecc1345a6ef97cd720a71af582c3aa8804f3577 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 11 Jul 2022 22:39:56 +0200 Subject: [PATCH] shell: rename space_for_{window -> surface} --- src/shell/focus.rs | 2 +- src/shell/grabs.rs | 2 +- src/shell/mod.rs | 4 ++-- src/wayland/handlers/compositor.rs | 2 +- src/wayland/handlers/xdg_shell/mod.rs | 14 +++++++------- src/wayland/handlers/xdg_shell/popup.rs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/shell/focus.rs b/src/shell/focus.rs index 7649fbf6..8046afaf 100644 --- a/src/shell/focus.rs +++ b/src/shell/focus.rs @@ -120,7 +120,7 @@ impl Shell { ) { // update FocusStack and notify layouts about new focus (if any window) if let Some(surface) = surface { - if let Some(workspace) = self.space_for_surface_mut(surface) { + if let Some(workspace) = self.space_for_window_mut(surface) { if let Some(window) = workspace .space .window_for_surface(surface, WindowSurfaceType::ALL) diff --git a/src/shell/grabs.rs b/src/shell/grabs.rs index d1ed8e9b..3c4b956a 100644 --- a/src/shell/grabs.rs +++ b/src/shell/grabs.rs @@ -34,7 +34,7 @@ impl Shell { ) { // TODO touch grab if let Some(pointer) = seat.get_pointer() { - let workspace = self.space_for_surface_mut(window.toplevel().wl_surface()).unwrap(); + let workspace = self.space_for_window_mut(window.toplevel().wl_surface()).unwrap(); if workspace.fullscreen.values().any(|w| w == window) { return; } diff --git a/src/shell/mod.rs b/src/shell/mod.rs index c5a09db4..d8931c85 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -458,7 +458,7 @@ impl Shell { } } - pub fn space_for_surface(&self, surface: &WlSurface) -> Option<&Workspace> { + pub fn space_for_window(&self, surface: &WlSurface) -> Option<&Workspace> { self.spaces.iter().find(|workspace| { workspace .space @@ -467,7 +467,7 @@ impl Shell { }) } - pub fn space_for_surface_mut(&mut self, surface: &WlSurface) -> Option<&mut Workspace> { + pub fn space_for_window_mut(&mut self, surface: &WlSurface) -> Option<&mut Workspace> { self.spaces.iter_mut().find(|workspace| { workspace .space diff --git a/src/wayland/handlers/compositor.rs b/src/wayland/handlers/compositor.rs index 4bf6f30e..f11a1caa 100644 --- a/src/wayland/handlers/compositor.rs +++ b/src/wayland/handlers/compositor.rs @@ -162,7 +162,7 @@ impl CompositorHandler for State { if let Some((space, window)) = self.common .shell - .space_for_surface_mut(surface) + .space_for_window_mut(surface) .and_then(|workspace| { workspace .space diff --git a/src/wayland/handlers/xdg_shell/mod.rs b/src/wayland/handlers/xdg_shell/mod.rs index 1b21f7b6..5dc0ce77 100644 --- a/src/wayland/handlers/xdg_shell/mod.rs +++ b/src/wayland/handlers/xdg_shell/mod.rs @@ -83,7 +83,7 @@ impl XdgShellHandler for State { if let Some(window) = self.common .shell - .space_for_surface(&surface) + .space_for_window(&surface) .and_then(|workspace| { workspace .space @@ -173,7 +173,7 @@ impl XdgShellHandler for State { let workspace = self .common .shell - .space_for_surface_mut(surface.wl_surface()) + .space_for_window_mut(surface.wl_surface()) .unwrap(); let window = workspace .space @@ -198,7 +198,7 @@ impl XdgShellHandler for State { let workspace = self .common .shell - .space_for_surface_mut(surface.wl_surface()) + .space_for_window_mut(surface.wl_surface()) .unwrap(); let window = workspace .space @@ -215,7 +215,7 @@ impl XdgShellHandler for State { let seat = &self.common.last_active_seat; let output = active_output(seat, &self.common); - if let Some(workspace) = self.common.shell.space_for_surface_mut(surface) { + if let Some(workspace) = self.common.shell.space_for_window_mut(surface) { let window = workspace .space .window_for_surface(surface, WindowSurfaceType::TOPLEVEL) @@ -228,7 +228,7 @@ impl XdgShellHandler for State { fn unmaximize_request(&mut self, _dh: &DisplayHandle, surface: ToplevelSurface) { let surface = surface.wl_surface(); - if let Some(workspace) = self.common.shell.space_for_surface_mut(surface) { + if let Some(workspace) = self.common.shell.space_for_window_mut(surface) { let window = workspace .space .window_for_surface(surface, WindowSurfaceType::TOPLEVEL) @@ -253,7 +253,7 @@ impl XdgShellHandler for State { }); let surface = surface.wl_surface(); - if let Some(workspace) = self.common.shell.space_for_surface_mut(surface) { + if let Some(workspace) = self.common.shell.space_for_window_mut(surface) { let window = workspace .space .window_for_surface(surface, WindowSurfaceType::TOPLEVEL) @@ -265,7 +265,7 @@ impl XdgShellHandler for State { fn unfullscreen_request(&mut self, _dh: &DisplayHandle, surface: ToplevelSurface) { let surface = surface.wl_surface(); - if let Some(workspace) = self.common.shell.space_for_surface_mut(surface) { + if let Some(workspace) = self.common.shell.space_for_window_mut(surface) { let window = workspace .space .window_for_surface(surface, WindowSurfaceType::TOPLEVEL) diff --git a/src/wayland/handlers/xdg_shell/popup.rs b/src/wayland/handlers/xdg_shell/popup.rs index 608a3380..50cbc83d 100644 --- a/src/wayland/handlers/xdg_shell/popup.rs +++ b/src/wayland/handlers/xdg_shell/popup.rs @@ -27,7 +27,7 @@ use std::sync::Mutex; impl Shell { pub fn unconstrain_popup(&self, surface: &PopupSurface, positioner: &PositionerState) { if let Some(parent) = get_popup_toplevel(&surface) { - if let Some(workspace) = self.space_for_surface(&parent) { + if let Some(workspace) = self.space_for_window(&parent) { let window = workspace .space .window_for_surface(&parent, WindowSurfaceType::ALL) @@ -44,7 +44,7 @@ impl Shell { } pub fn update_reactive_popups(&self, window: &Window) { - if let Some(workspace) = self.space_for_surface(window.toplevel().wl_surface()) { + if let Some(workspace) = self.space_for_window(window.toplevel().wl_surface()) { update_reactive_popups(&workspace.space, window); } }