git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitbbf4ac1811f478c11a965962a45d9f09c474bde5
parent2dde1b8cd8
authorIsaac Freund <[email protected]>
date2020-04-18 17:07
Remove uneeded abstraction

 src/command/close_view.zig | 4 +++-
 src/view.zig               | 7 -------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/command/close_view.zig b/src/command/close_view.zig
index b0f03b9..dbad86b 100644
--- a/src/command/close_view.zig
+++ b/src/command/close_view.zig
@@ -6,6 +6,8 @@ const Seat = @import("../seat.zig").Seat;
 /// Close the focused view, if any.
 pub fn close_view(seat: *Seat, arg: Arg) void {
     if (seat.focused_view) |view| {
-        view.close();
+        // Note: we don't call arrange() here as it will be called
+        // automatically when the view is unmapped.
+        c.wlr_xdg_toplevel_send_close(view.wlr_xdg_surface);
     }
 }
diff --git a/src/view.zig b/src/view.zig
index f805acc..92af7ec 100644
--- a/src/view.zig
+++ b/src/view.zig
@@ -136,13 +136,6 @@ pub const View = struct {
         self.output = destination_output;
     }
 
-    /// 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 handleDestroy(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
         const view = @fieldParentPtr(View, "listen_destroy", listener.?);
         const output = view.output;