diff --git a/src/wayland/meta-wayland-tablet-seat.c b/src/wayland/meta-wayland-tablet-seat.c index 2464361d4..3e270c5d6 100644 --- a/src/wayland/meta-wayland-tablet-seat.c +++ b/src/wayland/meta-wayland-tablet-seat.c @@ -587,19 +587,13 @@ meta_wayland_tablet_seat_get_grab_info (MetaWaylandTabletSeat *tablet_seat, { MetaWaylandTabletTool *tool = l->data; - if ((!require_pressed || tool->button_count > 0) && - meta_wayland_tablet_tool_can_grab_surface (tool, surface, serial)) - { - if (device_out) - *device_out = tool->device; - - if (x) - *x = tool->grab_x; - if (y) - *y = tool->grab_y; - - return TRUE; - } + if (meta_wayland_tablet_tool_get_grab_info (tool, + surface, + serial, + require_pressed, + device_out, + x, y)) + return TRUE; } return FALSE; diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c index 440a1dd20..1033364a1 100644 --- a/src/wayland/meta-wayland-tablet-tool.c +++ b/src/wayland/meta-wayland-tablet-tool.c @@ -913,7 +913,7 @@ tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool, return FALSE; } -gboolean +static gboolean meta_wayland_tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool, MetaWaylandSurface *surface, uint32_t serial) @@ -922,6 +922,32 @@ meta_wayland_tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool, tablet_tool_can_grab_surface (tool, surface)); } +gboolean +meta_wayland_tablet_tool_get_grab_info (MetaWaylandTabletTool *tool, + MetaWaylandSurface *surface, + uint32_t serial, + gboolean require_pressed, + ClutterInputDevice **device_out, + float *x, + float *y) +{ + if ((!require_pressed || tool->button_count > 0) && + meta_wayland_tablet_tool_can_grab_surface (tool, surface, serial)) + { + if (device_out) + *device_out = tool->device; + + if (x) + *x = tool->grab_x; + if (y) + *y = tool->grab_y; + + return TRUE; + } + + return FALSE; +} + gboolean meta_wayland_tablet_tool_can_popup (MetaWaylandTabletTool *tool, uint32_t serial) diff --git a/src/wayland/meta-wayland-tablet-tool.h b/src/wayland/meta-wayland-tablet-tool.h index 448aec559..88fce9b7b 100644 --- a/src/wayland/meta-wayland-tablet-tool.h +++ b/src/wayland/meta-wayland-tablet-tool.h @@ -76,9 +76,14 @@ void meta_wayland_tablet_tool_update (MetaWaylandTabletTool *t gboolean meta_wayland_tablet_tool_handle_event (MetaWaylandTabletTool *tool, const ClutterEvent *event); -gboolean meta_wayland_tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool, - MetaWaylandSurface *surface, - uint32_t serial); +gboolean meta_wayland_tablet_tool_get_grab_info (MetaWaylandTabletTool *tool, + MetaWaylandSurface *surface, + uint32_t serial, + gboolean require_pressed, + ClutterInputDevice **device_out, + float *x, + float *y); + gboolean meta_wayland_tablet_tool_can_popup (MetaWaylandTabletTool *tool, uint32_t serial);