summaryrefslogtreecommitdiffstats
path: root/desktop/sfwbar/inhibit_check.patch
blob: 1c61883cf2823c6b368e9368e2fcbb8b10d63c72 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/src/wayland.c	2022-04-14 21:01:09.000000000 +0100
+++ b/src/wayland.c	2022-05-16 21:32:21.208252447 +0100
@@ -215,6 +215,9 @@
   struct wl_surface *surface;
   struct zwp_idle_inhibitor_v1 *inhibitor;
 
+  if(!idle_inhibit_manager)
+    return;
+
   surface = gdk_wayland_window_get_wl_surface(
       gtk_widget_get_window(widget));
   inhibitor = g_object_get_data(G_OBJECT(widget),"inhibitor");
@@ -237,6 +240,9 @@
 
 void wayland_reset_inhibitors ( GtkWidget *w, gpointer data )
 {
+  if(!idle_inhibit_manager)
+    return;
+
   if(GTK_IS_CONTAINER(w))
     gtk_container_foreach(GTK_CONTAINER(w),wayland_reset_inhibitors,data);