Skip to content

Commit bf67330

Browse files
committed
feat: xdg system bell impl (if it would link correctly)
1 parent 421df69 commit bf67330

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

include/Server.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ struct Server {
104104
wlr_text_input_manager_v3 *wlr_text_input_manager;
105105
wl_listener new_text_input;
106106

107+
// wlr_xdg_system_bell_v1 *wlr_xdg_system_bell;
108+
// wl_listener run_system_bell;
109+
107110
wlr_input_method_manager_v2 *wlr_input_method_manager;
108111
wlr_ext_foreign_toplevel_list_v1 *wlr_foreign_toplevel_list;
109112
wlr_foreign_toplevel_manager_v1 *wlr_foreign_toplevel_manager;

include/wlr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ extern "C" {
8080
#include <wlr/types/wlr_virtual_pointer_v1.h>
8181
#include <wlr/types/wlr_xdg_activation_v1.h>
8282
#include <wlr/types/wlr_xdg_output_v1.h>
83+
#include <wlr/types/wlr_xdg_system_bell_v1.h>
8384

8485
// XWayland
8586
#ifdef XWAYLAND

src/Server.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,19 @@ Server::Server(Config *config) : config(config) {
671671
};
672672
wl_signal_add(&wlr_text_input_manager->events.text_input, &new_text_input);
673673

674+
// system bell
675+
// wlr_xdg_system_bell = wlr_xdg_system_bell_v1_create(display, 1);
676+
677+
// run_system_bell.notify = [](wl_listener *listener, void *data) {
678+
// Server *server = wl_container_of(listener, server, run_system_bell);
679+
// [[maybe_unused]] const auto event =
680+
// static_cast<wlr_xdg_system_bell_v1_ring_event *>(data);
681+
682+
// server->spawn("ffplay -nodisp -autoexit "
683+
// "/usr/share/sounds/freedesktop/stereo/bell.oga");
684+
//};
685+
// wl_signal_add(&wlr_xdg_system_bell->events.ring, &run_system_bell);
686+
674687
// foreign toplevel list
675688
wlr_foreign_toplevel_list =
676689
wlr_ext_foreign_toplevel_list_v1_create(display, 1);
@@ -895,6 +908,7 @@ Server::~Server() {
895908
wl_list_remove(&new_pointer_constraint.link);
896909
wl_list_remove(&xdg_activation_activate.link);
897910
wl_list_remove(&new_text_input.link);
911+
// wl_list_remove(&run_system_bell.link);
898912

899913
LayerSurface *surface, *tmp;
900914
wl_list_for_each_safe(surface, tmp, &layer_surfaces, link) delete surface;

0 commit comments

Comments
 (0)