xwayland: clean up initialization
This commit is contained in:
parent
1fbaaa55b3
commit
5cea3f68e3
2 changed files with 11 additions and 13 deletions
|
@ -31,17 +31,16 @@ root: *Root,
|
||||||
wlr_xwayland_surface: *c.wlr_xwayland_surface,
|
wlr_xwayland_surface: *c.wlr_xwayland_surface,
|
||||||
|
|
||||||
// Listeners that are always active over the view's lifetime
|
// Listeners that are always active over the view's lifetime
|
||||||
liseten_request_configure: c.wl_listener,
|
liseten_request_configure: c.wl_listener = undefined,
|
||||||
listen_destroy: c.wl_listener,
|
listen_destroy: c.wl_listener = undefined,
|
||||||
listen_map: c.wl_listener,
|
listen_map: c.wl_listener = undefined,
|
||||||
listen_unmap: c.wl_listener,
|
listen_unmap: c.wl_listener = undefined,
|
||||||
|
|
||||||
// Listeners that are only active while the view is mapped
|
// Listeners that are only active while the view is mapped
|
||||||
listen_commit: c.wl_listener,
|
listen_commit: c.wl_listener = undefined,
|
||||||
|
|
||||||
pub fn init(self: *Self, root: *Root, wlr_xwayland_surface: *c.wlr_xwayland_surface) void {
|
pub fn init(self: *Self, root: *Root, wlr_xwayland_surface: *c.wlr_xwayland_surface) void {
|
||||||
self.root = root;
|
self.* = .{ .root = root, .wlr_xwayland_surface = wlr_xwayland_surface };
|
||||||
self.wlr_xwayland_surface = wlr_xwayland_surface;
|
|
||||||
|
|
||||||
// Add listeners that are active over the view's entire lifetime
|
// Add listeners that are active over the view's entire lifetime
|
||||||
self.liseten_request_configure.notify = handleRequestConfigure;
|
self.liseten_request_configure.notify = handleRequestConfigure;
|
||||||
|
|
|
@ -33,16 +33,15 @@ view: *View,
|
||||||
wlr_xwayland_surface: *c.wlr_xwayland_surface,
|
wlr_xwayland_surface: *c.wlr_xwayland_surface,
|
||||||
|
|
||||||
// Listeners that are always active over the view's lifetime
|
// Listeners that are always active over the view's lifetime
|
||||||
listen_destroy: c.wl_listener,
|
listen_destroy: c.wl_listener = undefined,
|
||||||
listen_map: c.wl_listener,
|
listen_map: c.wl_listener = undefined,
|
||||||
listen_unmap: c.wl_listener,
|
listen_unmap: c.wl_listener = undefined,
|
||||||
|
|
||||||
// Listeners that are only active while the view is mapped
|
// Listeners that are only active while the view is mapped
|
||||||
listen_commit: c.wl_listener,
|
listen_commit: c.wl_listener = undefined,
|
||||||
|
|
||||||
pub fn init(self: *Self, view: *View, wlr_xwayland_surface: *c.wlr_xwayland_surface) void {
|
pub fn init(self: *Self, view: *View, wlr_xwayland_surface: *c.wlr_xwayland_surface) void {
|
||||||
self.view = view;
|
self.* = .{ .view = view, .wlr_xwayland_surface = wlr_xwayland_surface };
|
||||||
self.wlr_xwayland_surface = wlr_xwayland_surface;
|
|
||||||
wlr_xwayland_surface.data = self;
|
wlr_xwayland_surface.data = self;
|
||||||
|
|
||||||
// Add listeners that are active over the view's entire lifetime
|
// Add listeners that are active over the view's entire lifetime
|
||||||
|
|
Loading…
Reference in a new issue