code: update to wlroots 0.14.0

This commit is contained in:
Isaac Freund 2021-06-14 20:27:08 +00:00
parent d3a9e96f7d
commit 41874b47ae
7 changed files with 18 additions and 22 deletions

View file

@ -37,7 +37,7 @@ installed:
- [zig](https://ziglang.org/download/) 0.8.0 - [zig](https://ziglang.org/download/) 0.8.0
- wayland - wayland
- wayland-protocols - wayland-protocols
- [wlroots](https://github.com/swaywm/wlroots) 0.13.0 - [wlroots](https://github.com/swaywm/wlroots) 0.14.0
- xkbcommon - xkbcommon
- libevdev - libevdev
- pixman - pixman

2
deps/zig-wlroots vendored

@ -1 +1 @@
Subproject commit c85fe796d932731ead64e916c90fdfc3d1e1269a Subproject commit c5f759484ec2bb6afdee54053f5b0aaccf060131

View file

@ -47,10 +47,7 @@ pub fn init(drag_icon: *DragIcon, seat: *Seat, wlr_drag_icon: *wlr.Drag.Icon) vo
wlr_drag_icon.events.unmap.add(&drag_icon.unmap); wlr_drag_icon.events.unmap.add(&drag_icon.unmap);
wlr_drag_icon.surface.events.new_subsurface.add(&drag_icon.new_subsurface); wlr_drag_icon.surface.events.new_subsurface.add(&drag_icon.new_subsurface);
// There may already be subsurfaces present on this surface that we Subsurface.handleExisting(wlr_drag_icon.surface, .{ .drag_icon = drag_icon });
// aren't aware of and won't receive a new_subsurface event for.
var it = wlr_drag_icon.surface.subsurfaces.iterator(.forward);
while (it.next()) |s| Subsurface.create(s, .{ .drag_icon = drag_icon });
} }
fn handleDestroy(listener: *wl.Listener(*wlr.Drag.Icon), wlr_drag_icon: *wlr.Drag.Icon) void { fn handleDestroy(listener: *wl.Listener(*wlr.Drag.Icon), wlr_drag_icon: *wlr.Drag.Icon) void {

View file

@ -66,10 +66,7 @@ pub fn init(self: *Self, output: *Output, wlr_layer_surface: *wlr.LayerSurfaceV1
// we do want our listener called in order to send the initial configure. // we do want our listener called in order to send the initial configure.
handleCommit(&self.commit, wlr_layer_surface.surface); handleCommit(&self.commit, wlr_layer_surface.surface);
// There may already be subsurfaces present on this surface that we Subsurface.handleExisting(wlr_layer_surface.surface, .{ .layer_surface = self });
// aren't aware of and won't receive a new_subsurface event for.
var it = wlr_layer_surface.surface.subsurfaces.iterator(.forward);
while (it.next()) |s| Subsurface.create(s, .{ .layer_surface = self });
} }
fn handleDestroy(listener: *wl.Listener(*wlr.LayerSurfaceV1), wlr_layer_surface: *wlr.LayerSurfaceV1) void { fn handleDestroy(listener: *wl.Listener(*wlr.LayerSurfaceV1), wlr_layer_surface: *wlr.LayerSurfaceV1) void {

View file

@ -71,10 +71,18 @@ pub fn create(wlr_subsurface: *wlr.Subsurface, parent: Parent) void {
wlr_subsurface.events.unmap.add(&subsurface.unmap); wlr_subsurface.events.unmap.add(&subsurface.unmap);
wlr_subsurface.surface.events.new_subsurface.add(&subsurface.new_subsurface); wlr_subsurface.surface.events.new_subsurface.add(&subsurface.new_subsurface);
// There may already be subsurfaces present on this surface that we Subsurface.handleExisting(wlr_subsurface.surface, parent);
// aren't aware of and won't receive a new_subsurface event for. }
var it = wlr_subsurface.surface.subsurfaces.iterator(.forward);
while (it.next()) |s| Subsurface.create(s, parent); /// Create Subsurface structs to track subsurfaces already present on the
/// given surface when river becomes aware of the surface as we won't
/// recieve a new_subsurface event for them.
pub fn handleExisting(surface: *wlr.Surface, parent: Parent) void {
var below_it = surface.subsurfaces_below.iterator(.forward);
while (below_it.next()) |s| Subsurface.create(s, parent);
var above_it = surface.subsurfaces_above.iterator(.forward);
while (above_it.next()) |s| Subsurface.create(s, parent);
} }
fn handleDestroy(listener: *wl.Listener(*wlr.Subsurface), wlr_subsurface: *wlr.Subsurface) void { fn handleDestroy(listener: *wl.Listener(*wlr.Subsurface), wlr_subsurface: *wlr.Subsurface) void {

View file

@ -77,10 +77,7 @@ pub fn create(wlr_xdg_popup: *wlr.XdgPopup, parent: Parent) void {
wlr_xdg_popup.base.events.new_popup.add(&self.new_popup); wlr_xdg_popup.base.events.new_popup.add(&self.new_popup);
wlr_xdg_popup.base.surface.events.new_subsurface.add(&self.new_subsurface); wlr_xdg_popup.base.surface.events.new_subsurface.add(&self.new_subsurface);
// There may already be subsurfaces present on this surface that we Subsurface.handleExisting(wlr_xdg_popup.base.surface, parent);
// aren't aware of and won't receive a new_subsurface event for.
var it = wlr_xdg_popup.base.surface.subsurfaces.iterator(.forward);
while (it.next()) |s| Subsurface.create(s, parent);
} }
fn handleDestroy(listener: *wl.Listener(*wlr.XdgSurface), wlr_xdg_surface: *wlr.XdgSurface) void { fn handleDestroy(listener: *wl.Listener(*wlr.XdgSurface), wlr_xdg_surface: *wlr.XdgSurface) void {

View file

@ -68,10 +68,7 @@ pub fn init(self: *Self, view: *View, xdg_surface: *wlr.XdgSurface) void {
xdg_surface.events.new_popup.add(&self.new_popup); xdg_surface.events.new_popup.add(&self.new_popup);
xdg_surface.surface.events.new_subsurface.add(&self.new_subsurface); xdg_surface.surface.events.new_subsurface.add(&self.new_subsurface);
// There may already be subsurfaces present on this surface that we Subsurface.handleExisting(xdg_surface.surface, .{ .view = view });
// aren't aware of and won't receive a new_subsurface event for.
var it = xdg_surface.surface.subsurfaces.iterator(.forward);
while (it.next()) |s| Subsurface.create(s, .{ .view = view });
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {