mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 08:51:59 +02:00
Set (un)inhibit screen earlier
This commit is contained in:
@@ -35,14 +35,14 @@ function getClapperVersion()
|
|||||||
function inhibitForState(state, window)
|
function inhibitForState(state, window)
|
||||||
{
|
{
|
||||||
let isInhibited = false;
|
let isInhibited = false;
|
||||||
let flags = Gtk.ApplicationInhibitFlags.SUSPEND
|
|
||||||
| Gtk.ApplicationInhibitFlags.IDLE;
|
|
||||||
|
|
||||||
if(state === GstPlayer.PlayerState.PLAYING) {
|
if(state === GstPlayer.PlayerState.PLAYING) {
|
||||||
if(inhibitCookie)
|
if(inhibitCookie)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let app = window.get_application();
|
let app = window.get_application();
|
||||||
|
let flags = Gtk.ApplicationInhibitFlags.SUSPEND
|
||||||
|
| Gtk.ApplicationInhibitFlags.IDLE;
|
||||||
|
|
||||||
inhibitCookie = app.inhibit(
|
inhibitCookie = app.inhibit(
|
||||||
window,
|
window,
|
||||||
@@ -58,8 +58,9 @@ function inhibitForState(state, window)
|
|||||||
//if(!inhibitCookie)
|
//if(!inhibitCookie)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Uninhibit seems to be broken as of GTK 3.99.2
|
/* Uninhibit seems to be broken as of GTK 3.99.4
|
||||||
this.uninhibit(inhibitCookie);
|
let app = window.get_application();
|
||||||
|
app.uninhibit(inhibitCookie);
|
||||||
inhibitCookie = null;
|
inhibitCookie = null;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
@@ -309,14 +309,16 @@ class ClapperPlayer extends PlayerBase
|
|||||||
{
|
{
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
||||||
if(this.quitOnStop) {
|
if(state !== GstPlayer.PlayerState.BUFFERING) {
|
||||||
if(state === GstPlayer.PlayerState.STOPPED) {
|
let root = player.widget.get_root();
|
||||||
let root = player.widget.get_root();
|
Misc.inhibitForState(state, root);
|
||||||
if(root)
|
|
||||||
root.run_dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
if(this.quitOnStop) {
|
||||||
|
if(state === GstPlayer.PlayerState.STOPPED)
|
||||||
|
root.run_dispose();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let clapperWidget = player.widget.get_ancestor(Gtk.Grid);
|
let clapperWidget = player.widget.get_ancestor(Gtk.Grid);
|
||||||
|
@@ -414,14 +414,8 @@ var Widget = GObject.registerClass({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isNotStopped = (state !== GstPlayer.PlayerState.STOPPED)
|
let isNotStopped = (state !== GstPlayer.PlayerState.STOPPED);
|
||||||
this.revealerTop.endTime.set_visible(isNotStopped);
|
this.revealerTop.endTime.set_visible(isNotStopped);
|
||||||
|
|
||||||
if(state === GstPlayer.PlayerState.BUFFERING)
|
|
||||||
return;
|
|
||||||
|
|
||||||
let window = this.get_root();
|
|
||||||
Misc.inhibitForState(state, window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPlayerDurationChanged(player)
|
_onPlayerDurationChanged(player)
|
||||||
|
Reference in New Issue
Block a user