mirror of
https://github.com/swaywm/sway.git
synced 2025-11-08 13:29:50 -05:00
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`.
This commit is contained in:
parent
be6455b295
commit
6f7cbf2eac
3 changed files with 70 additions and 18 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue