Implement keyboard shortcut inhibit protocol
TODO: restrict what apps can call this in some way.
This commit is contained in:
parent
7b670afc36
commit
0f726cf16b
4 changed files with 60 additions and 11 deletions
22
src/wayland/handlers/keyboard_shortcuts_inhibit.rs
Normal file
22
src/wayland/handlers/keyboard_shortcuts_inhibit.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::state::State;
|
||||
use smithay::{
|
||||
delegate_keyboard_shortcuts_inhibit,
|
||||
wayland::keyboard_shortcuts_inhibit::{
|
||||
KeyboardShortcutsInhibitHandler, KeyboardShortcutsInhibitState, KeyboardShortcutsInhibitor,
|
||||
},
|
||||
};
|
||||
|
||||
impl KeyboardShortcutsInhibitHandler for State {
|
||||
fn keyboard_shortcuts_inhibit_state(&mut self) -> &mut KeyboardShortcutsInhibitState {
|
||||
&mut self.common.keyboard_shortcuts_inhibit_state
|
||||
}
|
||||
|
||||
fn new_inhibitor(&mut self, inhibitor: KeyboardShortcutsInhibitor) {
|
||||
// TODO: Restrict what apps can inhibit shortcuts
|
||||
inhibitor.activate();
|
||||
}
|
||||
}
|
||||
|
||||
delegate_keyboard_shortcuts_inhibit!(State);
|
||||
|
|
@ -5,6 +5,7 @@ pub mod compositor;
|
|||
pub mod data_device;
|
||||
pub mod dmabuf;
|
||||
pub mod export_dmabuf;
|
||||
pub mod keyboard_shortcuts_inhibit;
|
||||
pub mod layer_shell;
|
||||
pub mod output;
|
||||
pub mod output_configuration;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue