libweston-desktop: Add shell capability queries

Allow other components to query which window-management operations are
supported by the shell.

Signed-off-by: Daniel Stone <daniels@collabora.com>
dev
Daniel Stone 2 years ago committed by Marius Vlad
parent 28caa08be6
commit 1541c44777
  1. 13
      include/libweston-desktop/libweston-desktop.h
  2. 36
      libweston/desktop/libweston-desktop.c

@ -198,6 +198,19 @@ weston_desktop_surface_get_max_size(struct weston_desktop_surface *surface);
struct weston_size
weston_desktop_surface_get_min_size(struct weston_desktop_surface *surface);
bool
weston_desktop_window_menu_supported(struct weston_desktop *desktop);
bool
weston_desktop_move_supported(struct weston_desktop *desktop);
bool
weston_desktop_resize_supported(struct weston_desktop *desktop);
bool
weston_desktop_fullscreen_supported(struct weston_desktop *desktop);
bool
weston_desktop_minimize_supported(struct weston_desktop *desktop);
bool
weston_desktop_maximize_supported(struct weston_desktop *desktop);
#ifdef __cplusplus
}
#endif

@ -170,6 +170,12 @@ weston_desktop_api_show_window_menu(struct weston_desktop *desktop,
desktop->user_data);
}
bool
weston_desktop_window_menu_supported(struct weston_desktop *desktop)
{
return desktop->api.show_window_menu != NULL;
}
void
weston_desktop_api_set_parent(struct weston_desktop *desktop,
struct weston_desktop_surface *surface,
@ -188,6 +194,12 @@ weston_desktop_api_move(struct weston_desktop *desktop,
desktop->api.move(surface, seat, serial, desktop->user_data);
}
bool
weston_desktop_move_supported(struct weston_desktop *desktop)
{
return desktop->api.move != NULL;
}
void
weston_desktop_api_resize(struct weston_desktop *desktop,
struct weston_desktop_surface *surface,
@ -199,6 +211,12 @@ weston_desktop_api_resize(struct weston_desktop *desktop,
desktop->user_data);
}
bool
weston_desktop_resize_supported(struct weston_desktop *desktop)
{
return desktop->api.resize != NULL;
}
void
weston_desktop_api_fullscreen_requested(struct weston_desktop *desktop,
struct weston_desktop_surface *surface,
@ -210,6 +228,12 @@ weston_desktop_api_fullscreen_requested(struct weston_desktop *desktop,
desktop->user_data);
}
bool
weston_desktop_fullscreen_supported(struct weston_desktop *desktop)
{
return desktop->api.fullscreen_requested != NULL;
}
void
weston_desktop_api_maximized_requested(struct weston_desktop *desktop,
struct weston_desktop_surface *surface,
@ -220,6 +244,12 @@ weston_desktop_api_maximized_requested(struct weston_desktop *desktop,
desktop->user_data);
}
bool
weston_desktop_maximize_supported(struct weston_desktop *desktop)
{
return desktop->api.maximized_requested != NULL;
}
void
weston_desktop_api_minimized_requested(struct weston_desktop *desktop,
struct weston_desktop_surface *surface)
@ -228,6 +258,12 @@ weston_desktop_api_minimized_requested(struct weston_desktop *desktop,
desktop->api.minimized_requested(surface, desktop->user_data);
}
bool
weston_desktop_minimize_supported(struct weston_desktop *desktop)
{
return desktop->api.minimized_requested != NULL;
}
void
weston_desktop_api_set_xwayland_position(struct weston_desktop *desktop,
struct weston_desktop_surface *surface,

Loading…
Cancel
Save