shell: rename space_for_{window -> surface}

This commit is contained in:
Victoria Brekenfeld 2022-07-11 22:39:56 +02:00
parent 4de316cbce
commit 8ecc1345a6
6 changed files with 14 additions and 14 deletions

View file

@ -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)

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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);
}
}