glfw: better handle Wayland limitations
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
8ccae4cb1a
commit
a690b84732
2 changed files with 7 additions and 3 deletions
|
|
@ -529,7 +529,10 @@ test "set_getGammaRamp" {
|
||||||
|
|
||||||
const monitor = try getPrimary();
|
const monitor = try getPrimary();
|
||||||
if (monitor) |m| {
|
if (monitor) |m| {
|
||||||
const ramp = try m.getGammaRamp();
|
const ramp = m.getGammaRamp() catch |err| {
|
||||||
|
std.debug.print("can't get window position, wayland maybe? error={}\n", .{err});
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
// Set it to the exact same value; if we do otherwise an our tests fail it wouldn't call
|
// Set it to the exact same value; if we do otherwise an our tests fail it wouldn't call
|
||||||
// terminate and our made-up gamma ramp would get stuck.
|
// terminate and our made-up gamma ramp would get stuck.
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,8 @@ test "setIcon" {
|
||||||
icon.pixels[(x * y * 4) + 3] = 255; // alpha
|
icon.pixels[(x * y * 4) + 3] = 255; // alpha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try window.setIcon(allocator, &[_]Image{icon});
|
window.setIcon(allocator, &[_]Image{icon}) catch |err| std.debug.print("can't set window icon, wayland maybe? error={}\n", .{err});
|
||||||
|
|
||||||
icon.deinit(allocator); // glfw copies it.
|
icon.deinit(allocator); // glfw copies it.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -464,5 +465,5 @@ test "getPos" {
|
||||||
};
|
};
|
||||||
defer window.destroy();
|
defer window.destroy();
|
||||||
|
|
||||||
_ = try window.getPos();
|
_ = window.getPos() catch |err| std.debug.print("can't get window position, wayland maybe? error={}\n", .{err});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue