|
73 | 73 | #include "relative-pointer-unstable-v1-client-protocol.h"
|
74 | 74 | #include "idle-inhibit-unstable-v1-client-protocol.h"
|
75 | 75 | #include "fractional-scale-v1-client-protocol.h"
|
| 76 | +#include "cursor-shape-v1-client-protocol.h" |
76 | 77 |
|
77 | 78 | using ::android::hardware::hidl_string;
|
78 | 79 |
|
@@ -807,9 +808,17 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
|
807 | 808 | {
|
808 | 809 | struct display *display = (struct display *)data;
|
809 | 810 | display->pointer_surface = surface;
|
810 |
| - if (display->cursor_surface) |
811 |
| - wl_pointer_set_cursor(pointer, serial, |
812 |
| - display->cursor_surface, 0, 0); |
| 811 | + if (display->cursor_shape_manager != NULL) { |
| 812 | + struct wp_cursor_shape_device_v1 *device = |
| 813 | + wp_cursor_shape_manager_v1_get_pointer(display->cursor_shape_manager, pointer); |
| 814 | + wp_cursor_shape_device_v1_set_shape(device, serial, |
| 815 | + WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT); |
| 816 | + wp_cursor_shape_device_v1_destroy(device); |
| 817 | + } else { |
| 818 | + if (display->cursor_surface) |
| 819 | + wl_pointer_set_cursor(pointer, serial, |
| 820 | + display->cursor_surface, 0, 0); // FIXME: cursor hotspot with scale |
| 821 | + } |
813 | 822 | }
|
814 | 823 |
|
815 | 824 | static void
|
@@ -1817,6 +1826,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
1817 | 1826 | &wl_output_interface, std::min(version, 3U));
|
1818 | 1827 | wl_output_add_listener(d->output, &output_listener, d);
|
1819 | 1828 | wl_display_roundtrip(d->display);
|
| 1829 | + } else if (strcmp(interface, "wp_cursor_shape_manager_v1") == 0) { |
| 1830 | + d->cursor_shape_manager = (struct wp_cursor_shape_manager_v1*)wl_registry_bind(registry, id, |
| 1831 | + &wp_cursor_shape_manager_v1_interface, 1); |
1820 | 1832 | } else if (strcmp(interface, "wp_presentation") == 0) {
|
1821 | 1833 | bool no_presentation = property_get_bool("persist.waydroid.no_presentation", false);
|
1822 | 1834 | if (!no_presentation) {
|
|
0 commit comments