mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
wayland: Add support for show_window_menu
This commit is contained in:
parent
04449923bd
commit
efcd7d86e7
@ -770,6 +770,23 @@ xdg_surface_set_app_id (struct wl_client *client,
|
||||
meta_window_set_wm_class (surface->window, app_id, app_id);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_surface_show_window_menu (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t serial,
|
||||
uint32_t x,
|
||||
uint32_t y)
|
||||
{
|
||||
MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
|
||||
if (!meta_wayland_seat_can_grab_surface (seat, surface, serial))
|
||||
return;
|
||||
|
||||
meta_window_show_menu (surface->window, x, y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
begin_grab_op_on_surface (MetaWaylandSurface *surface,
|
||||
MetaWaylandSeat *seat,
|
||||
@ -910,6 +927,7 @@ static const struct xdg_surface_interface meta_wayland_xdg_surface_interface = {
|
||||
xdg_surface_set_margin,
|
||||
xdg_surface_set_title,
|
||||
xdg_surface_set_app_id,
|
||||
xdg_surface_show_window_menu,
|
||||
xdg_surface_move,
|
||||
xdg_surface_resize,
|
||||
xdg_surface_ack_configure,
|
||||
|
@ -198,6 +198,22 @@
|
||||
<arg name="app_id" type="string"/>
|
||||
</request>
|
||||
|
||||
<request name="show_window_menu">
|
||||
<description summary="show the window menu">
|
||||
Clients implementing client-side decorations might want to show
|
||||
a context menu when right-clicking on the decorations, giving the
|
||||
user a menu that they can use to maximize or minimize the window.
|
||||
|
||||
The seat passed must have either pointer or keyboard focus to pop
|
||||
up the window menu for a surface.
|
||||
</description>
|
||||
|
||||
<arg name="seat" type="object" interface="wl_seat" summary="the seat to pop the window up on"/>
|
||||
<arg name="serial" type="uint" summary="serial of the event to pop up the window for"/>
|
||||
<arg name="x" type="uint"/>
|
||||
<arg name="y" type="uint"/>
|
||||
</request>
|
||||
|
||||
<request name="move">
|
||||
<description summary="start an interactive move">
|
||||
Start a pointer-driven move of the surface.
|
||||
|
Loading…
Reference in New Issue
Block a user