Rename surface -> toplevel
Browse files at this commitdfbc0241274317e0a90b5ca86fd6b5f3cab2e2bfParent: eb2dce11 changed file +12 -12
- src/handlers/xdg_shell.rs +12 -12
src/handlers/xdg_shell.rsmodified+12 -12
| @@ -264,13 +264,13 @@ impl XdgShellHandler for State { | |||
| 264 | 264 | ||
| 265 | fn fullscreen_request( | 265 | fn fullscreen_request( |
| 266 | &mut self, | 266 | &mut self, |
| 267 | - surface: ToplevelSurface, | 267 | + toplevel: ToplevelSurface, |
| 268 | wl_output: Option<wl_output::WlOutput>, | 268 | wl_output: Option<wl_output::WlOutput>, |
| 269 | ) { | 269 | ) { |
| 270 | if let Some((window, current_output)) = self | 270 | if let Some((window, current_output)) = self |
| 271 | .niri | 271 | .niri |
| 272 | .layout | 272 | .layout |
| 273 | - .find_window_and_output(surface.wl_surface()) | 273 | + .find_window_and_output(toplevel.wl_surface()) |
| 274 | { | 274 | { |
| 275 | let window = window.clone(); | 275 | let window = window.clone(); |
| 276 | 276 | ||
| @@ -286,8 +286,8 @@ impl XdgShellHandler for State { | |||
| 286 | 286 | ||
| 287 | // A configure is required in response to this event regardless if there are pending | 287 | // A configure is required in response to this event regardless if there are pending |
| 288 | // changes. | 288 | // changes. |
| 289 | - surface.send_configure(); | 289 | + toplevel.send_configure(); |
| 290 | - } else if let Some(unmapped) = self.niri.unmapped_windows.get_mut(surface.wl_surface()) { | 290 | + } else if let Some(unmapped) = self.niri.unmapped_windows.get_mut(toplevel.wl_surface()) { |
| 291 | match &mut unmapped.state { | 291 | match &mut unmapped.state { |
| 292 | InitialConfigureState::NotConfigured { wants_fullscreen } => { | 292 | InitialConfigureState::NotConfigured { wants_fullscreen } => { |
| 293 | *wants_fullscreen = Some(wl_output.as_ref().and_then(Output::from_resource)); | 293 | *wants_fullscreen = Some(wl_output.as_ref().and_then(Output::from_resource)); |
| @@ -298,28 +298,28 @@ impl XdgShellHandler for State { | |||
| 298 | // FIXME: implement this once I figure out a good way without code duplication. | 298 | // FIXME: implement this once I figure out a good way without code duplication. |
| 299 | 299 | ||
| 300 | // We already sent the initial configure, so we need to reconfigure. | 300 | // We already sent the initial configure, so we need to reconfigure. |
| 301 | - surface.send_configure(); | 301 | + toplevel.send_configure(); |
| 302 | } | 302 | } |
| 303 | } | 303 | } |
| 304 | } else { | 304 | } else { |
| 305 | error!("couldn't find the toplevel in fullscreen_request()"); | 305 | error!("couldn't find the toplevel in fullscreen_request()"); |
| 306 | - surface.send_configure(); | 306 | + toplevel.send_configure(); |
| 307 | } | 307 | } |
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | - fn unfullscreen_request(&mut self, surface: ToplevelSurface) { | 310 | + fn unfullscreen_request(&mut self, toplevel: ToplevelSurface) { |
| 311 | if let Some((window, _)) = self | 311 | if let Some((window, _)) = self |
| 312 | .niri | 312 | .niri |
| 313 | .layout | 313 | .layout |
| 314 | - .find_window_and_output(surface.wl_surface()) | 314 | + .find_window_and_output(toplevel.wl_surface()) |
| 315 | { | 315 | { |
| 316 | let window = window.clone(); | 316 | let window = window.clone(); |
| 317 | self.niri.layout.set_fullscreen(&window, false); | 317 | self.niri.layout.set_fullscreen(&window, false); |
| 318 | 318 | ||
| 319 | // A configure is required in response to this event regardless if there are pending | 319 | // A configure is required in response to this event regardless if there are pending |
| 320 | // changes. | 320 | // changes. |
| 321 | - surface.send_configure(); | 321 | + toplevel.send_configure(); |
| 322 | - } else if let Some(unmapped) = self.niri.unmapped_windows.get_mut(surface.wl_surface()) { | 322 | + } else if let Some(unmapped) = self.niri.unmapped_windows.get_mut(toplevel.wl_surface()) { |
| 323 | match &mut unmapped.state { | 323 | match &mut unmapped.state { |
| 324 | InitialConfigureState::NotConfigured { wants_fullscreen } => { | 324 | InitialConfigureState::NotConfigured { wants_fullscreen } => { |
| 325 | *wants_fullscreen = None; | 325 | *wants_fullscreen = None; |
| @@ -330,12 +330,12 @@ impl XdgShellHandler for State { | |||
| 330 | // FIXME: implement this once I figure out a good way without code duplication. | 330 | // FIXME: implement this once I figure out a good way without code duplication. |
| 331 | 331 | ||
| 332 | // We already sent the initial configure, so we need to reconfigure. | 332 | // We already sent the initial configure, so we need to reconfigure. |
| 333 | - surface.send_configure(); | 333 | + toplevel.send_configure(); |
| 334 | } | 334 | } |
| 335 | } | 335 | } |
| 336 | } else { | 336 | } else { |
| 337 | error!("couldn't find the toplevel in unfullscreen_request()"); | 337 | error!("couldn't find the toplevel in unfullscreen_request()"); |
| 338 | - surface.send_configure(); | 338 | + toplevel.send_configure(); |
| 339 | } | 339 | } |
| 340 | } | 340 | } |
| 341 | 341 | ||