mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-24 06:24:19 +02:00
Add support for closing windows
This commit is contained in:
parent
daddc8f2e5
commit
73e8db1fa3
6 changed files with 29 additions and 0 deletions
10
xdg_shell.c
10
xdg_shell.c
|
|
@ -214,6 +214,15 @@ activate(struct cg_view *view, bool activate) {
|
|||
wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface, activate);
|
||||
}
|
||||
|
||||
static void
|
||||
close(struct cg_view *view) {
|
||||
struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view);
|
||||
struct wlr_xdg_surface *surface=xdg_shell_view->xdg_surface;
|
||||
if(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
wlr_xdg_toplevel_send_close(surface);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
maximize(struct cg_view *view, int width, int height) {
|
||||
struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view);
|
||||
|
|
@ -317,6 +326,7 @@ static const struct cg_view_impl xdg_shell_view_impl = {
|
|||
.get_geometry = get_geometry,
|
||||
.is_primary = is_primary,
|
||||
.activate = activate,
|
||||
.close = close,
|
||||
.maximize = maximize,
|
||||
.destroy = destroy,
|
||||
.for_each_surface = for_each_surface,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue