diff -Nru gnome-shell-extension-pop-battery-icon-fix-0.1.0~1532728269~18.04~3818164/debian/changelog gnome-shell-extension-pop-battery-icon-fix-0.1.0~1539650890~18.04~1f88d2e/debian/changelog --- gnome-shell-extension-pop-battery-icon-fix-0.1.0~1532728269~18.04~3818164/debian/changelog 2018-07-27 21:51:09.000000000 +0000 +++ gnome-shell-extension-pop-battery-icon-fix-0.1.0~1539650890~18.04~1f88d2e/debian/changelog 2018-10-16 00:48:10.000000000 +0000 @@ -1,6 +1,6 @@ -gnome-shell-extension-pop-battery-icon-fix (0.1.0~1532728269~18.04~3818164) bionic; urgency=medium +gnome-shell-extension-pop-battery-icon-fix (0.1.0~1539650890~18.04~1f88d2e) bionic; urgency=medium * Auto Build - -- Pop OS (ISO Signing Key) Fri, 27 Jul 2018 15:51:09 -0600 + -- Pop OS (ISO Signing Key) Mon, 15 Oct 2018 18:48:10 -0600 diff -Nru gnome-shell-extension-pop-battery-icon-fix-0.1.0~1532728269~18.04~3818164/extension.js gnome-shell-extension-pop-battery-icon-fix-0.1.0~1539650890~18.04~1f88d2e/extension.js --- gnome-shell-extension-pop-battery-icon-fix-0.1.0~1532728269~18.04~3818164/extension.js 2018-07-27 21:51:09.000000000 +0000 +++ gnome-shell-extension-pop-battery-icon-fix-0.1.0~1539650890~18.04~1f88d2e/extension.js 2018-10-16 00:48:10.000000000 +0000 @@ -1,21 +1,19 @@ const Main = imports.ui.main; const UPower = imports.gi.UPowerGlib; +let old; + function init() { } function enable() { - var icon = ""; - this.power = Main.panel.statusArea.aggregateMenu._power; - - this.power._oldSync = this.power._sync; + old = Main.panel.statusArea.aggregateMenu._power._sync; - this.power.getIcon = getIcon; - - this.power._sync = function(){ - this._oldSync(); + Main.panel.statusArea.aggregateMenu._power._sync = function(){ + let ret = old.apply(this, arguments); if(this._proxy.IsPresent){ + let icon; switch (this._proxy.State) { case UPower.DeviceState.EMPTY: @@ -26,11 +24,11 @@ break; case UPower.DeviceState.CHARGING: case UPower.DeviceState.PENDING_CHARGE: - icon = this.getIcon(this._proxy.Percentage, true); + icon = getIcon(this._proxy.Percentage, true); break; case UPower.DeviceState.DISCHARGING: case UPower.DeviceState.PENDING_DISCHARGE: - icon = this.getIcon(this._proxy.Percentage, false); + icon = getIcon(this._proxy.Percentage, false); break; default: icon = "battery-missing-symbolic"; @@ -39,9 +37,10 @@ this._indicator.icon_name = icon; this._item.icon.icon_name = icon; } - }; + } + - this.power._sync(); + Main.panel.statusArea.aggregateMenu._power._sync(); } function getIcon(percentage, charging){ @@ -59,8 +58,6 @@ function disable() { - this.power._sync = this.power._oldSync; - this.power._oldSync = undefined; - this.power.getIcon = undefined; - this.power._sync(); + Main.panel.statusArea.aggregateMenu._power._sync = old; + Main.panel.statusArea.aggregateMenu._power._sync(); }