Uninhibit screen when video is not playing

This functionality was broken before GTK 4.0.0, so it needs a minimal required GTK version bump
This commit is contained in:
Rafostar
2020-12-22 23:21:49 +01:00
parent 10e04a8eba
commit f2d8d8ad4f
4 changed files with 5 additions and 9 deletions

View File

@@ -57,12 +57,10 @@ function inhibitForState(state, window)
return;
let app = window.get_application();
let flags = Gtk.ApplicationInhibitFlags.SUSPEND
| Gtk.ApplicationInhibitFlags.IDLE;
inhibitCookie = app.inhibit(
window,
flags,
Gtk.ApplicationInhibitFlags.IDLE,
'video is playing'
);
if(!inhibitCookie)
@@ -71,14 +69,12 @@ function inhibitForState(state, window)
isInhibited = (inhibitCookie > 0);
}
else {
//if(!inhibitCookie)
if(!inhibitCookie)
return;
/* Uninhibit seems to be broken as of GTK 3.99.4
let app = window.get_application();
app.uninhibit(inhibitCookie);
inhibitCookie = null;
*/
}
debug(`set prevent suspend to: ${isInhibited}`);