Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ use smithay::{
virtual_keyboard::VirtualKeyboardManagerState,
xdg_activation::XdgActivationState,
xdg_foreign::XdgForeignState,
xdg_system_bell::XdgSystemBellState,
xwayland_keyboard_grab::XWaylandKeyboardGrabState,
xwayland_shell::XWaylandShellState,
},
Expand Down Expand Up @@ -704,6 +705,8 @@ impl State {

let a11y_keyboard_monitor_state = A11yKeyboardMonitorState::new(&async_executor);

XdgSystemBellState::new::<State>(dh);

State {
common: Common {
config,
Expand Down
1 change: 1 addition & 0 deletions src/wayland/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ pub mod workspace;
pub mod xdg_activation;
pub mod xdg_foreign;
pub mod xdg_shell;
pub mod xdg_system_bell;
pub mod xwayland_keyboard_grab;
pub mod xwayland_shell;
22 changes: 22 additions & 0 deletions src/wayland/handlers/xdg_system_bell.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: GPL-3.0-only

use crate::{state::State, wayland::protocols::workspace::State as WState};
use smithay::{
delegate_xdg_system_bell, reexports::wayland_server::protocol::wl_surface::WlSurface,
wayland::xdg_system_bell::XdgSystemBellHandler,
};

impl XdgSystemBellHandler for State {
fn ring(&mut self, surface: Option<WlSurface>) {
let shell = self.common.shell.read();

if let Some(surface) = surface {
if let Some((workspace, _output)) = shell.workspace_for_surface(&surface) {
let mut workspace_guard = self.common.workspace_state.update();
workspace_guard.add_workspace_state(&workspace, WState::Urgent);
}
}
}
}

delegate_xdg_system_bell!(State);