aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-03 14:06:43 -0500
committerGitHub <noreply@github.com>2017-12-03 14:06:43 -0500
commitaa7efa1564f7e92318da9212c37bf3096361453c (patch)
tree1797db0c9495a320ce802b238c554de4cddd94e1
parent8eceaa2291febc70d32d6791693cbbcad407d401 (diff)
parent20545b09faf52bfde4513e6fbe519d4df686e404 (diff)
Merge pull request #457 from acrisci/feature/wl-shell-commit
wl-shell: add commit event
-rw-r--r--include/wlr/types/wlr_wl_shell.h1
-rw-r--r--rootston/wl_shell.c3
-rw-r--r--types/wlr_wl_shell.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h
index ec087693..986f92e8 100644
--- a/include/wlr/types/wlr_wl_shell.h
+++ b/include/wlr/types/wlr_wl_shell.h
@@ -77,6 +77,7 @@ struct wlr_wl_shell_surface {
struct {
struct wl_signal destroy;
+ struct wl_signal commit;
struct wl_signal ping_timeout;
struct wl_signal request_move;
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index 5fd6352d..d0aad407 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -150,8 +150,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
roots_surface->set_state.notify = handle_set_state;
wl_signal_add(&surface->events.set_state, &roots_surface->set_state);
roots_surface->surface_commit.notify = handle_surface_commit;
- wl_signal_add(&surface->surface->events.commit,
- &roots_surface->surface_commit);
+ wl_signal_add(&surface->events.commit, &roots_surface->surface_commit);
struct roots_view *view = calloc(1, sizeof(struct roots_view));
if (!view) {
diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c
index 6174c872..ee72856c 100644
--- a/types/wlr_wl_shell.c
+++ b/types/wlr_wl_shell.c
@@ -459,6 +459,8 @@ static void handle_wlr_surface_committed(struct wl_listener *listener,
surface->popup_state->seat);
shell_pointer_grab_maybe_end(&grab->pointer_grab);
}
+
+ wl_signal_emit(&surface->events.commit, surface);
}
static int shell_surface_ping_timeout(void *user_data) {
@@ -509,6 +511,7 @@ static void shell_protocol_get_shell_surface(struct wl_client *client,
wl_surface->resource);
wl_signal_init(&wl_surface->events.destroy);
+ wl_signal_init(&wl_surface->events.commit);
wl_signal_init(&wl_surface->events.ping_timeout);
wl_signal_init(&wl_surface->events.request_move);
wl_signal_init(&wl_surface->events.request_resize);