Restore automatic menu hiding

This commit is contained in:
Rafostar
2020-10-14 10:57:43 +02:00
parent 1f6a9b59d6
commit 1069f151f0
2 changed files with 25 additions and 77 deletions

View File

@@ -117,7 +117,7 @@ var App = GObject.registerClass({
this.hideControlsTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 3, () => {
this.hideControlsTimeout = null;
if(this.window.isFullscreen && this.isCursorInPlayer) {
if(this.window.isFullscreen && this.player.motionController.is_pointer) {
this.clearTimeout('updateTime');
this.interface.revealControls(false);
}
@@ -176,17 +176,15 @@ var App = GObject.registerClass({
this.player.clickGesture.connect(
'pressed', this._onPlayerPressed.bind(this)
);
/*
this.player.connectWidget(
'enter-notify-event', this._onPlayerEnterNotifyEvent.bind(this)
);
this.player.connectWidget(
'leave-notify-event', this._onPlayerLeaveNotifyEvent.bind(this)
);
*/
this.player.keyController.connect(
'key-pressed', this._onPlayerKeyPressed.bind(this)
);
this.player.motionController.connect(
'enter', this._onPlayerEnter.bind(this)
);
this.player.motionController.connect(
'leave', this._onPlayerLeave.bind(this)
);
this.player.motionController.connect(
'motion', this._onPlayerMotion.bind(this)
);
@@ -327,19 +325,15 @@ var App = GObject.registerClass({
}
}
_onPlayerEnterNotifyEvent(self, event)
_onPlayerEnter(controller, x, y)
{
this.isCursorInPlayer = true;
this.setHideCursorTimeout();
if(this.window.isFullscreen)
this.setHideControlsTimeout();
}
_onPlayerLeaveNotifyEvent(self, event)
_onPlayerLeave(controller)
{
this.isCursorInPlayer = false;
this.clearTimeout('hideCursor');
this.clearTimeout('hideControls');
}