Update extension to GNOME 3.28

This commit is contained in:
spin83
2018-05-01 15:57:18 +02:00
parent 0209a2b159
commit 72bc548b65
5 changed files with 63 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ in dynamic fashion, no restart needed.
Versions
========
* Branch [master](https://github.com/spin83/multi-monitors-add-on/tree/master) contains extension for GNOME 3.20, 3.22, 3.24 and 3.26
* Branch [master](https://github.com/spin83/multi-monitors-add-on/tree/master) contains extension for GNOME 3.20, 3.22, 3.24, 3.26 and 3.28
* Branch [gnome-3-16_3-18](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-16_3-18) contains extension for GNOME 3.16 and 3.18
* Branch [gnome-3-14](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-14) contains extension for GNOME 3.14
* Branch [gnome-3-10](https://github.com/spin83/multi-monitors-add-on/tree/gnome-3-10) contains extension for GNOME 3.10

View File

@@ -220,6 +220,25 @@ function init(extensionMeta) {
};
}
// fix bug in panel: Destroy function many time added to this same indicator.
Main.panel._ensureIndicator = function(role) {
let indicator = this.statusArea[role];
if (indicator) {
indicator.container.show();
return null;
}
else {
let constructor = PANEL_ITEM_IMPLEMENTATIONS[role];
if (!constructor) {
// This icon is not implemented (this is a bug)
return null;
}
indicator = new constructor(this);
this.statusArea[role] = indicator;
}
return indicator;
};
let metaVersion = MultiMonitors.metadata['version'];
if (Number.isFinite(metaVersion)) {
version = 'v'+Math.trunc(metaVersion);

View File

@@ -1,10 +1,10 @@
{
"shell-version": ["3.20", "3.22", "3.24", "3.26"],
"shell-version": ["3.20", "3.22", "3.24", "3.26", "3.28"],
"uuid": "multi-monitors-add-on@spin83",
"name": "Multi Monitors Add-On",
"settings-schema": "org.gnome.shell.extensions.multi-monitors-add-on",
"gettext-domain": "multi-monitors-add-on",
"description": "Add multiple monitors overview and panel for gnome-shell.",
"url": "https://github.com/spin83/multi-monitors-add-on.git",
"version": 14
"version": 14.2
}

View File

@@ -57,19 +57,25 @@ const MultiMonitorsCalendar = new Lang.Class({
this._showWeekdateKeyId = this._settings.connect('changed::' + Calendar.SHOW_WEEKDATE_KEY, Lang.bind(this, this._onSettingsChange));
this._useWeekdate = this._settings.get_boolean(Calendar.SHOW_WEEKDATE_KEY);
// Find the ordering for month/year in the calendar heading
this._headerFormatWithoutYear = '%B';
switch (gtk30_('calendar:MY')) {
case 'calendar:MY':
this._headerFormat = '%B %Y';
break;
case 'calendar:YM':
this._headerFormat = '%Y %B';
break;
default:
log('Translation of "calendar:MY" in GTK+ is not correct');
this._headerFormat = '%B %Y';
break;
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
this._headerFormatWithoutYear = _('%OB');
this._headerFormat = _('%OB %Y');
}
else {
// Find the ordering for month/year in the calendar heading
this._headerFormatWithoutYear = '%B';
switch (gtk30_('calendar:MY')) {
case 'calendar:MY':
this._headerFormat = '%B %Y';
break;
case 'calendar:YM':
this._headerFormat = '%Y %B';
break;
default:
log('Translation of "calendar:MY" in GTK+ is not correct');
this._headerFormat = '%B %Y';
break;
}
}
// Start off with the current date
@@ -252,11 +258,19 @@ const MultiMonitorsCalendarMessageList = new Lang.Class({
this._sessionModeUpdatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
this._destroy = false;
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
},
_onDestroy: function(actor) {
this._destroy = true;
Main.sessionMode.disconnect(this._sessionModeUpdatedId);
},
_sync: function() {
if (this._destroy) return;
this.parent();
}
});

View File

@@ -357,7 +357,6 @@ const MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS = {
'appMenu': MultiMonitorsAppMenuButton,
'dateMenu': MMCalendar.MultiMonitorsDateMenuButton,
// 'a11y': imports.ui.status.accessibility.ATIndicator,
// 'a11yGreeter': imports.ui.status.accessibility.ATGreeterIndicator,
// 'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
};
@@ -398,6 +397,10 @@ var MultiMonitorsPanel = new Lang.Class({
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
}
this._showingId = Main.overview.connect('showing', Lang.bind(this, function () {
this.actor.add_style_pseudo_class('overview');
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
@@ -430,6 +433,10 @@ var MultiMonitorsPanel = new Lang.Class({
});
}
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
this._workareasChangedId = global.screen.connect('workareas-changed', () => { this.actor.queue_relayout(); });
}
this._updatePanel();
this._settings = Convenience.getSettings();
@@ -449,6 +456,10 @@ var MultiMonitorsPanel = new Lang.Class({
_onDestroy: function(actor) {
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
global.screen.disconnect(this._workareasChangedId);
}
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
global.window_group.disconnect(this._actorAddedId);
global.window_group.disconnect(this._actorRemovedId);
@@ -471,9 +482,10 @@ var MultiMonitorsPanel = new Lang.Class({
Main.sessionMode.disconnect(this._updatedId);
for(let name in this.statusArea){
for (let name in this.statusArea) {
if(this.statusArea.hasOwnProperty(name))
this.statusArea[name].destroy();
delete this.statusArea[name];
}
this.actor._delegate = null;