aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-01-04 13:42:53 +0100
committerGitHub <noreply@github.com>2019-01-04 13:42:53 +0100
commit610f5bfc7712657fafea507f3d830cd6d60dc836 (patch)
tree8be316c900366e386349b28d5943105deee88a71 /include
parentbcf48931db14f24fcd35a6999969864ca2539d32 (diff)
parent78caed0c99f64e6192778ea90371848323f72379 (diff)
Merge pull request #1432 from ForTheReallys/relative-pointers
Relative pointers
Diffstat (limited to 'include')
-rw-r--r--include/rootston/desktop.h2
-rw-r--r--include/wlr/types/meson.build1
-rw-r--r--include/wlr/types/wlr_pointer.h1
-rw-r--r--include/wlr/types/wlr_relative_pointer_v1.h81
4 files changed, 85 insertions, 0 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index b1fcaca0..56d2a129 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -17,6 +17,7 @@
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_gtk_primary_selection.h>
+#include <wlr/types/wlr_relative_pointer_v1.h>
#include <wlr/types/wlr_screencopy_v1.h>
#include <wlr/types/wlr_screenshooter.h>
#include <wlr/types/wlr_text_input_v3.h>
@@ -65,6 +66,7 @@ struct roots_desktop {
struct wlr_pointer_constraints_v1 *pointer_constraints;
struct wlr_presentation *presentation;
struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager_v1;
+ struct wlr_relative_pointer_manager_v1 *relative_pointer_manager;
struct wl_listener new_output;
struct wl_listener layout_change;
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build
index 752c0dea..dfb55ec9 100644
--- a/include/wlr/types/meson.build
+++ b/include/wlr/types/meson.build
@@ -27,6 +27,7 @@ install_headers(
'wlr_presentation_time.h',
'wlr_primary_selection.h',
'wlr_region.h',
+ 'wlr_relative_pointer_v1.h',
'wlr_screencopy_v1.h',
'wlr_screenshooter.h',
'wlr_seat.h',
diff --git a/include/wlr/types/wlr_pointer.h b/include/wlr/types/wlr_pointer.h
index 7dc643ae..6da4c02a 100644
--- a/include/wlr/types/wlr_pointer.h
+++ b/include/wlr/types/wlr_pointer.h
@@ -32,6 +32,7 @@ struct wlr_event_pointer_motion {
struct wlr_input_device *device;
uint32_t time_msec;
double delta_x, delta_y;
+ double unaccel_dx, unaccel_dy;
};
struct wlr_event_pointer_motion_absolute {
diff --git a/include/wlr/types/wlr_relative_pointer_v1.h b/include/wlr/types/wlr_relative_pointer_v1.h
new file mode 100644
index 00000000..f9f91219
--- /dev/null
+++ b/include/wlr/types/wlr_relative_pointer_v1.h
@@ -0,0 +1,81 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_TYPES_WLR_RELATIVE_POINTER_V1_H
+#define WLR_TYPES_WLR_RELATIVE_POINTER_V1_H
+
+#include <wayland-server.h>
+
+
+/**
+ * This protocol specifies a set of interfaces used for making clients able to
+ * receive relative pointer events not obstructed by barriers (such as the
+ * monitor edge or pointer constraints).
+ */
+
+
+/**
+ * A global interface used for getting the relative pointer object for a given
+ * pointer.
+ */
+
+struct wlr_relative_pointer_manager_v1 {
+ struct wl_global *global;
+ struct wl_list resources; // wl_resource_get_link()
+ struct wl_list relative_pointers; // wlr_relative_pointer_v1::link
+
+ struct {
+ struct wl_signal destroy;
+ struct wl_signal new_relative_pointer; //wlr_relative_pointer_v1
+ } events;
+
+ struct wl_listener display_destroy_listener;
+
+ void *data;
+};
+
+
+/**
+ * A wp_relative_pointer object is an extension to the wl_pointer interface
+ * used for emitting relative pointer events. It shares the same focus as
+ * wl_pointer objects of the same seat and will only emit events when it has
+ * focus.
+ */
+
+struct wlr_relative_pointer_v1 {
+ struct wl_resource *resource;
+ struct wl_resource *pointer;
+ struct wlr_seat *seat;
+ struct wl_list link; // wlr_relative_pointer_manager_v1::relative_pointers
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ struct wl_listener seat_destroy;
+ struct wl_listener pointer_destroy;
+
+ void *data;
+};
+
+struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_manager_v1_create(
+ struct wl_display *display);
+void wlr_relative_pointer_manager_v1_destroy(
+ struct wlr_relative_pointer_manager_v1 *relative_pointer_manager);
+
+/**
+ * Send a relative motion event to the seat with the same wl_pointer as relative_pointer
+ */
+void wlr_relative_pointer_v1_send_relative_motion(
+ struct wlr_relative_pointer_v1 *relative_pointer, uint64_t time_msec,
+ double dx, double dy, double dx_unaccel, double dy_unaccel);
+
+struct wlr_relative_pointer_v1 *wlr_relative_pointer_v1_from_resource(
+ struct wl_resource *resource);
+
+#endif