Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

fix: correct app proximity glow compilation

Petar Margetić575e537cc213
diff --git a/src/editor/app_controls.zig b/src/editor/app_controls.zig
index da370bb..a872dfc 100644
--- a/src/editor/app_controls.zig
+++ b/src/editor/app_controls.zig
@@ -133,7 +133,7 @@ pub fn paintIcon(self: *App, cr: *c.cairo_t, box: Rect, icon: @import("ui").layo
defer layer.finish();
layer.renderer.palette = theme.shellPalette();
const active = !self.menu_open and self.close_tab == null;
- const proximity = if (active) self.buttonProximity(box) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
+ const proximity: button.ProximitySample = if (active) self.buttonProximity(box) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
button.paint(&layer.renderer, layer.local(), .{ .label = label, .icon = icon, .variant = .ghost, .size = .sm }, .{
.selected = selected,
.pointer = if (active and box.contains(self.px, self.py)) .hover else .idle,
diff --git a/src/editor/app_paint.zig b/src/editor/app_paint.zig
index 6454e2a..e439ffe 100644
--- a/src/editor/app_paint.zig
+++ b/src/editor/app_paint.zig
@@ -163,7 +163,7 @@ pub fn paintButton(self: *App, cr: *c.cairo_t, r: field.Rect, label: []const u8,
});
button.paint(&layer.renderer, layer.local(), .{ .label = label, .variant = .secondary, .size = .sm }, .{
.selected = selected,
- .pointer = if (self.px >= r.x and self.px < r.x + r.w and self.py >= r.y and self.py < r.y + r.h) .hover else .idle,
+ .pointer = if (self.px >= @as(f64, r.x) and self.px < @as(f64, r.x + r.w) and self.py >= @as(f64, r.y) and self.py < @as(f64, r.y + r.h)) .hover else .idle,
.proximity_distance = proximity.distance,
.proximity_x = proximity.x,
.proximity_y = proximity.y,
diff --git a/src/editor/app_search.zig b/src/editor/app_search.zig
index 04c1185..45c572e 100644
--- a/src/editor/app_search.zig
+++ b/src/editor/app_search.zig
@@ -218,7 +218,7 @@ pub fn paintSearch(self: *App, cr: *c.cairo_t) void {
var layer = ui.Layer.begin(cr, .{ .x = @floatCast(box.x), .y = @floatCast(box.y), .w = @floatCast(box.w), .h = @floatCast(box.h) }) orelse continue;
const disabled = (control == .next or control == .replace or control == .replace_all) and (self.query.text.items.len == 0 or (control != .next and self.document().locked));
layer.renderer.palette = theme.shellPalette();
- const proximity = if (self.close_tab == null and !self.menu_open) self.buttonProximity(box) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
+ const proximity: button.ProximitySample = if (self.close_tab == null and !self.menu_open) self.buttonProximity(box) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
button.paint(&layer.renderer, layer.local(), .{
.label = switch (control) {
.next => tr("Next"),
diff --git a/src/share_picker/client.zig b/src/share_picker/client.zig
index 494d71d..618c2cd 100644
--- a/src/share_picker/client.zig
+++ b/src/share_picker/client.zig
@@ -438,7 +438,7 @@ const Client = struct {
const close_w: f64 = @min(h_f, 32);
const hovered = self.inside and self.pointer_y < h_f and self.pointer_x >= w_f - close_w;
const box = self.closeRect();
- const proximity = if (self.inside)
+ const proximity: ui_button.ProximitySample = if (self.inside)
ui_button.sampleProximity(box, @floatCast(self.pointer_x), @floatCast(self.pointer_y), .{ .x = 0, .y = 0, .w = @floatFromInt(w), .h = @floatFromInt(h) })
else
.{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
@@ -473,7 +473,7 @@ const Client = struct {
for (self.labels, 0..) |label, i| {
const row = self.rowRect(i);
- const proximity = if (self.inside) self.rowProximity(i, self.pointer_x, self.pointer_y) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
+ const proximity: ui_button.ProximitySample = if (self.inside) self.rowProximity(i, self.pointer_x, self.pointer_y) else .{ .distance = std.math.inf(f32), .x = 0, .y = 0 };
var layer = shell_ui.Layer.begin(cr, .{ .x = row.x, .y = row.y, .w = row.w, .h = row.h }) orelse continue;
ui_button.paint(&layer.renderer, layer.local(), .{
.variant = .secondary,