mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-17 06:59:43 -05:00
unified xdg-surface close
This commit is contained in:
parent
7cc042f54c
commit
f53575e3a3
6 changed files with 44 additions and 14 deletions
|
|
@ -1568,9 +1568,22 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface,
|
|||
return wlr_xdg_surface_schedule_configure(surface);
|
||||
}
|
||||
|
||||
void wlr_xdg_toplevel_send_close(struct wlr_xdg_surface *surface) {
|
||||
assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
|
||||
xdg_toplevel_send_close(surface->toplevel->resource);
|
||||
void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface) {
|
||||
switch (surface->role) {
|
||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
||||
assert(0 && "not reached");
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||
if (surface->toplevel) {
|
||||
xdg_toplevel_send_close(surface->toplevel->resource);
|
||||
}
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
||||
if (surface->popup) {
|
||||
xdg_popup_send_popup_done(surface->popup->resource);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_popup_get_position(struct wlr_xdg_surface *surface,
|
||||
|
|
|
|||
|
|
@ -1537,9 +1537,22 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|||
return wlr_xdg_surface_v6_schedule_configure(surface);
|
||||
}
|
||||
|
||||
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->resource);
|
||||
void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface) {
|
||||
switch (surface->role) {
|
||||
case WLR_XDG_SURFACE_V6_ROLE_NONE:
|
||||
assert(0 && "not reached");
|
||||
break;
|
||||
case WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL:
|
||||
if (surface->toplevel) {
|
||||
zxdg_toplevel_v6_send_close(surface->toplevel->resource);
|
||||
}
|
||||
break;
|
||||
case WLR_XDG_SURFACE_V6_ROLE_POPUP:
|
||||
if (surface->popup) {
|
||||
zxdg_popup_v6_send_popup_done(surface->popup->resource);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue