You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Implement DisplayServer.beep.
This commit is contained in:
@@ -497,6 +497,12 @@ void WaylandThread::_wl_registry_on_global(void *data, struct wl_registry *wl_re
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(interface, xdg_system_bell_v1_interface.name) == 0) {
|
||||
registry->xdg_system_bell = (struct xdg_system_bell_v1 *)wl_registry_bind(wl_registry, name, &xdg_system_bell_v1_interface, 1);
|
||||
registry->xdg_system_bell_name = name;
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(interface, xdg_activation_v1_interface.name) == 0) {
|
||||
registry->xdg_activation = (struct xdg_activation_v1 *)wl_registry_bind(wl_registry, name, &xdg_activation_v1_interface, 1);
|
||||
registry->xdg_activation_name = name;
|
||||
@@ -692,6 +698,17 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == registry->xdg_system_bell_name) {
|
||||
if (registry->xdg_system_bell) {
|
||||
xdg_system_bell_v1_destroy(registry->xdg_system_bell);
|
||||
registry->xdg_system_bell = nullptr;
|
||||
}
|
||||
|
||||
registry->xdg_system_bell_name = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == registry->xdg_activation_name) {
|
||||
if (registry->xdg_activation) {
|
||||
xdg_activation_v1_destroy(registry->xdg_activation);
|
||||
@@ -3282,6 +3299,12 @@ struct wl_surface *WaylandThread::window_get_wl_surface(DisplayServer::WindowID
|
||||
return ws.wl_surface;
|
||||
}
|
||||
|
||||
void WaylandThread::beep() const {
|
||||
if (registry.xdg_system_bell) {
|
||||
xdg_system_bell_v1_ring(registry.xdg_system_bell, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void WaylandThread::window_set_max_size(DisplayServer::WindowID p_window_id, const Size2i &p_size) {
|
||||
// TODO: Use window IDs for multiwindow support.
|
||||
WindowState &ws = main_window;
|
||||
@@ -4364,6 +4387,10 @@ void WaylandThread::destroy() {
|
||||
xdg_activation_v1_destroy(registry.xdg_activation);
|
||||
}
|
||||
|
||||
if (registry.xdg_system_bell) {
|
||||
xdg_system_bell_v1_destroy(registry.xdg_system_bell);
|
||||
}
|
||||
|
||||
if (registry.xdg_decoration_manager) {
|
||||
zxdg_decoration_manager_v1_destroy(registry.xdg_decoration_manager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user