gtklock: fix and rebuild for glib 2.72

This commit is contained in:
q66 2022-09-25 13:39:09 +00:00
parent af4d2dd6c4
commit dfeacd927c
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 45877d5083b28ae955352710a2daf30d3497d229 Mon Sep 17 00:00:00 2001
From: Jovan Lanik <jox969@gmail.com>
Date: Thu, 22 Sep 2022 00:33:01 +0200
Subject: [PATCH] fix old glib2 versions
---
src/gtklock.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gtklock.c b/src/gtklock.c
index cc047ce..2faf66d 100644
--- a/src/gtklock.c
+++ b/src/gtklock.c
@@ -94,10 +94,16 @@ void gtklock_idle_show(struct GtkLock *gtklock) {
gtklock->idle_hide_source = g_timeout_add_seconds(gtklock->idle_timeout, gtklock_idle_handler, gtklock);
}
+#if GLIB_CHECK_VERSION(2, 74, 0)
+ #define GTKLOCK_FLAGS G_APPLICATION_DEFAULT_FLAGS
+#else
+ #define GTKLOCK_FLAGS G_APPLICATION_FLAGS_NONE
+#endif
+
struct GtkLock* create_gtklock(void) {
struct GtkLock *gtklock = g_malloc0(sizeof(struct GtkLock));
if(!gtklock) report_error_and_exit("Failed allocation");
- gtklock->app = gtk_application_new(NULL, G_APPLICATION_DEFAULT_FLAGS);
+ gtklock->app = gtk_application_new(NULL, GTKLOCK_FLAGS);
if(gtklock->use_layer_shell) g_application_hold(G_APPLICATION(gtklock->app));
gtklock->windows = g_array_new(FALSE, TRUE, sizeof(struct Window *));
gtklock->messages = g_array_new(FALSE, TRUE, sizeof(char *));

View File

@ -1,7 +1,7 @@
# Template file for 'gtklock'
pkgname=gtklock
version=1.3.7
revision=1
revision=2
build_style=gnu-makefile
make_use_env=yes
hostmakedepends="pkg-config wayland-devel scdoc"