meson: require wayland-protocols >= 1.32
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Daniel Eklöf · committed by Daniel Eklöf · parent 22cf3f4 · Browse files · 3 files·+17 added−30 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+17 added−30 removed
- other:+17 added−30 removed
Provenance
- Commit
18a0bb8- Tree
06f07a2- Author
Daniel Eklöf <daniel@ekloef.se>- Committer
Daniel Eklöf <daniel@ekloef.se>- Parent
22cf3f4
3 files changed+17 added−30 removed
modified:CHANGELOG.md+4 added
28 unmodified lines29 * Support for the `cursor-shape-v1` Wayland protocol.30 31 32 ### Changed33+34+* Minimum required version of _wayland-protocols_ is now 1.3235+36+37 ### Deprecated38 ### Removed39 ### Fixed40 544 unmodified linesmodified:meson.build+5 added-10 removed
54 unmodified lines55 fontconfig = dependency('fontconfig')56 pixman = dependency('pixman-1')57 cairo = dependency('cairo', required: get_option('enable-cairo'))58 libepoll = dependency('epoll-shim', required: false)59-wayland_protocols = dependency('wayland-protocols')59+wayland_protocols = dependency('wayland-protocols', version: '>=1.32')60 wayland_client = dependency('wayland-client')61 wayland_cursor = dependency('wayland-cursor')62 xkb = dependency('xkbcommon')63 43 unmodified lines107 wl_proto_xml = [108 'external/wlr-layer-shell-unstable-v1.xml',109 wayland_protocols_datadir + '/stable/xdg-shell/xdg-shell.xml',110 wayland_protocols_datadir + '/unstable/xdg-output/xdg-output-unstable-v1.xml',111- wayland_protocols_datadir + '/staging/xdg-activation/xdg-activation-v1.xml'112- ]111+ wayland_protocols_datadir + '/staging/xdg-activation/xdg-activation-v1.xml',112+ wayland_protocols_datadir + '/staging/cursor-shape/cursor-shape-v1.xml',113+ wayland_protocols_datadir + '/unstable/tablet/tablet-unstable-v2.xml',114+]115 114-if wayland_protocols.version().version_compare('>=1.32')115- add_project_arguments('-DHAVE_CURSOR_SHAPE=1', language: 'c')116- wl_proto_xml += [117- wayland_protocols_datadir + '/staging/cursor-shape/cursor-shape-v1.xml',118- wayland_protocols_datadir + '/unstable/tablet/tablet-unstable-v2.xml']119-endif120-116 foreach prot : wl_proto_xml117 wl_proto_headers += custom_target(118 prot.underscorify() + '-client-header',119 output: '@BASENAME@.h',72 unmodified linesmodified:wayland.c+8 added-20 removed
19 unmodified lines20 #include <xkbcommon/xkbcommon-keysyms.h>21 #include <xkbcommon/xkbcommon-compose.h>22 #include <fontconfig/fontconfig.h>23 24-#include <xdg-output-unstable-v1.h>24+#include <cursor-shape-v1.h>25 #include <wlr-layer-shell-unstable-v1.h>26 #include <xdg-activation-v1.h>27+#include <xdg-output-unstable-v1.h>28 29 #include <tllist.h>30 30-#ifdef HAVE_CURSOR_SHAPE31-#include <cursor-shape-v1.h>32-#endif33-31 #define LOG_MODULE "wayland"32 #define LOG_ENABLE_DBG 033 #include "log.h"34 #include "dmenu.h"148 unmodified lines183 struct zwlr_layer_surface_v1 *layer_surface;184 struct wl_shm *shm;185 struct zxdg_output_manager_v1 *xdg_output_manager;186 struct xdg_activation_v1 *xdg_activation_v1;190-191-#ifdef HAVE_CURSOR_SHAPE187 struct wp_cursor_shape_manager_v1 *cursor_shape_manager;193-#endif188 189 tll(struct monitor) monitors;190 const struct monitor *monitor;191 782 unmodified lines974 .modifiers = &keyboard_modifiers,975 .repeat_info = &keyboard_repeat_info,976 };977 978+static bool984-static bool attempt_cursor_shape(struct wayland *wayl, struct wl_pointer *wl_pointer,985- uint32_t serial) {986-#ifdef HAVE_CURSOR_SHAPE979+attempt_cursor_shape(struct wayland *wayl, struct wl_pointer *wl_pointer,980+ uint32_t serial)981+{982 if (wayl->cursor_shape_manager) {983 struct wp_cursor_shape_device_v1 *device =984 wp_cursor_shape_manager_v1_get_pointer(985 wayl->cursor_shape_manager, wl_pointer);991- wp_cursor_shape_device_v1_set_shape(device, serial,992- WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT);986+ wp_cursor_shape_device_v1_set_shape(987+ device, serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT);988 wp_cursor_shape_device_v1_destroy(device);989 return true;990 }996-#endif991 992 return false;993 }994 638 unmodified lines1633 wayl->xdg_activation_v1 = wl_registry_bind(1634 wayl->registry, name, &xdg_activation_v1_interface, required);1635 }1636 1643-#ifdef HAVE_CURSOR_SHAPE1637 else if (strcmp(interface, wp_cursor_shape_manager_v1_interface.name) == 0) {1638 const uint32_t required = 1;1639 if (!verify_iface_version(interface, version, required))1640 return;1641 1642 wayl->cursor_shape_manager = wl_registry_bind(1643 wayl->registry, name, &wp_cursor_shape_manager_v1_interface, required);1644 }1652-#endif1645 }1646 1647 static void1648 monitor_destroy(struct monitor *mon)508 unmodified lines2157 if (wayl->xdg_output_manager != NULL)2158 zxdg_output_manager_v1_destroy(wayl->xdg_output_manager);2159 if (wayl->xdg_activation_v1 != NULL)2160 xdg_activation_v1_destroy(wayl->xdg_activation_v1);2169-2170-#ifdef HAVE_CURSOR_SHAPE2161 if (wayl->cursor_shape_manager != NULL)2162 wp_cursor_shape_manager_v1_destroy(wayl->cursor_shape_manager);2173-#endif2174-2163 if (wayl->layer_surface != NULL)2164 zwlr_layer_surface_v1_destroy(wayl->layer_surface);2165 if (wayl->layer_shell != NULL)2166 zwlr_layer_shell_v1_destroy(wayl->layer_shell);37 unmodified lines