mirror of
https://github.com/swaywm/sway.git
synced 2026-04-21 06:46:22 -04:00
tree/container: Fix crash when going fullscreen
This commit is contained in:
parent
7d0351b411
commit
eb26f27478
1 changed files with 24 additions and 11 deletions
|
|
@ -1129,26 +1129,39 @@ static void set_fullscreen(struct sway_container *con, bool enable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_linux_dmabuf_feedback_v1_tranche tranches[] = {
|
size_t tranche_size = sizeof(struct wlr_linux_dmabuf_feedback_v1_tranche);
|
||||||
{
|
struct wl_array tranches;
|
||||||
.target_device = scanout_dev,
|
wl_array_init(&tranches);
|
||||||
.flags = ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT,
|
|
||||||
.formats = &scanout_formats,
|
struct wlr_linux_dmabuf_feedback_v1_tranche *ptr;
|
||||||
},
|
ptr = wl_array_add(&tranches, tranche_size);
|
||||||
{
|
if (!sway_assert(ptr, "Unable to allocate tranche")) {
|
||||||
.target_device = render_dev,
|
return;
|
||||||
.formats = renderer_formats,
|
}
|
||||||
},
|
*ptr = (struct wlr_linux_dmabuf_feedback_v1_tranche) {
|
||||||
|
.target_device = scanout_dev,
|
||||||
|
.flags = ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT,
|
||||||
|
.formats = scanout_formats,
|
||||||
|
};
|
||||||
|
|
||||||
|
ptr = wl_array_add(&tranches, tranche_size);
|
||||||
|
if (!sway_assert(ptr, "Unable to allocate tranche")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*ptr = (struct wlr_linux_dmabuf_feedback_v1_tranche) {
|
||||||
|
.target_device = render_dev,
|
||||||
|
.formats = *renderer_formats,
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct wlr_linux_dmabuf_feedback_v1 feedback = {
|
const struct wlr_linux_dmabuf_feedback_v1 feedback = {
|
||||||
.main_device = render_dev,
|
.main_device = render_dev,
|
||||||
.tranches = tranches,
|
.tranches = tranches,
|
||||||
.tranches_len = sizeof(tranches) / sizeof(tranches[0]),
|
|
||||||
};
|
};
|
||||||
wlr_linux_dmabuf_v1_set_surface_feedback(server.linux_dmabuf_v1,
|
wlr_linux_dmabuf_v1_set_surface_feedback(server.linux_dmabuf_v1,
|
||||||
con->view->surface, &feedback);
|
con->view->surface, &feedback);
|
||||||
|
|
||||||
|
wl_array_release(&tranches);
|
||||||
|
|
||||||
wlr_drm_format_set_finish(&scanout_formats);
|
wlr_drm_format_set_finish(&scanout_formats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue