diff options
author | Mikkel Oscar Lyderik <[email protected]> | 2016-02-08 12:06:33 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <[email protected]> | 2016-02-08 12:39:07 +0100 |
commit | 6f7cbf2eaca42c12af9bd4a8c3cc36dc6b180517 (patch) | |
tree | 6f0227ce0465b90443355672f9fabb58ccbe5ca8 /sway/handlers.c | |
parent | be6455b295ed5e4ac6c6a3dc756d154c3c908e19 (diff) |
Replace deprecated function wlc_output_get_pixels.
This makes IPC GET_PIXELS use the new `wlc_pixels_read` call instead of
the deprecated `wlc_output_get_pixels`.
The old version worked by passing a callback function to wlc which would
grab the pixels and send them to the IPC client.
The new version works by maintaining a list of clients who have
requested the pixels of some output and then grap and send the pixels in
the output_post_render hook of the `wlc_interface`.
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index bb0c68e8..d3fbdc0f 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -150,6 +150,10 @@ static void handle_output_pre_render(wlc_handle output) { } } +static void handle_output_post_render(wlc_handle output) { + ipc_get_pixels(output); +} + static void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) { sway_log(L_DEBUG, "Output %u resolution changed to %d x %d", (unsigned int)output, to->w, to->h); swayc_t *c = swayc_by_handle(output); @@ -675,7 +679,8 @@ struct wlc_interface interface = { .resolution = handle_output_resolution_change, .focus = handle_output_focused, .render = { - .pre = handle_output_pre_render + .pre = handle_output_pre_render, + .post = handle_output_post_render } }, .view = { |