gjdwebserver-overlay/net-voip/gnome-calls/files/inhibit-suspend-during-call.patch
Gerben Jan Dijkman 5667210552 Added Gnome Calls
2021-07-14 14:59:08 +02:00

64 lines
1.7 KiB
Diff

From 9619ebb674771206662f099901c617edb54b870a Mon Sep 17 00:00:00 2001
From: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
Date: Thu, 6 Aug 2020 22:28:37 +0200
Subject: [PATCH] src/calls-call-window.c: Inhibit suspend during active call
---
src/calls-call-window.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/calls-call-window.c b/src/calls-call-window.c
index 312a892..d6c5d8a 100644
--- a/src/calls-call-window.c
+++ b/src/calls-call-window.c
@@ -60,6 +60,8 @@ struct _CallsCallWindow
GtkStack *call_stack;
GtkFlowBox *call_selector;
+ guint inhibit_cookie;
+
#ifdef CALLS_WAYLAND
gboolean screensaver_active;
struct zwlr_layer_shell_v1 *layer_shell_iface;
@@ -164,6 +166,28 @@ update_layer_surface (CallsCallWindow *self,
#endif // CALLS_WAYLAND
+static void
+session_inhibit (CallsCallWindow *self, gboolean inhibit)
+{
+ if (inhibit)
+ {
+ if (self->inhibit_cookie == 0)
+ self->inhibit_cookie =
+ gtk_application_inhibit (gtk_window_get_application (GTK_WINDOW (self)),
+ GTK_WINDOW (self),
+ GTK_APPLICATION_INHIBIT_SUSPEND,
+ "call active");
+ }
+ else
+ {
+ gtk_application_uninhibit (gtk_window_get_application (GTK_WINDOW (self)),
+ self->inhibit_cookie);
+ self->inhibit_cookie = 0;
+ }
+
+}
+
+
static void
update_visibility (CallsCallWindow *self)
{
@@ -184,6 +208,8 @@ update_visibility (CallsCallWindow *self)
{
gtk_stack_set_visible_child_name (self->main_stack, "active-call");
}
+
+ session_inhibit (self, !!calls);
}
--
2.26.2