osdWindow: Ensure we setMaxLevel before setting Level itself

When maxLevel is > 100%, first OSD appearance was capping the current
level to 100%. Consecutives key press were then OK.
Ensure we setMaxLevel before setting Level itself, so that correct cap
value is applied.
This commit is contained in:
Didier Roche 2018-10-18 17:26:03 +02:00
parent 9f3c85fdc8
commit ae7dd5e2db

View File

@ -204,8 +204,8 @@ var OsdWindow = new Lang.Class({
_reset() { _reset() {
this.actor.hide(); this.actor.hide();
this.setLabel(null); this.setLabel(null);
this.setLevel(null);
this.setMaxLevel(null); this.setMaxLevel(null);
this.setLevel(null);
}, },
_relayout() { _relayout() {
@ -253,8 +253,8 @@ var OsdWindowManager = new Lang.Class({
_showOsdWindow(monitorIndex, icon, label, level, maxLevel) { _showOsdWindow(monitorIndex, icon, label, level, maxLevel) {
this._osdWindows[monitorIndex].setIcon(icon); this._osdWindows[monitorIndex].setIcon(icon);
this._osdWindows[monitorIndex].setLabel(label); this._osdWindows[monitorIndex].setLabel(label);
this._osdWindows[monitorIndex].setLevel(level);
this._osdWindows[monitorIndex].setMaxLevel(maxLevel); this._osdWindows[monitorIndex].setMaxLevel(maxLevel);
this._osdWindows[monitorIndex].setLevel(level);
this._osdWindows[monitorIndex].show(); this._osdWindows[monitorIndex].show();
}, },