Improve invalid gtk4-layer-shell version message

- Inform user to upgrade to supported gtk4-layer-shell version and contact dependency maintainers.
This commit is contained in:
azhn
2025-04-23 16:05:55 +10:00
parent 511889b3aa
commit 654bfdb03b
2 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@ pub fn getProtocolVersion() c_uint {
/// Returns the runtime version of the GTK Layer Shell library
pub fn getRuntimeVersion() std.SemanticVersion {
return std.SemanticVersion{
return .{
.major = c.gtk_layer_get_major_version(),
.minor = c.gtk_layer_get_minor_version(),
.patch = c.gtk_layer_get_micro_version(),

View File

@ -105,11 +105,11 @@ pub const App = struct {
}
// GTK4 >= 4.16.0 uses xdg_wm_dialog protocol if available which breaks gtk_layer_shell < 1.0.4
// See: https://github.com/wmww/gtk4-layer-shell/issues/50
if (self.context.xdg_wm_dialog) |_| {
if (gtk_version.atLeast(4, 16, 0) and !gtk_layer_version.atLeast(1, 0, 4)) {
log.warn("Your gtk4-layer-shell version is too old for your compositor and gtk4 version; disabling quick terminal", .{});
return false;
}
if (self.context.xdg_wm_dialog != null and
gtk_version.atLeast(4, 16, 0) and !gtk_layer_version.atLeast(1, 0, 4))
{
log.warn("Your gtk4-layer-shell version is defective, update to 1.0.4 or later (and contact distro maintainers if this is latest); disabling quick terminal", .{});
return false;
}
return true;
}