deps: update to lastest zig-wlroots

This fixes a few issues with the XwaylandSurface bindings
This commit is contained in:
Isaac Freund 2023-12-05 11:59:57 +01:00
parent 093b85d234
commit 677766956e
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
3 changed files with 23 additions and 31 deletions

2
deps/zig-wlroots vendored

@ -1 +1 @@
Subproject commit a4e100599b9f742215fa09afce8c56cffea2e796 Subproject commit 5581b9522eb2b3d2fca8e02a581932f6b9eb4876

View File

@ -37,9 +37,8 @@ surface_tree: ?*wlr.SceneTree = null,
// Active over entire lifetime // Active over entire lifetime
request_configure: wl.Listener(*wlr.XwaylandSurface.event.Configure) = request_configure: wl.Listener(*wlr.XwaylandSurface.event.Configure) =
wl.Listener(*wlr.XwaylandSurface.event.Configure).init(handleRequestConfigure), wl.Listener(*wlr.XwaylandSurface.event.Configure).init(handleRequestConfigure),
destroy: wl.Listener(*wlr.XwaylandSurface) = wl.Listener(*wlr.XwaylandSurface).init(handleDestroy), destroy: wl.Listener(void) = wl.Listener(void).init(handleDestroy),
set_override_redirect: wl.Listener(*wlr.XwaylandSurface) = set_override_redirect: wl.Listener(void) = wl.Listener(void).init(handleSetOverrideRedirect),
wl.Listener(*wlr.XwaylandSurface).init(handleSetOverrideRedirect),
associate: wl.Listener(void) = wl.Listener(void).init(handleAssociate), associate: wl.Listener(void) = wl.Listener(void).init(handleAssociate),
dissociate: wl.Listener(void) = wl.Listener(void).init(handleDissociate), dissociate: wl.Listener(void) = wl.Listener(void).init(handleDissociate),
@ -78,7 +77,7 @@ fn handleRequestConfigure(
event.surface.configure(event.x, event.y, event.width, event.height); event.surface.configure(event.x, event.y, event.width, event.height);
} }
fn handleDestroy(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.XwaylandSurface) void { fn handleDestroy(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "destroy", listener); const self = @fieldParentPtr(Self, "destroy", listener);
self.request_configure.link.remove(); self.request_configure.link.remove();
@ -180,11 +179,9 @@ fn handleSetGeometry(listener: *wl.Listener(void)) void {
self.surface_tree.?.node.setPosition(self.xwayland_surface.x, self.xwayland_surface.y); self.surface_tree.?.node.setPosition(self.xwayland_surface.x, self.xwayland_surface.y);
} }
fn handleSetOverrideRedirect( fn handleSetOverrideRedirect(listener: *wl.Listener(void)) void {
listener: *wl.Listener(*wlr.XwaylandSurface),
xwayland_surface: *wlr.XwaylandSurface,
) void {
const self = @fieldParentPtr(Self, "set_override_redirect", listener); const self = @fieldParentPtr(Self, "set_override_redirect", listener);
const xwayland_surface = self.xwayland_surface;
log.debug("xwayland surface unset override redirect", .{}); log.debug("xwayland surface unset override redirect", .{});
@ -196,7 +193,7 @@ fn handleSetOverrideRedirect(
} }
handleDissociate(&self.dissociate); handleDissociate(&self.dissociate);
} }
handleDestroy(&self.destroy, xwayland_surface); handleDestroy(&self.destroy);
XwaylandView.create(xwayland_surface) catch { XwaylandView.create(xwayland_surface) catch {
log.err("out of memory", .{}); log.err("out of memory", .{});

View File

@ -40,11 +40,10 @@ xwayland_surface: *wlr.XwaylandSurface,
surface_tree: ?*wlr.SceneTree = null, surface_tree: ?*wlr.SceneTree = null,
// Active over entire lifetime // Active over entire lifetime
destroy: wl.Listener(*wlr.XwaylandSurface) = wl.Listener(*wlr.XwaylandSurface).init(handleDestroy), destroy: wl.Listener(void) = wl.Listener(void).init(handleDestroy),
request_configure: wl.Listener(*wlr.XwaylandSurface.event.Configure) = request_configure: wl.Listener(*wlr.XwaylandSurface.event.Configure) =
wl.Listener(*wlr.XwaylandSurface.event.Configure).init(handleRequestConfigure), wl.Listener(*wlr.XwaylandSurface.event.Configure).init(handleRequestConfigure),
set_override_redirect: wl.Listener(*wlr.XwaylandSurface) = set_override_redirect: wl.Listener(void) = wl.Listener(void).init(handleSetOverrideRedirect),
wl.Listener(*wlr.XwaylandSurface).init(handleSetOverrideRedirect),
associate: wl.Listener(void) = wl.Listener(void).init(handleAssociate), associate: wl.Listener(void) = wl.Listener(void).init(handleAssociate),
dissociate: wl.Listener(void) = wl.Listener(void).init(handleDissociate), dissociate: wl.Listener(void) = wl.Listener(void).init(handleDissociate),
@ -53,12 +52,10 @@ map: wl.Listener(void) = wl.Listener(void).init(handleMap),
unmap: wl.Listener(void) = wl.Listener(void).init(handleUnmap), unmap: wl.Listener(void) = wl.Listener(void).init(handleUnmap),
// Active while mapped // Active while mapped
set_title: wl.Listener(*wlr.XwaylandSurface) = wl.Listener(*wlr.XwaylandSurface).init(handleSetTitle), set_title: wl.Listener(void) = wl.Listener(void).init(handleSetTitle),
set_class: wl.Listener(*wlr.XwaylandSurface) = wl.Listener(*wlr.XwaylandSurface).init(handleSetClass), set_class: wl.Listener(void) = wl.Listener(void).init(handleSetClass),
set_decorations: wl.Listener(*wlr.XwaylandSurface) = set_decorations: wl.Listener(void) = wl.Listener(void).init(handleSetDecorations),
wl.Listener(*wlr.XwaylandSurface).init(handleSetDecorations), request_fullscreen: wl.Listener(void) = wl.Listener(void).init(handleRequestFullscreen),
request_fullscreen: wl.Listener(*wlr.XwaylandSurface) =
wl.Listener(*wlr.XwaylandSurface).init(handleRequestFullscreen),
request_minimize: wl.Listener(*wlr.XwaylandSurface.event.Minimize) = request_minimize: wl.Listener(*wlr.XwaylandSurface.event.Minimize) =
wl.Listener(*wlr.XwaylandSurface.event.Minimize).init(handleRequestMinimize), wl.Listener(*wlr.XwaylandSurface.event.Minimize).init(handleRequestMinimize),
@ -152,7 +149,7 @@ pub fn getAppId(self: Self) ?[*:0]const u8 {
return self.xwayland_surface.class; return self.xwayland_surface.class;
} }
fn handleDestroy(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.XwaylandSurface) void { fn handleDestroy(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "destroy", listener); const self = @fieldParentPtr(Self, "destroy", listener);
// Remove listeners that are active for the entire lifetime of the view // Remove listeners that are active for the entire lifetime of the view
@ -275,11 +272,9 @@ fn handleRequestConfigure(
server.root.applyPending(); server.root.applyPending();
} }
fn handleSetOverrideRedirect( fn handleSetOverrideRedirect(listener: *wl.Listener(void)) void {
listener: *wl.Listener(*wlr.XwaylandSurface),
xwayland_surface: *wlr.XwaylandSurface,
) void {
const self = @fieldParentPtr(Self, "set_override_redirect", listener); const self = @fieldParentPtr(Self, "set_override_redirect", listener);
const xwayland_surface = self.xwayland_surface;
log.debug("xwayland surface set override redirect", .{}); log.debug("xwayland surface set override redirect", .{});
@ -291,7 +286,7 @@ fn handleSetOverrideRedirect(
} }
handleDissociate(&self.dissociate); handleDissociate(&self.dissociate);
} }
handleDestroy(&self.destroy, xwayland_surface); handleDestroy(&self.destroy);
XwaylandOverrideRedirect.create(xwayland_surface) catch { XwaylandOverrideRedirect.create(xwayland_surface) catch {
log.err("out of memory", .{}); log.err("out of memory", .{});
@ -299,17 +294,17 @@ fn handleSetOverrideRedirect(
}; };
} }
fn handleSetTitle(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.XwaylandSurface) void { fn handleSetTitle(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "set_title", listener); const self = @fieldParentPtr(Self, "set_title", listener);
self.view.notifyTitle(); self.view.notifyTitle();
} }
fn handleSetClass(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.XwaylandSurface) void { fn handleSetClass(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "set_class", listener); const self = @fieldParentPtr(Self, "set_class", listener);
self.view.notifyAppId(); self.view.notifyAppId();
} }
fn handleSetDecorations(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.XwaylandSurface) void { fn handleSetDecorations(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "set_decorations", listener); const self = @fieldParentPtr(Self, "set_decorations", listener);
const view = self.view; const view = self.view;
@ -322,10 +317,10 @@ fn handleSetDecorations(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.Xw
} }
} }
fn handleRequestFullscreen(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface: *wlr.XwaylandSurface) void { fn handleRequestFullscreen(listener: *wl.Listener(void)) void {
const self = @fieldParentPtr(Self, "request_fullscreen", listener); const self = @fieldParentPtr(Self, "request_fullscreen", listener);
if (self.view.pending.fullscreen != xwayland_surface.fullscreen) { if (self.view.pending.fullscreen != self.xwayland_surface.fullscreen) {
self.view.pending.fullscreen = xwayland_surface.fullscreen; self.view.pending.fullscreen = self.xwayland_surface.fullscreen;
server.root.applyPending(); server.root.applyPending();
} }
} }