wayland: Add API to change a tool focus surface
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
This commit is contained in:
parent
9c2514b75c
commit
77ec0d1e41
@ -625,3 +625,24 @@ meta_wayland_tablet_seat_get_current_surface (MetaWaylandTabletSeat *tablet_seat
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_seat_focus_surface (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
MetaWaylandTablet *tablet;
|
||||
g_autoptr (GList) tools = NULL;
|
||||
GList *l;
|
||||
|
||||
tools = g_hash_table_get_values (tablet_seat->tools);
|
||||
tablet = meta_wayland_tablet_seat_lookup_tablet (tablet_seat, device);
|
||||
|
||||
for (l = tools; l; l = l->next)
|
||||
{
|
||||
MetaWaylandTabletTool *tool = l->data;
|
||||
|
||||
if (meta_wayland_tablet_tool_has_current_tablet (tool, tablet))
|
||||
meta_wayland_tablet_tool_focus_surface (tool, surface);
|
||||
}
|
||||
}
|
||||
|
@ -87,3 +87,7 @@ gboolean meta_wayland_tablet_seat_get_grab_info (MetaWaylandTabletSeat *tablet_s
|
||||
|
||||
MetaWaylandSurface * meta_wayland_tablet_seat_get_current_surface (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
void meta_wayland_tablet_seat_focus_surface (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device,
|
||||
MetaWaylandSurface *surface);
|
||||
|
@ -950,3 +950,10 @@ meta_wayland_tablet_tool_get_current_surface (MetaWaylandTabletTool *tool)
|
||||
{
|
||||
return tool->current;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_tool_focus_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
meta_wayland_tablet_tool_set_focus (tool, surface, NULL);
|
||||
}
|
||||
|
@ -86,3 +86,6 @@ gboolean meta_wayland_tablet_tool_has_current_tablet (MetaWaylandTabletTool *too
|
||||
MetaWaylandTablet *tablet);
|
||||
|
||||
MetaWaylandSurface * meta_wayland_tablet_tool_get_current_surface (MetaWaylandTabletTool *tool);
|
||||
|
||||
void meta_wayland_tablet_tool_focus_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface);
|
||||
|
Loading…
Reference in New Issue
Block a user