view: draw borders around actual dimensions

Previously if the view did not take the size requested, we would draw
the borders around the size we asked the view to take rather than its
actual size.
This commit is contained in:
Isaac Freund
2020-06-28 01:46:53 +02:00
parent 7f2e2610e3
commit 60f06a1a40
5 changed files with 39 additions and 9 deletions

View File

@ -114,6 +114,15 @@ pub fn getTitle(self: Self) [*:0]const u8 {
return self.wlr_xwayland_surface.title;
}
pub fn getActualBox(self: Self) Box {
return .{
.x = self.wlr_xwayland_surface.x,
.y = self.wlr_xwayland_surface.y,
.width = self.wlr_xwayland_surface.width,
.height = self.wlr_xwayland_surface.height,
};
}
/// Called when the xwayland surface is destroyed
fn handleDestroy(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
const self = @fieldParentPtr(Self, "listen_destroy", listener.?);