aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-09-05 16:14:25 +0300
committerKirill Primak <vyivel@eclair.cafe>2023-11-23 12:52:20 +0000
commitc85838892d56111809aa2edb83a2f22428bfa806 (patch)
tree381a2a266c76bbeab2fe2abdc4ff1981bb6bd8fd /include
parentd61ec694b352c0f21c06958c5ef0417f3e424e3c (diff)
xdg-{shell,decoration}: improve events
This commit changes the behavior of `new_*` signals to better match their names (see https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3608). wlr_xdg_shell.events.new_surface is now emitted when an xdg_surface is created, and wlr_xdg_shell.events.new_{toplevel,popup} events are introduced to get notified when an xdg_{toplevel,popup} is created. Same applies to `wlr_xdg_decoration_manager_v1.events.new_toplevel_decoration`. As a result, wlr_xdg_surface.added and wlr_xdg_toplevel_decoration_v1.added are removed, as we no longer need to track whether the corresponding event was emitted. Additionally, this commit changes the behavior of wlr_xdg_surface.events.destroy: it is now emitted when the xdg_surface is destroyed, as the name suggests. wlr_xdg_{toplevel,popup}.events.destroy events are added to get notified when an xdg_{toplevel,popup} is destroyed.
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_xdg_decoration_v1.h4
-rw-r--r--include/wlr/types/wlr_xdg_foreign_v1.h4
-rw-r--r--include/wlr/types/wlr_xdg_foreign_v2.h4
-rw-r--r--include/wlr/types/wlr_xdg_shell.h8
4 files changed, 12 insertions, 8 deletions
diff --git a/include/wlr/types/wlr_xdg_decoration_v1.h b/include/wlr/types/wlr_xdg_decoration_v1.h
index 61ce4bc1..d8ec038d 100644
--- a/include/wlr/types/wlr_xdg_decoration_v1.h
+++ b/include/wlr/types/wlr_xdg_decoration_v1.h
@@ -45,8 +45,6 @@ struct wlr_xdg_toplevel_decoration_v1 {
enum wlr_xdg_toplevel_decoration_v1_mode scheduled_mode;
enum wlr_xdg_toplevel_decoration_v1_mode requested_mode;
- bool added;
-
struct wl_list configure_list; // wlr_xdg_toplevel_decoration_v1_configure.link
struct {
@@ -54,7 +52,7 @@ struct wlr_xdg_toplevel_decoration_v1 {
struct wl_signal request_mode;
} events;
- struct wl_listener surface_destroy;
+ struct wl_listener toplevel_destroy;
struct wl_listener surface_configure;
struct wl_listener surface_ack_configure;
struct wl_listener surface_commit;
diff --git a/include/wlr/types/wlr_xdg_foreign_v1.h b/include/wlr/types/wlr_xdg_foreign_v1.h
index 45f060df..bb26fcfc 100644
--- a/include/wlr/types/wlr_xdg_foreign_v1.h
+++ b/include/wlr/types/wlr_xdg_foreign_v1.h
@@ -34,7 +34,7 @@ struct wlr_xdg_exported_v1 {
struct wlr_xdg_foreign_exported base;
struct wl_resource *resource;
- struct wl_listener xdg_surface_destroy;
+ struct wl_listener xdg_toplevel_destroy;
struct wl_list link; // wlr_xdg_foreign_v1.exporter.objects
};
@@ -54,7 +54,7 @@ struct wlr_xdg_imported_child_v1 {
struct wl_list link; // wlr_xdg_imported_v1.children
- struct wl_listener xdg_surface_destroy;
+ struct wl_listener xdg_toplevel_destroy;
struct wl_listener xdg_toplevel_set_parent;
};
diff --git a/include/wlr/types/wlr_xdg_foreign_v2.h b/include/wlr/types/wlr_xdg_foreign_v2.h
index b091b459..d82854b4 100644
--- a/include/wlr/types/wlr_xdg_foreign_v2.h
+++ b/include/wlr/types/wlr_xdg_foreign_v2.h
@@ -34,7 +34,7 @@ struct wlr_xdg_exported_v2 {
struct wlr_xdg_foreign_exported base;
struct wl_resource *resource;
- struct wl_listener xdg_surface_destroy;
+ struct wl_listener xdg_toplevel_destroy;
struct wl_list link; // wlr_xdg_foreign_v2.exporter.objects
};
@@ -54,7 +54,7 @@ struct wlr_xdg_imported_child_v2 {
struct wl_list link; // wlr_xdg_imported_v2.children
- struct wl_listener xdg_surface_destroy;
+ struct wl_listener xdg_toplevel_destroy;
struct wl_listener xdg_toplevel_set_parent;
};
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 29ced596..9df690f9 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -26,6 +26,8 @@ struct wlr_xdg_shell {
struct {
struct wl_signal new_surface; // struct wlr_xdg_surface
+ struct wl_signal new_toplevel; // struct wlr_xdg_toplevel
+ struct wl_signal new_popup; // struct wlr_xdg_popup
struct wl_signal destroy;
} events;
@@ -102,6 +104,8 @@ struct wlr_xdg_popup {
struct wlr_xdg_popup_state current, pending;
struct {
+ struct wl_signal destroy;
+
struct wl_signal reposition;
} events;
@@ -184,6 +188,8 @@ struct wlr_xdg_toplevel {
char *app_id;
struct {
+ struct wl_signal destroy;
+
// Note: as per xdg-shell protocol, the compositor has to
// handle state requests by sending a configure event,
// even if it didn't actually change the state. Therefore,
@@ -249,7 +255,7 @@ struct wlr_xdg_surface {
struct wl_list popups; // wlr_xdg_popup.link
- bool added, configured;
+ bool configured;
struct wl_event_source *configure_idle;
uint32_t scheduled_serial;
struct wl_list configure_list;