diff options
Diffstat (limited to 'rt')
| -rw-r--r-- | rt/include/plugin.h | 6 | ||||
| -rw-r--r-- | rt/src/wl.c | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/rt/include/plugin.h b/rt/include/plugin.h index d7ae18b..3098602 100644 --- a/rt/include/plugin.h +++ b/rt/include/plugin.h @@ -144,9 +144,9 @@ typedef struct PLUGIN { uint32_t modifiers, opqst_t state)); /* Absolute motion only for now; relative motion stays in the runtime. */ - EXPORT(opqst_t (*plugin_handle_motion)( - struct wlr_pointer_motion_absolute_event *event, uint32_t modifiers, - double lx, double ly, opqst_t state)); + EXPORT(opqst_t (*plugin_handle_motion)(void *event, uint32_t modifiers, + uint32_t is_absolute, double lx, + double ly, opqst_t state)); /* * Handles a surface being mapped, unmapped or destroyed. diff --git a/rt/src/wl.c b/rt/src/wl.c index f528c22..8963e39 100644 --- a/rt/src/wl.c +++ b/rt/src/wl.c @@ -429,6 +429,9 @@ static void server_cursor_motion(struct wl_listener *listener, void *data) struct montis_server *server = wl_container_of(listener, server, cursor_motion); struct wlr_pointer_motion_event *event = data; + struct wlr_seat *seat = server->seat; + struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat); + uint32_t modifiers = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0; /* The cursor doesn't move unless we tell it to. The cursor automatically * handles constraining the motion to the output layout, as well as any * special configuration applied for the specific input device which @@ -437,6 +440,8 @@ static void server_cursor_motion(struct wl_listener *listener, void *data) wlr_cursor_move(server->cursor, &event->pointer->base, event->delta_x, event->delta_y); process_cursor_motion(server, event->time_msec); + plugin_call_update_state(server->plugin, plugin_handle_motion, event, + modifiers, 0, server->cursor->x, server->cursor->y); } static void server_cursor_motion_absolute(struct wl_listener *listener, @@ -460,7 +465,7 @@ static void server_cursor_motion_absolute(struct wl_listener *listener, event->y); process_cursor_motion(server, event->time_msec); plugin_call_update_state(server->plugin, plugin_handle_motion, event, - modifiers, server->cursor->x, server->cursor->y); + modifiers, 1, server->cursor->x, server->cursor->y); } static void server_cursor_button(struct wl_listener *listener, void *data) |