Grab player focus only when controls are not visible

This commit is contained in:
Rafostar
2020-10-14 12:52:11 +02:00
parent 05c9528723
commit a20a0c8160
2 changed files with 9 additions and 8 deletions

View File

@@ -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

View File

@@ -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');
}
}
});