mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-22 06:59:44 -05:00
Add destroy signals to types that are destroyed by wl_display_destroy
This commit is contained in:
parent
c6955fa89c
commit
20db29779e
35 changed files with 68 additions and 5 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <wlr/types/wlr_tablet_v2.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "tablet-unstable-v2-protocol.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#define TABLET_MANAGER_VERSION 1
|
||||
|
||||
|
|
@ -281,6 +282,7 @@ void wlr_tablet_v2_destroy(struct wlr_tablet_manager_v2 *manager) {
|
|||
wlr_tablet_manager_v2_destroy(pos->resource);
|
||||
}
|
||||
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_global_destroy(manager->wl_global);
|
||||
free(manager);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,11 +155,12 @@ void wlr_gamma_control_manager_destroy(
|
|||
if (!manager) {
|
||||
return;
|
||||
}
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wlr_gamma_control *gamma_control, *tmp;
|
||||
wl_list_for_each_safe(gamma_control, tmp, &manager->controls, link) {
|
||||
gamma_control_destroy(gamma_control);
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
wl_global_destroy(manager->global);
|
||||
free(manager);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,11 +219,12 @@ void wlr_gamma_control_manager_v1_destroy(
|
|||
if (!manager) {
|
||||
return;
|
||||
}
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wlr_gamma_control_v1 *gamma_control, *tmp;
|
||||
wl_list_for_each_safe(gamma_control, tmp, &manager->controls, link) {
|
||||
wl_resource_destroy(gamma_control->resource);
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wl_resource *resource, *resource_tmp;
|
||||
wl_resource_for_each_safe(resource, resource_tmp, &manager->resources) {
|
||||
wl_resource_destroy(resource);
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ void wlr_idle_destroy(struct wlr_idle *idle) {
|
|||
if (!idle) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&idle->events.destroy, idle);
|
||||
wl_list_remove(&idle->display_destroy.link);
|
||||
struct wlr_idle_timeout *timer, *tmp;
|
||||
wl_list_for_each_safe(timer, tmp, &idle->idle_timers, link) {
|
||||
|
|
|
|||
|
|
@ -144,14 +144,15 @@ void wlr_idle_inhibit_v1_destroy(struct wlr_idle_inhibit_manager_v1 *idle_inhibi
|
|||
return;
|
||||
}
|
||||
|
||||
wl_list_remove(&idle_inhibit->display_destroy.link);
|
||||
|
||||
struct wlr_idle_inhibitor_v1 *inhibitor;
|
||||
struct wlr_idle_inhibitor_v1 *tmp;
|
||||
wl_list_for_each_safe(inhibitor, tmp, &idle_inhibit->inhibitors, link) {
|
||||
idle_inhibitor_v1_destroy(inhibitor);
|
||||
}
|
||||
|
||||
wlr_signal_emit_safe(&idle_inhibit->events.destroy, idle_inhibit);
|
||||
wl_list_remove(&idle_inhibit->display_destroy.link);
|
||||
|
||||
struct wl_resource *resource;
|
||||
struct wl_resource *tmp_resource;
|
||||
wl_resource_for_each_safe(resource, tmp_resource, &idle_inhibit->resources) {
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ void wlr_input_inhibit_manager_destroy(
|
|||
input_inhibitor_destroy(manager->active_client,
|
||||
manager->active_inhibitor);
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
wl_global_destroy(manager->global);
|
||||
free(manager);
|
||||
|
|
|
|||
|
|
@ -464,6 +464,7 @@ void wlr_layer_shell_destroy(struct wlr_layer_shell *layer_shell) {
|
|||
wl_resource_for_each_safe(client, tmp, &layer_shell->client_resources) {
|
||||
wl_resource_destroy(client);
|
||||
}
|
||||
wlr_signal_emit_safe(&layer_shell->events.destroy, layer_shell);
|
||||
wl_list_remove(&layer_shell->display_destroy.link);
|
||||
wl_global_destroy(layer_shell->global);
|
||||
free(layer_shell);
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@ void wlr_primary_selection_device_manager_destroy(
|
|||
if (manager == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
// TODO: free resources
|
||||
wl_global_destroy(manager->global);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <wlr/types/wlr_screencopy_v1.h>
|
||||
#include <wlr/backend.h>
|
||||
#include "wlr-screencopy-unstable-v1-protocol.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#define SCREENCOPY_MANAGER_VERSION 1
|
||||
|
||||
|
|
@ -306,6 +307,7 @@ void wlr_screencopy_manager_v1_destroy(
|
|||
if (manager == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wlr_screencopy_frame_v1 *frame, *tmp_frame;
|
||||
wl_list_for_each_safe(frame, tmp_frame, &manager->frames, link) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <wlr/types/wlr_screenshooter.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "screenshooter-protocol.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
static struct wlr_screenshot *screenshot_from_resource(
|
||||
struct wl_resource *resource) {
|
||||
|
|
@ -177,6 +178,7 @@ void wlr_screenshooter_destroy(struct wlr_screenshooter *screenshooter) {
|
|||
wl_list_for_each_safe(screenshot, tmp, &screenshooter->screenshots, link) {
|
||||
screenshot_destroy(screenshot);
|
||||
}
|
||||
wlr_signal_emit_safe(&screenshooter->events.destroy, screenshooter);
|
||||
wl_global_destroy(screenshooter->global);
|
||||
free(screenshooter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,12 +167,13 @@ void wlr_server_decoration_manager_destroy(
|
|||
if (manager == NULL) {
|
||||
return;
|
||||
}
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wlr_server_decoration *decoration, *tmp_decoration;
|
||||
wl_list_for_each_safe(decoration, tmp_decoration, &manager->decorations,
|
||||
link) {
|
||||
server_decoration_destroy(decoration);
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wl_resource *resource, *tmp_resource;
|
||||
wl_resource_for_each_safe(resource, tmp_resource, &manager->resources) {
|
||||
server_decoration_manager_destroy_resource(resource);
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ struct wlr_virtual_keyboard_manager_v1*
|
|||
|
||||
void wlr_virtual_keyboard_manager_v1_destroy(
|
||||
struct wlr_virtual_keyboard_manager_v1 *manager) {
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
wl_global_destroy(manager->global);
|
||||
struct wl_resource *resource, *resource_tmp;
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ void wlr_xdg_decoration_manager_v1_destroy(
|
|||
if (manager == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
struct wlr_xdg_toplevel_decoration_v1 *decoration, *tmp_decoration;
|
||||
wl_list_for_each_safe(decoration, tmp_decoration, &manager->decorations,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <wlr/types/wlr_xdg_output.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "xdg-output-unstable-v1-protocol.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
#define OUTPUT_MANAGER_VERSION 2
|
||||
|
||||
|
|
@ -245,6 +246,7 @@ void wlr_xdg_output_manager_destroy(struct wlr_xdg_output_manager *manager) {
|
|||
wl_resource_for_each_safe(resource, resource_tmp, &manager->resources) {
|
||||
wl_resource_destroy(resource);
|
||||
}
|
||||
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
||||
wl_list_remove(&manager->layout_add.link);
|
||||
wl_list_remove(&manager->layout_change.link);
|
||||
wl_list_remove(&manager->layout_destroy.link);
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ void wlr_xdg_shell_destroy(struct wlr_xdg_shell *xdg_shell) {
|
|||
if (!xdg_shell) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&xdg_shell->events.destroy, xdg_shell);
|
||||
wl_list_remove(&xdg_shell->display_destroy.link);
|
||||
wl_global_destroy(xdg_shell->global);
|
||||
free(xdg_shell);
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ void wlr_xdg_shell_v6_destroy(struct wlr_xdg_shell_v6 *xdg_shell) {
|
|||
if (!xdg_shell) {
|
||||
return;
|
||||
}
|
||||
wlr_signal_emit_safe(&xdg_shell->events.destroy, xdg_shell);
|
||||
wl_list_remove(&xdg_shell->display_destroy.link);
|
||||
wl_global_destroy(xdg_shell->global);
|
||||
free(xdg_shell);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue