diff --git a/include/libweston-desktop/libweston-desktop.h b/include/libweston-desktop/libweston-desktop.h index 313179ef..8257e467 100644 --- a/include/libweston-desktop/libweston-desktop.h +++ b/include/libweston-desktop/libweston-desktop.h @@ -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 diff --git a/libweston/desktop/libweston-desktop.c b/libweston/desktop/libweston-desktop.c index f7ecc709..0be9d717 100644 --- a/libweston/desktop/libweston-desktop.c +++ b/libweston/desktop/libweston-desktop.c @@ -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,