mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 21:38:04 +02:00
libweston-desktop/xdg_shell_v6: Raise errors on not-yet-possible requests
These requests need a mapped surface, which can only happen after the initial configure event. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
3d7e60798a
commit
0abf8903cb
1 changed files with 21 additions and 0 deletions
|
|
@ -349,6 +349,13 @@ weston_desktop_xdg_toplevel_protocol_show_window_menu(struct wl_client *wl_clien
|
|||
struct weston_desktop_xdg_toplevel *toplevel =
|
||||
weston_desktop_surface_get_implementation_data(dsurface);
|
||||
|
||||
if (!toplevel->base.configured) {
|
||||
wl_resource_post_error(toplevel->resource,
|
||||
ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED,
|
||||
"Surface has not been configured yet");
|
||||
return;
|
||||
}
|
||||
|
||||
weston_desktop_api_show_window_menu(toplevel->base.desktop,
|
||||
dsurface, seat, x, y);
|
||||
}
|
||||
|
|
@ -366,6 +373,13 @@ weston_desktop_xdg_toplevel_protocol_move(struct wl_client *wl_client,
|
|||
struct weston_desktop_xdg_toplevel *toplevel =
|
||||
weston_desktop_surface_get_implementation_data(dsurface);
|
||||
|
||||
if (!toplevel->base.configured) {
|
||||
wl_resource_post_error(toplevel->resource,
|
||||
ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED,
|
||||
"Surface has not been configured yet");
|
||||
return;
|
||||
}
|
||||
|
||||
weston_desktop_api_move(toplevel->base.desktop, dsurface, seat, serial);
|
||||
}
|
||||
|
||||
|
|
@ -383,6 +397,13 @@ weston_desktop_xdg_toplevel_protocol_resize(struct wl_client *wl_client,
|
|||
struct weston_desktop_xdg_toplevel *toplevel =
|
||||
weston_desktop_surface_get_implementation_data(dsurface);
|
||||
|
||||
if (!toplevel->base.configured) {
|
||||
wl_resource_post_error(toplevel->resource,
|
||||
ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED,
|
||||
"Surface has not been configured yet");
|
||||
return;
|
||||
}
|
||||
|
||||
weston_desktop_api_resize(toplevel->base.desktop,
|
||||
dsurface, seat, serial, edges);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue