keybindings: Make close request work
This commit is contained in:
parent
d132722bd0
commit
774e3bc5f4
1 changed files with 12 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
use crate::{config::Action, state::Common};
|
use crate::{config::Action, state::Common};
|
||||||
use smithay::{
|
use smithay::{
|
||||||
backend::input::{Device, DeviceCapability, InputBackend, InputEvent, KeyState},
|
backend::input::{Device, DeviceCapability, InputBackend, InputEvent, KeyState},
|
||||||
desktop::{layer_map_for_output, Space, WindowSurfaceType},
|
desktop::{layer_map_for_output, Kind, Space, WindowSurfaceType},
|
||||||
reexports::wayland_server::{protocol::wl_surface::WlSurface, Display},
|
reexports::wayland_server::{protocol::wl_surface::WlSurface, Display},
|
||||||
utils::{Logical, Point},
|
utils::{Logical, Point},
|
||||||
wayland::{
|
wayland::{
|
||||||
|
|
@ -264,7 +264,17 @@ impl Common {
|
||||||
Action::Debug => slog_scope::info!(
|
Action::Debug => slog_scope::info!(
|
||||||
"Debug overlay not included in this version"
|
"Debug overlay not included in this version"
|
||||||
),
|
),
|
||||||
Action::Close => { /* TODO */ }
|
Action::Close => {
|
||||||
|
let current_output = active_output(seat, &self);
|
||||||
|
let workspace =
|
||||||
|
self.shell.active_space_mut(¤t_output);
|
||||||
|
if let Some(window) = workspace.focus_stack.last() {
|
||||||
|
#[allow(irrefutable_let_patterns)]
|
||||||
|
if let Kind::Xdg(xdg) = &window.toplevel() {
|
||||||
|
xdg.send_close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Action::Workspace(key_num) => {
|
Action::Workspace(key_num) => {
|
||||||
let current_output = active_output(seat, &self);
|
let current_output = active_output(seat, &self);
|
||||||
let workspace = match key_num {
|
let workspace = match key_num {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue