Add keybind to close views
This commit is contained in:
@ -126,6 +126,13 @@ pub const View = struct {
|
||||
}
|
||||
}
|
||||
|
||||
/// Send a close event to the view's client
|
||||
pub fn close(self: Self) void {
|
||||
// Note: we don't call arrange() here as it will be called
|
||||
// automatically when the view is unmapped.
|
||||
c.wlr_xdg_toplevel_send_close(self.wlr_xdg_surface);
|
||||
}
|
||||
|
||||
fn handleMap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
|
||||
// Called when the surface is mapped, or ready to display on-screen.
|
||||
const view = @fieldParentPtr(View, "listen_map", listener.?);
|
||||
|
Reference in New Issue
Block a user