mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-23 05:15:58 +01:00
Implement wlr_xdg_toplevel_v6_send_close
This commit is contained in:
parent
972e9dbd1b
commit
69aff9b35e
3 changed files with 19 additions and 0 deletions
|
@ -172,4 +172,9 @@ void wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
|
|||
void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
||||
bool resizing);
|
||||
|
||||
/**
|
||||
* Request that this toplevel surface closes.
|
||||
*/
|
||||
void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -33,6 +33,14 @@ static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
|
|||
}
|
||||
}
|
||||
|
||||
static void close(struct roots_view *view) {
|
||||
assert(view->type == ROOTS_XDG_SHELL_V6_VIEW);
|
||||
struct wlr_xdg_surface_v6 *surf = view->xdg_surface_v6;
|
||||
if (surf->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) {
|
||||
wlr_xdg_toplevel_v6_send_close(surf);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_request_move(struct wl_listener *listener, void *data) {
|
||||
struct roots_xdg_surface_v6 *roots_xdg_surface =
|
||||
wl_container_of(listener, roots_xdg_surface, request_move);
|
||||
|
@ -107,6 +115,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
|
|||
view->get_size = get_size;
|
||||
view->activate = activate;
|
||||
view->resize = resize;
|
||||
view->close = close;
|
||||
view->desktop = desktop;
|
||||
roots_surface->view = view;
|
||||
list_add(desktop->views, view);
|
||||
|
|
|
@ -807,3 +807,8 @@ void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|||
|
||||
wlr_xdg_surface_v6_schedule_configure(surface, false);
|
||||
}
|
||||
|
||||
void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface) {
|
||||
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
||||
zxdg_toplevel_v6_send_close(surface->toplevel_state->resource);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue