aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
authorXavi92 <XaviDCR92@users.noreply.github.com>2022-05-11 09:12:30 +0000
committerGitHub <noreply@github.com>2022-05-11 11:12:30 +0200
commit99c076254abc6e2b03b784732a76a389e5a4f801 (patch)
tree18dedfffc850ff7d504d0cb94957fe275218a781 /main/src/ui
parentbaa4a6a1eb4e98558acfef6e2a24c2c13d42db5c (diff)
downloaddino-99c076254abc6e2b03b784732a76a389e5a4f801.tar.gz
dino-99c076254abc6e2b03b784732a76a389e5a4f801.zip
Inhibit idle and suspend during calls (#1233)
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/call_window/call_window_controller.vala14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/src/ui/call_window/call_window_controller.vala b/main/src/ui/call_window/call_window_controller.vala
index 65e5ebd6..276fff98 100644
--- a/main/src/ui/call_window/call_window_controller.vala
+++ b/main/src/ui/call_window/call_window_controller.vala
@@ -22,6 +22,7 @@ public class Dino.Ui.CallWindowController : Object {
private bool window_size_changed = false;
private ulong[] call_window_handler_ids = new ulong[0];
private ulong[] bottom_bar_handler_ids = new ulong[0];
+ private uint inhibit_cookie;
public CallWindowController(CallWindow call_window, CallState call_state, StreamInteractor stream_interactor) {
this.call_window = call_window;
@@ -118,6 +119,19 @@ public class Dino.Ui.CallWindowController : Object {
update_audio_device_choices();
update_video_device_choices();
+
+ var app = GLib.Application.get_default() as Application;
+ inhibit_cookie = app.inhibit(call_window, IDLE | SUSPEND, "Ongoing call");
+
+ if (inhibit_cookie == 0) {
+ warning("suspend inhibit request failed or unsupported");
+ }
+
+ call_window.destroy.connect(() => {
+ if (inhibit_cookie != 0) {
+ app.uninhibit(inhibit_cookie);
+ }
+ });
}
private void invite_button_clicked() {