handle xdg close event in idle-inhibit example
Fixes a crash when the idle-inhibit example application is closed by the compositor, instead of Ctr+C on the spawning terminal, by actualy handling the close request.
This commit is contained in:
parent
a0bce86006
commit
bab8c73d3c
|
@ -96,8 +96,15 @@ static void xdg_toplevel_handle_configure(void *data,
|
||||||
height = h;
|
height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void xdg_toplevel_handle_close(void *data,
|
||||||
|
struct xdg_toplevel *xdg_toplevel) {
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
||||||
.configure = xdg_toplevel_handle_configure,
|
.configure = xdg_toplevel_handle_configure,
|
||||||
|
.close = xdg_toplevel_handle_close,
|
||||||
};
|
};
|
||||||
|
|
||||||
// static const struct zxdg_toplevel_decoration_v1_listener decoration_listener = {
|
// static const struct zxdg_toplevel_decoration_v1_listener decoration_listener = {
|
||||||
|
|
Loading…
Reference in New Issue