Skip to content
Myr

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

3 files+17 added−30 removed

modified:CHANGELOG.md+4 added
28 unmodified lines
29* Support for the `cursor-shape-v1` Wayland protocol.303132### Changed3334* Minimum required version of _wayland-protocols_ is now 1.32353637### Deprecated38### Removed39### Fixed40
544 unmodified lines
modified:meson.build+5 added-10 removed
54 unmodified lines
55fontconfig = dependency('fontconfig')56pixman = dependency('pixman-1')57cairo = dependency('cairo', required: get_option('enable-cairo'))58libepoll = dependency('epoll-shim', required: false)59wayland_protocols = dependency('wayland-protocols')59wayland_protocols = dependency('wayland-protocols', version: '>=1.32')60wayland_client = dependency('wayland-client')61wayland_cursor = dependency('wayland-cursor')62xkb = dependency('xkbcommon')63
43 unmodified lines
107wl_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]115114if 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']119endif120116foreach prot : wl_proto_xml117 wl_proto_headers += custom_target(118 prot.underscorify() + '-client-header',119 output: '@BASENAME@.h',
72 unmodified lines
modified:wayland.c+8 added-20 removed
19 unmodified lines
20#include <xkbcommon/xkbcommon-keysyms.h>21#include <xkbcommon/xkbcommon-compose.h>22#include <fontconfig/fontconfig.h>2324#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>2829#include <tllist.h>3030#ifdef HAVE_CURSOR_SHAPE31#include <cursor-shape-v1.h>32#endif3331#define LOG_MODULE "wayland"32#define LOG_ENABLE_DBG 033#include "log.h"34#include "dmenu.h"
148 unmodified lines
183 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;190191#ifdef HAVE_CURSOR_SHAPE187 struct wp_cursor_shape_manager_v1 *cursor_shape_manager;193#endif188189 tll(struct monitor) monitors;190 const struct monitor *monitor;191
782 unmodified lines
974 .modifiers = &keyboard_modifiers,975 .repeat_info = &keyboard_repeat_info,976};977978static bool984static bool attempt_cursor_shape(struct wayland *wayl, struct wl_pointer *wl_pointer,985 uint32_t serial) {986#ifdef HAVE_CURSOR_SHAPE979attempt_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#endif991992 return false;993}994
638 unmodified lines
1633 wayl->xdg_activation_v1 = wl_registry_bind(1634 wayl->registry, name, &xdg_activation_v1_interface, required);1635 }16361643#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;16411642 wayl->cursor_shape_manager = wl_registry_bind(1643 wayl->registry, name, &wp_cursor_shape_manager_v1_interface, required);1644 }1652#endif1645}16461647static void1648monitor_destroy(struct monitor *mon)
508 unmodified lines
2157 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);21692170#ifdef HAVE_CURSOR_SHAPE2161 if (wayl->cursor_shape_manager != NULL)2162 wp_cursor_shape_manager_v1_destroy(wayl->cursor_shape_manager);2173#endif21742163 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