aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-06 21:38:32 +0100
committerGitHub <noreply@github.com>2018-06-06 21:38:32 +0100
commit211463ba8709e1ac94944deb11b5669f2d3b32e4 (patch)
tree82f0f6941c006553fd6ac8d06856f44d58c00618
parent1a07bf95ae430d9709d51a2531b10927f7ae0c44 (diff)
parenta989104a6b647bde0eeffd31a3d7aebe7ff29dd2 (diff)
Merge pull request #1045 from ammen99/master
xdg-shells: add a set_parent signal to toplevel surfaces
-rw-r--r--include/wlr/types/wlr_xdg_shell.h1
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h1
-rw-r--r--types/xdg_shell/wlr_xdg_toplevel.c2
-rw-r--r--types/xdg_shell_v6/wlr_xdg_toplevel_v6.c2
4 files changed, 6 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 6a967bc7..01dc17fe 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -118,6 +118,7 @@ struct wlr_xdg_toplevel {
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
+ struct wl_signal set_parent;
} events;
};
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 07c831ce..5f98eb13 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -126,6 +126,7 @@ struct wlr_xdg_toplevel_v6 {
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
+ struct wl_signal set_parent;
} events;
};
diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c
index 5968c835..fa0ec929 100644
--- a/types/xdg_shell/wlr_xdg_toplevel.c
+++ b/types/xdg_shell/wlr_xdg_toplevel.c
@@ -218,6 +218,7 @@ static void xdg_toplevel_handle_set_parent(struct wl_client *client,
}
surface->toplevel->parent = parent;
+ wlr_signal_emit_safe(&surface->toplevel->events.set_parent, surface);
}
static void xdg_toplevel_handle_set_title(struct wl_client *client,
@@ -464,6 +465,7 @@ void create_xdg_toplevel(struct wlr_xdg_surface *xdg_surface,
wl_signal_init(&xdg_surface->toplevel->events.request_move);
wl_signal_init(&xdg_surface->toplevel->events.request_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu);
+ wl_signal_init(&xdg_surface->toplevel->events.set_parent);
xdg_surface->role = WLR_XDG_SURFACE_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface;
diff --git a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
index 2bcfaf0d..0f9a26d3 100644
--- a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
+++ b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
@@ -42,6 +42,7 @@ static void xdg_toplevel_handle_set_parent(struct wl_client *client,
}
surface->toplevel->parent = parent;
+ wlr_signal_emit_safe(&surface->toplevel->events.set_parent, surface);
}
static void xdg_toplevel_handle_set_title(struct wl_client *client,
@@ -434,6 +435,7 @@ void create_xdg_toplevel_v6(struct wlr_xdg_surface_v6 *xdg_surface,
wl_signal_init(&xdg_surface->toplevel->events.request_move);
wl_signal_init(&xdg_surface->toplevel->events.request_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu);
+ wl_signal_init(&xdg_surface->toplevel->events.set_parent);
xdg_surface->role = WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface;