From a20a0c81606cdc4198b758056204dea1cf0bc4d1 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Wed, 14 Oct 2020 12:52:11 +0200 Subject: [PATCH] Grab player focus only when controls are not visible --- clapper_src/app.js | 2 +- clapper_src/revealers.js | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/clapper_src/app.js b/clapper_src/app.js index 93f9e219..cfd89f48 100644 --- a/clapper_src/app.js +++ b/clapper_src/app.js @@ -294,7 +294,7 @@ var App = GObject.registerClass({ isInhibited = (this.inhibitCookie > 0); } else { - if(!this.inhibitCookie) + //if(!this.inhibitCookie) return; /* Uninhibit seems to be broken as of GTK 3.99.2 diff --git a/clapper_src/revealers.js b/clapper_src/revealers.js index 3d52656c..6af461a6 100644 --- a/clapper_src/revealers.js +++ b/clapper_src/revealers.js @@ -200,6 +200,10 @@ class ClapperRevealerBottom extends CustomRevealer let isChange = super.set_visible(isVisible); if(!isChange) return; + let parent = this.get_parent(); + let playerWidget = parent.get_first_child(); + if(!playerWidget) return; + if(isVisible) { let box = this.get_first_child(); if(!box) return; @@ -212,15 +216,12 @@ class ClapperRevealerBottom extends CustomRevealer togglePlayButton.grab_focus(); debug('focus moved to toggle play button'); } + playerWidget.set_can_focus(false); } else { - let parent = this.get_parent(); - let playerWidget = parent.get_first_child(); - - if(playerWidget) { - playerWidget.grab_focus(); - debug('focus moved to player widget'); - } + playerWidget.set_can_focus(true); + playerWidget.grab_focus(); + debug('focus moved to player widget'); } } });