mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: #ifdef guard code related to wl_shm_release()
This commit is contained in:
parent
87aac8708d
commit
e11a4ab6af
1 changed files with 6 additions and 0 deletions
|
|
@ -1129,7 +1129,11 @@ handle_global(void *data, struct wl_registry *registry,
|
|||
wayl->shm = wl_registry_bind(
|
||||
wayl->registry, name, &wl_shm_interface, min(version, preferred));
|
||||
wl_shm_add_listener(wayl->shm, &shm_listener, wayl);
|
||||
#if defined(WL_SHM_RELEASE_SINCE_VERSION)
|
||||
wayl->use_shm_release = version >= WL_SHM_RELEASE_SINCE_VERSION;
|
||||
#else
|
||||
wayl->use_shm_release = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (streq(interface, xdg_wm_base_interface.name)) {
|
||||
|
|
@ -1698,9 +1702,11 @@ wayl_destroy(struct wayland *wayl)
|
|||
if (wayl->primary_selection_device_manager != NULL)
|
||||
zwp_primary_selection_device_manager_v1_destroy(wayl->primary_selection_device_manager);
|
||||
if (wayl->shm != NULL) {
|
||||
#if defined(WL_SHM_RELEASE_SINCE_VERSION)
|
||||
if (wayl->use_shm_release)
|
||||
wl_shm_release(wayl->shm);
|
||||
else
|
||||
#endif
|
||||
wl_shm_destroy(wayl->shm);
|
||||
}
|
||||
if (wayl->sub_compositor != NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue