mirror of
https://github.com/BreizhHardware/multi-monitors-add-on.git
synced 2026-01-18 16:47:26 +01:00
Revert "3.29 fixes" due to line endings
This reverts commit 3ce6f8a0c8.
This commit is contained in:
@@ -43,7 +43,7 @@ const gtk30_ = Gettext_gtk30.gettext;
|
||||
const MultiMonitorsCalendar = new Lang.Class({
|
||||
Name: 'MultiMonitorsCalendar',
|
||||
Extends: Calendar.Calendar,
|
||||
|
||||
|
||||
_init: function() {
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
this._weekStart = Shell.util_get_week_start();
|
||||
@@ -53,7 +53,7 @@ const MultiMonitorsCalendar = new Lang.Class({
|
||||
else {
|
||||
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.calendar' });
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
@@ -89,12 +89,12 @@ const MultiMonitorsCalendar = new Lang.Class({
|
||||
|
||||
this.actor.connect('scroll-event',
|
||||
Lang.bind(this, this._onScroll));
|
||||
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
this._buildHeader ();
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
this._settings.disconnect(this._showWeekdateKeyId);
|
||||
}
|
||||
@@ -126,14 +126,14 @@ const MultiMonitorsEventsSection = new Lang.Class({
|
||||
this.parent('');
|
||||
}
|
||||
|
||||
this._defaultAppSystem = Shell.AppSystem.get_default();
|
||||
this._defaultAppSystem = Shell.AppSystem.get_default();
|
||||
this._appInstalledChangedId = this._defaultAppSystem.connect('installed-changed',
|
||||
Lang.bind(this, this._appInstalledChanged));
|
||||
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
this._appInstalledChanged();
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
this._desktopSettings.disconnect(this._reloadEventsId);
|
||||
this._defaultAppSystem.disconnect(this._appInstalledChangedId);
|
||||
@@ -162,7 +162,7 @@ const MultiMonitorsNotificationSection = new Lang.Class({
|
||||
|
||||
_init: function() {
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>22) {
|
||||
this.parent();
|
||||
}
|
||||
@@ -180,7 +180,7 @@ const MultiMonitorsNotificationSection = new Lang.Class({
|
||||
this.actor.connect('notify::mapped', Lang.bind(this, this._onMapped));
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
Main.messageTray.disconnect(this._sourceAddedId);
|
||||
let source, obj;
|
||||
@@ -204,10 +204,10 @@ const MultiMonitorsNotificationSection = new Lang.Class({
|
||||
const MultiMonitorsCalendarMessageList = new Lang.Class({
|
||||
Name: 'MultiMonitorsCalendarMessageList',
|
||||
Extends: Calendar.CalendarMessageList,
|
||||
|
||||
|
||||
_init: function() {
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
|
||||
this.actor = new St.Widget({ style_class: 'message-list',
|
||||
layout_manager: new Clutter.BinLayout(),
|
||||
x_expand: true, y_expand: true });
|
||||
@@ -220,14 +220,14 @@ const MultiMonitorsCalendarMessageList = new Lang.Class({
|
||||
x_expand: true, y_expand: true,
|
||||
x_fill: true, y_fill: true });
|
||||
this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>22) {
|
||||
let box = new St.BoxLayout({ vertical: true,
|
||||
x_expand: true, y_expand: true });
|
||||
this.actor.add_actor(box);
|
||||
|
||||
box.add_actor(this._scrollView);
|
||||
|
||||
|
||||
this._clearButton = new St.Button({ style_class: 'message-list-clear-button button',
|
||||
label: _("Clear All"),
|
||||
can_focus: true });
|
||||
@@ -257,17 +257,17 @@ const MultiMonitorsCalendarMessageList = new Lang.Class({
|
||||
this._addSection(this._eventsSection);
|
||||
|
||||
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();
|
||||
@@ -282,7 +282,7 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
let hbox;
|
||||
let vbox;
|
||||
|
||||
|
||||
let menuAlignment = 0.5;
|
||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||
menuAlignment = 1.0 - menuAlignment;
|
||||
@@ -299,15 +299,15 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
this.actor.label_actor = this._clockDisplay;
|
||||
this.actor.add_actor(box);
|
||||
this.actor.add_style_class_name ('clock-display');
|
||||
|
||||
|
||||
let layout = new DateMenu.FreezableBinLayout();
|
||||
let bin = new St.Widget({ layout_manager: layout });
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
|
||||
// For some minimal compatibility with PopupMenuItem
|
||||
bin._delegate = this;
|
||||
}
|
||||
|
||||
|
||||
this.menu.box.add_child(bin);
|
||||
|
||||
hbox = new St.BoxLayout({ name: 'calendarArea' });
|
||||
@@ -345,7 +345,7 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
vertical: true });
|
||||
}
|
||||
hbox.add(vbox);
|
||||
|
||||
|
||||
this._date = new DateMenu.TodayButton(this._calendar);
|
||||
vbox.add_actor(this._date.actor);
|
||||
|
||||
@@ -356,21 +356,21 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
|
||||
this._clockNotifyTimezoneId = this._clock.connect('notify::timezone', Lang.bind(this, this._updateTimeZone));
|
||||
}
|
||||
|
||||
|
||||
this._sessionModeUpdatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
|
||||
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
|
||||
this._sessionUpdated();
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
Main.sessionMode.disconnect(this._sessionModeUpdatedId);
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
|
||||
this._clock.disconnect(this._clockNotifyTimezoneId);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_getEventSource: function() {
|
||||
return new Calendar.DBusEventSource();
|
||||
},
|
||||
@@ -384,7 +384,7 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
|
||||
this._eventSource = eventSource;
|
||||
},
|
||||
|
||||
|
||||
_updateTimeZone: DateMenu.DateMenuButton.prototype._updateTimeZone,
|
||||
|
||||
_sessionUpdated: function() {
|
||||
@@ -402,5 +402,5 @@ var MultiMonitorsDateMenuButton = new Lang.Class({
|
||||
// that display-specific settings, so re-use "allowSettings" here ...
|
||||
// this._displaysSection.visible = Main.sessionMode.allowSettings;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -100,11 +100,9 @@ const MultiMonitorsWorkspaceThumbnail = new Lang.Class({
|
||||
Lang.bind(this, this._windowAdded));
|
||||
this._windowRemovedId = this.metaWorkspace.connect('window-removed',
|
||||
Lang.bind(this, this._windowRemoved));
|
||||
let display;
|
||||
display = global.screen || global.display;
|
||||
this._windowEnteredMonitorId = display.connect('window-entered-monitor',
|
||||
this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor',
|
||||
Lang.bind(this, this._windowEnteredMonitor));
|
||||
this._windowLeftMonitorId = display.connect('window-left-monitor',
|
||||
this._windowLeftMonitorId = global.screen.connect('window-left-monitor',
|
||||
Lang.bind(this, this._windowLeftMonitor));
|
||||
|
||||
this.state = WorkspaceThumbnail.ThumbnailState.NORMAL;
|
||||
@@ -116,10 +114,10 @@ const MultiMonitorsWorkspaceThumbnail = new Lang.Class({
|
||||
const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
Name: 'MultiMonitorsThumbnailsBox',
|
||||
Extends: WorkspaceThumbnail.ThumbnailsBox,
|
||||
|
||||
|
||||
_init: function(monitorIndex) {
|
||||
this._monitorIndex = monitorIndex;
|
||||
|
||||
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
this.actor = new Shell.GenericContainer({ reactive: true,
|
||||
@@ -130,57 +128,57 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
this.actor._delegate = this;
|
||||
|
||||
|
||||
let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' });
|
||||
|
||||
|
||||
// We don't want the indicator to affect drag-and-drop
|
||||
Shell.util_set_hidden_from_pick(indicator, true);
|
||||
|
||||
|
||||
this._indicator = indicator;
|
||||
this.actor.add_actor(indicator);
|
||||
|
||||
|
||||
this._dropWorkspace = -1;
|
||||
this._dropPlaceholderPos = -1;
|
||||
this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' });
|
||||
this.actor.add_actor(this._dropPlaceholder);
|
||||
this._spliceIndex = -1;
|
||||
|
||||
|
||||
this._targetScale = 0;
|
||||
this._scale = 0;
|
||||
this._pendingScaleUpdate = false;
|
||||
this._stateUpdateQueued = false;
|
||||
this._animatingIndicator = false;
|
||||
this._indicatorY = 0; // only used when _animatingIndicator is true
|
||||
|
||||
|
||||
this._stateCounts = {};
|
||||
for (let key in WorkspaceThumbnail.ThumbnailState)
|
||||
this._stateCounts[WorkspaceThumbnail.ThumbnailState[key]] = 0;
|
||||
|
||||
|
||||
this._thumbnails = [];
|
||||
this._switchWorkspaceNotifyId = 0;
|
||||
this._nWorkspacesNotifyId = 0;
|
||||
this._syncStackingId = 0;
|
||||
this._porthole = null;
|
||||
|
||||
|
||||
this.actor.connect('button-press-event', function() { return Clutter.EVENT_STOP; });
|
||||
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
|
||||
|
||||
|
||||
this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
|
||||
|
||||
|
||||
this._showingId = Main.overview.connect('showing', Lang.bind(this, this._createThumbnails));
|
||||
this._hiddenId = Main.overview.connect('hidden', Lang.bind(this, this._destroyThumbnails));
|
||||
|
||||
|
||||
this._itemDragBeginId = Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
|
||||
this._itemDragEndId = Main.overview.connect('item-drag-end', Lang.bind(this, this._onDragEnd));
|
||||
this._itemDragCancelledId = Main.overview.connect('item-drag-cancelled', Lang.bind(this, this._onDragCancelled));
|
||||
this._windowDragBeginId = Main.overview.connect('window-drag-begin', Lang.bind(this, this._onDragBegin));
|
||||
this._windowDragEndId = Main.overview.connect('window-drag-end', Lang.bind(this, this._onDragEnd));
|
||||
this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onDragCancelled));
|
||||
|
||||
|
||||
this._settings = new Gio.Settings({ schema_id: WorkspaceThumbnail.OVERRIDE_SCHEMA });
|
||||
this._changedDynamicWorkspacesId = this._settings.connect('changed::dynamic-workspaces',
|
||||
Lang.bind(this, this._updateSwitcherVisibility));
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
|
||||
this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', Lang.bind(this, function() {
|
||||
this._destroyThumbnails();
|
||||
@@ -189,13 +187,13 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
this._destroyThumbnails();
|
||||
|
||||
Main.overview.disconnect(this._showingId);
|
||||
Main.overview.disconnect(this._hiddenId);
|
||||
|
||||
|
||||
Main.overview.disconnect(this._itemDragBeginId);
|
||||
Main.overview.disconnect(this._itemDragEndId);
|
||||
Main.overview.disconnect(this._itemDragCancelledId);
|
||||
@@ -210,7 +208,7 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
//TODO drag end ??
|
||||
|
||||
Tweener.removeTweens(actor);
|
||||
|
||||
|
||||
this.actor._delegate = null;
|
||||
},
|
||||
|
||||
@@ -222,13 +220,9 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
else {
|
||||
this._ensurePorthole24();
|
||||
}
|
||||
|
||||
let display;
|
||||
display = global.screen || global.workspace_manager;
|
||||
|
||||
|
||||
for (let k = start; k < start + count; k++) {
|
||||
|
||||
let metaWorkspace = display.get_workspace_by_index(k);
|
||||
let metaWorkspace = global.screen.get_workspace_by_index(k);
|
||||
|
||||
let thumbnail = new MultiMonitorsWorkspaceThumbnail(metaWorkspace, this._monitorIndex);
|
||||
|
||||
@@ -262,10 +256,10 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
_ensurePorthole: function() {
|
||||
if (!(Main.layoutManager.monitors.length>this._monitorIndex))
|
||||
return false;
|
||||
|
||||
|
||||
if (!this._porthole)
|
||||
this._porthole = Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex);
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
_ensurePorthole24: function() {
|
||||
@@ -277,7 +271,7 @@ const MultiMonitorsThumbnailsBox = new Lang.Class({
|
||||
const MultiMonitorsSlidingControl = new Lang.Class({
|
||||
Name: 'MultiMonitorsSlidingControl',
|
||||
Extends: OverviewControls.SlidingControl,
|
||||
|
||||
|
||||
_init: function(params) {
|
||||
params = Params.parse(params, { slideDirection: OverviewControls.SlideDirection.LEFT });
|
||||
|
||||
@@ -292,7 +286,7 @@ const MultiMonitorsSlidingControl = new Lang.Class({
|
||||
clip_to_allocation: true });
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
|
||||
this._hidingId = Main.overview.connect('hiding', Lang.bind(this, this._onOverviewHiding));
|
||||
|
||||
this._itemDragBeginId = Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
|
||||
@@ -302,14 +296,14 @@ const MultiMonitorsSlidingControl = new Lang.Class({
|
||||
this._windowDragBeginId = Main.overview.connect('window-drag-begin', Lang.bind(this, this._onWindowDragBegin));
|
||||
this._windowDragCancelledId = Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onWindowDragEnd));
|
||||
this._windowDragEndId = Main.overview.connect('window-drag-end', Lang.bind(this, this._onWindowDragEnd));
|
||||
|
||||
|
||||
this.onAnimationBegin = null;
|
||||
this.onAnimationEnd = null;
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
Main.overview.disconnect(this._hidingId);
|
||||
|
||||
|
||||
Main.overview.disconnect(this._itemDragBeginId);
|
||||
Main.overview.disconnect(this._itemDragEndId);
|
||||
Main.overview.disconnect(this._itemDragCancelledId);
|
||||
@@ -317,10 +311,10 @@ const MultiMonitorsSlidingControl = new Lang.Class({
|
||||
Main.overview.disconnect(this._windowDragBeginId);
|
||||
Main.overview.disconnect(this._windowDragCancelledId);
|
||||
Main.overview.disconnect(this._windowDragEndId);
|
||||
|
||||
|
||||
Tweener.removeTweens(actor);
|
||||
},
|
||||
|
||||
|
||||
_updateTranslation: function() {
|
||||
let translationStart = 0;
|
||||
let translationEnd = 0;
|
||||
@@ -356,24 +350,24 @@ const MultiMonitorsThumbnailsSlider = new Lang.Class({
|
||||
this.parent({ slideDirection: OverviewControls.SlideDirection.RIGHT });
|
||||
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
|
||||
this._thumbnailsBox = thumbnailsBox;
|
||||
|
||||
this.actor.request_mode = Clutter.RequestMode.WIDTH_FOR_HEIGHT;
|
||||
this.actor.reactive = true;
|
||||
this.actor.track_hover = true;
|
||||
this.actor.add_actor(this._thumbnailsBox.actor);
|
||||
|
||||
|
||||
this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._updateSlide));
|
||||
this.actor.connect('notify::hover', Lang.bind(this, this._updateSlide));
|
||||
|
||||
|
||||
if(this._currentVersion[0]==3 && this._currentVersion[1]<26) {
|
||||
this._switchWorkspaceId = global.window_manager.connect('switch-workspace', Lang.bind(this, this._updateSlide));
|
||||
}
|
||||
|
||||
|
||||
this._thumbnailsBox.actor.bind_property('visible', this.actor, 'visible', GObject.BindingFlags.SYNC_CREATE);
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function() {
|
||||
Main.layoutManager.disconnect(this._monitorsChangedId);
|
||||
if(this._currentVersion[0]==3 && this._currentVersion[1]<26) {
|
||||
@@ -381,7 +375,7 @@ const MultiMonitorsThumbnailsSlider = new Lang.Class({
|
||||
}
|
||||
this.parent();
|
||||
},
|
||||
|
||||
|
||||
_getAlwaysZoomOut: OverviewControls.ThumbnailsSlider.prototype._getAlwaysZoomOut,
|
||||
getNonExpandedWidth: OverviewControls.ThumbnailsSlider.prototype.getNonExpandedWidth,
|
||||
_getSlide: OverviewControls.ThumbnailsSlider.prototype._getSlide,
|
||||
@@ -394,15 +388,15 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
_init: function(index) {
|
||||
this._monitorIndex = index;
|
||||
this._workspacesViews = null;
|
||||
|
||||
|
||||
this._fullGeometry = null;
|
||||
this._animationInProgress = false;
|
||||
|
||||
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
|
||||
this._thumbnailsBox = new MultiMonitorsThumbnailsBox(this._monitorIndex);
|
||||
this._thumbnailsSlider = new MultiMonitorsThumbnailsSlider(this._thumbnailsBox);
|
||||
|
||||
|
||||
this._thumbnailsSlider.onAnimationBegin = Lang.bind(this, function() {
|
||||
this._animationInProgress = true;
|
||||
});
|
||||
@@ -418,47 +412,47 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
let reactiveFlag = false;
|
||||
if(this._currentVersion[0]==3 && this._currentVersion[1]<22)
|
||||
reactiveFlag = true;
|
||||
|
||||
|
||||
let layout = new OverviewControls.ControlsLayout();
|
||||
this.actor = new St.Widget({ layout_manager: layout,
|
||||
reactive: reactiveFlag,
|
||||
x_expand: true, y_expand: true,
|
||||
clip_to_allocation: true });
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
|
||||
|
||||
|
||||
this._group = new St.BoxLayout({ name: 'mm-overview-group',
|
||||
x_expand: true, y_expand: true });
|
||||
this.actor.add_actor(this._group);
|
||||
|
||||
|
||||
this._viewActor = new St.Widget({ clip_to_allocation: true });
|
||||
|
||||
this._group.add(this._viewActor, { x_fill: true,
|
||||
expand: true });
|
||||
|
||||
|
||||
this._group.add_actor(this._thumbnailsSlider.actor);
|
||||
|
||||
layout.connect('allocation-changed', Lang.bind(this, this._updateWorkspacesGeometry));
|
||||
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
||||
|
||||
|
||||
this._settings = Convenience.getSettings();
|
||||
this._thumbnailsOnLeftSideId = this._settings.connect('changed::'+THUMBNAILS_ON_LEFT_SIDE_ID,
|
||||
Lang.bind(this, this._thumbnailsOnLeftSide));
|
||||
this._thumbnailsOnLeftSide();
|
||||
|
||||
|
||||
this._pageChangedId = Main.overview.viewSelector.connect('page-changed', Lang.bind(this, this._setVisibility));
|
||||
this._pageEmptyId = Main.overview.viewSelector.connect('page-empty', Lang.bind(this, this._onPageEmpty));
|
||||
|
||||
|
||||
this._clickAction = new Clutter.ClickAction()
|
||||
this._clickedId = this._clickAction.connect('clicked', Lang.bind(this, function(action) {
|
||||
if (action.get_button() == 1 && this._workspacesViews &&
|
||||
this._workspacesViews.getActiveWorkspace().isEmpty())
|
||||
Main.overview.hide();
|
||||
}));
|
||||
|
||||
|
||||
Main.mmOverview[this._monitorIndex].addAction(this._clickAction);
|
||||
},
|
||||
|
||||
|
||||
inOverviewInit: function() {
|
||||
if (Main.overview.visible) {
|
||||
this._thumbnailsBox._createThumbnails();
|
||||
@@ -468,16 +462,13 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
this._thumbnailsSlider.pageEmpty();
|
||||
}
|
||||
this.show();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_onScrollEvent: function(actor, event) {
|
||||
if (!this.actor.mapped)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
let display;
|
||||
display = global.screen || global.workspace_manager;
|
||||
|
||||
let activeWs = display.get_active_workspace();
|
||||
let activeWs = global.screen.get_active_workspace();
|
||||
let ws;
|
||||
switch (event.get_scroll_direction()) {
|
||||
case Clutter.ScrollDirection.UP:
|
||||
@@ -492,16 +483,16 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
Main.wm.actionMoveWorkspace(ws);
|
||||
return Clutter.EVENT_STOP;
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function() {
|
||||
Main.overview.viewSelector.disconnect(this._pageChangedId);
|
||||
Main.overview.viewSelector.disconnect(this._pageEmptyId);
|
||||
this._settings.disconnect(this._thumbnailsOnLeftSideId);
|
||||
|
||||
|
||||
this._clickAction.disconnect(this._clickedId);
|
||||
Main.mmOverview[this._monitorIndex].removeAction(this._clickAction);
|
||||
},
|
||||
|
||||
|
||||
_thumbnailsOnLeftSide: function() {
|
||||
if(this._settings.get_boolean(THUMBNAILS_ON_LEFT_SIDE_ID)){
|
||||
let first = this._group.get_first_child();
|
||||
@@ -528,11 +519,11 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
return { x: -1, y: -1, width: -1, height: -1 };
|
||||
}
|
||||
let top_spacer_height = Main.layoutManager.primaryMonitor.height;
|
||||
|
||||
|
||||
let panelGhost_height = 0;
|
||||
if(Main.mmOverview[this._monitorIndex]._panelGhost)
|
||||
panelGhost_height = Main.mmOverview[this._monitorIndex]._panelGhost.get_height();
|
||||
|
||||
|
||||
let allocation = Main.overview._controls.actor.allocation;
|
||||
let primaryControl_height = allocation.y2 - allocation.y1;
|
||||
let bottom_spacer_height = Main.layoutManager.primaryMonitor.height - allocation.y2;
|
||||
@@ -543,7 +534,7 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
let spacer = Main.mmOverview[this._monitorIndex]._spacer;
|
||||
if (spacer.get_height()!=top_spacer_height)
|
||||
spacer.set_height(top_spacer_height);
|
||||
|
||||
|
||||
let [x, y] = this.actor.get_transformed_position();
|
||||
let [width, height] = this.actor.get_transformed_size();
|
||||
|
||||
@@ -557,13 +548,13 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
x = Main.layoutManager.monitors[this._monitorIndex].x
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let geometry = { x: x, y: y, width: width, height: height };
|
||||
// global.log("getWorkspacesGeometry x: "+geometry.x+" y: "+geometry.y+" width: "+geometry.width+" height: "+geometry.height);
|
||||
let spacing = this.actor.get_theme_node().get_length('spacing');
|
||||
|
||||
let thumbnailsWidth = this._thumbnailsSlider.getVisibleWidth() + spacing;
|
||||
|
||||
|
||||
geometry.width -= thumbnailsWidth;
|
||||
|
||||
if(this._settings.get_boolean(THUMBNAILS_ON_LEFT_SIDE_ID)){
|
||||
@@ -571,18 +562,18 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
}
|
||||
return geometry;
|
||||
},
|
||||
|
||||
|
||||
isAnimationInProgress: function() {
|
||||
return this._animationInProgress;
|
||||
},
|
||||
|
||||
|
||||
getWorkspacesFullGeometry: function() {
|
||||
if (this._fullGeometry)
|
||||
return this._fullGeometry;
|
||||
else
|
||||
return Main.layoutManager.monitors[this._monitorIndex];
|
||||
},
|
||||
|
||||
|
||||
getWorkspacesActualGeometry: function() {
|
||||
let [x, y] = this._viewActor.get_transformed_position();
|
||||
let allocation = this._viewActor.allocation;
|
||||
@@ -590,7 +581,7 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
let height = allocation.y2 - allocation.y1;
|
||||
return { x: x, y: y, width: width, height: height };
|
||||
},
|
||||
|
||||
|
||||
_updateWorkspacesGeometry: function() {
|
||||
this._fullGeometry = this.getWorkspacesGeometry();
|
||||
if(!this._workspacesViews)
|
||||
@@ -608,21 +599,21 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
return;
|
||||
|
||||
let activePage = Main.overview.viewSelector.getActivePage();
|
||||
|
||||
|
||||
let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
|
||||
|
||||
let opacity = null;
|
||||
if (thumbnailsVisible){
|
||||
this._thumbnailsSlider.slideIn();
|
||||
|
||||
|
||||
opacity = 255;
|
||||
}
|
||||
else{
|
||||
this._thumbnailsSlider.slideOut();
|
||||
|
||||
|
||||
opacity = 0;
|
||||
}
|
||||
|
||||
|
||||
if(!this._workspacesViews)
|
||||
return;
|
||||
|
||||
@@ -637,7 +628,7 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
_onPageEmpty: function() {
|
||||
this._thumbnailsSlider.pageEmpty();
|
||||
},
|
||||
|
||||
|
||||
show: function() {
|
||||
this._workspacesViews = Main.overview.viewSelector._workspacesDisplay._workspacesViews[this._monitorIndex];
|
||||
},
|
||||
@@ -653,11 +644,11 @@ const MultiMonitorsControlsManager = new Lang.Class({
|
||||
|
||||
var MultiMonitorsOverview = new Lang.Class({
|
||||
Name: 'MultiMonitorsOverview',
|
||||
|
||||
|
||||
_init: function(index) {
|
||||
this.monitorIndex = index;
|
||||
this._settings = Convenience.getSettings();
|
||||
|
||||
|
||||
this._overview = new St.BoxLayout({ name: 'overview'+this.monitorIndex,
|
||||
accessible_name: _("Overview"+this.monitorIndex),
|
||||
vertical: true});
|
||||
@@ -670,10 +661,10 @@ var MultiMonitorsOverview = new Lang.Class({
|
||||
this._showingId = null;
|
||||
this._hidingId = null;
|
||||
},
|
||||
|
||||
|
||||
init: function() {
|
||||
this._panelGhost = null;
|
||||
|
||||
|
||||
if (Main.mmPanel) {
|
||||
for (let idx in Main.mmPanel) {
|
||||
if (Main.mmPanel[idx].monitorIndex === this.monitorIndex) {
|
||||
@@ -686,52 +677,52 @@ var MultiMonitorsOverview = new Lang.Class({
|
||||
|
||||
this._spacer = new St.Widget();
|
||||
this._overview.add_actor(this._spacer);
|
||||
|
||||
|
||||
this._controls = new MultiMonitorsControlsManager(this.monitorIndex);
|
||||
this._overview.add(this._controls.actor, { y_fill: true, expand: true });
|
||||
this._controls.inOverviewInit();
|
||||
|
||||
|
||||
this._showingId = Main.overview.connect('showing', Lang.bind(this, this._show));
|
||||
this._hidingId = Main.overview.connect('hiding', Lang.bind(this, this._hide));
|
||||
},
|
||||
|
||||
|
||||
getWorkspacesFullGeometry: function() {
|
||||
return this._controls.getWorkspacesFullGeometry();
|
||||
},
|
||||
|
||||
|
||||
getWorkspacesActualGeometry: function() {
|
||||
if (this._controls.isAnimationInProgress())
|
||||
return null;
|
||||
return this._controls.getWorkspacesActualGeometry();
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
if(this._showingId)
|
||||
Main.overview.disconnect(this._showingId);
|
||||
if(this._hidingId)
|
||||
Main.overview.disconnect(this._hidingId);
|
||||
|
||||
|
||||
Main.layoutManager.overviewGroup.remove_child(this._overview);
|
||||
|
||||
|
||||
this._overview._delegate = null;
|
||||
},
|
||||
|
||||
_show: function() {
|
||||
this._controls.show();
|
||||
},
|
||||
|
||||
|
||||
_hide: function() {
|
||||
this._controls.hide();
|
||||
},
|
||||
|
||||
|
||||
destroy: function() {
|
||||
this._overview.destroy();
|
||||
},
|
||||
|
||||
|
||||
addAction: function(action) {
|
||||
// if (this.isDummy)
|
||||
// return;
|
||||
|
||||
|
||||
this._overview.add_action(action);
|
||||
// _overview >> _backgroundGroup
|
||||
},
|
||||
@@ -747,24 +738,24 @@ var MultiMonitorsOverview = new Lang.Class({
|
||||
var MultiMonitorsWorkspacesDisplay = new Lang.Class({
|
||||
Name: 'MultiMonitorsWorkspacesDisplay',
|
||||
Extends: WorkspacesView.WorkspacesDisplay,
|
||||
|
||||
|
||||
_init: function() {
|
||||
this.parent();
|
||||
this._restackedNotifyId = 0;
|
||||
},
|
||||
|
||||
|
||||
_workspacesOnlyOnPrimaryChanged: function() {
|
||||
this._workspacesOnlyOnPrimary = this._settings.get_boolean('workspaces-only-on-primary');
|
||||
|
||||
if (!Main.overview.visible)
|
||||
return;
|
||||
|
||||
|
||||
if (!this._fullGeometry)
|
||||
return;
|
||||
|
||||
this._updateWorkspacesViews();
|
||||
},
|
||||
|
||||
|
||||
_updateWorkspacesFullGeometry: function() {
|
||||
if (this._workspacesViews.length!=Main.layoutManager.monitors.length)
|
||||
return;
|
||||
@@ -785,7 +776,7 @@ var MultiMonitorsWorkspacesDisplay = new Lang.Class({
|
||||
this._workspacesViews[i].setFullGeometry(geometry);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_updateWorkspacesActualGeometry: function() {
|
||||
if (this._workspacesViews.length!=Main.layoutManager.monitors.length)
|
||||
return;
|
||||
|
||||
@@ -48,20 +48,20 @@ const TRANSFER_INDICATORS_ID = 'transfer-indicators';
|
||||
|
||||
var StatusIndicatorsController = new Lang.Class({
|
||||
Name: 'StatusIndicatorController',
|
||||
|
||||
|
||||
_init: function() {
|
||||
this._transfered_indicators = []; //{iname:, box:, monitor:}
|
||||
this._settings = Convenience.getSettings();
|
||||
|
||||
|
||||
this._updatedSessionId = Main.sessionMode.connect('updated', Lang.bind(this, this._updateSessionIndicators));
|
||||
this._updateSessionIndicators();
|
||||
this._extensionStateChangedId = ExtensionSystem.connect('extension-state-changed',
|
||||
this._extensionStateChangedId = ExtensionSystem.connect('extension-state-changed',
|
||||
Lang.bind(this, this._extensionStateChanged));
|
||||
|
||||
this._transferIndicatorsId = this._settings.connect('changed::'+TRANSFER_INDICATORS_ID,
|
||||
Lang.bind(this, this.transferIndicators));
|
||||
},
|
||||
|
||||
|
||||
destroy: function() {
|
||||
this._settings.disconnect(this._transferIndicatorsId);
|
||||
ExtensionSystem.disconnect(this._extensionStateChangedId);
|
||||
@@ -69,30 +69,30 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
this._settings.set_strv(AVAILABLE_INDICATORS_ID, []);
|
||||
this._transferBack(this._transfered_indicators);
|
||||
},
|
||||
|
||||
|
||||
transferBack: function(panel) {
|
||||
let transfer_back = this._transfered_indicators.filter(function(element) {
|
||||
return element.monitor==panel.monitorIndex;
|
||||
});
|
||||
|
||||
|
||||
this._transferBack(transfer_back, panel);
|
||||
},
|
||||
|
||||
|
||||
transferIndicators: function() {
|
||||
let boxs = ['_leftBox', '_centerBox', '_rightBox'];
|
||||
let transfers = this._settings.get_value(TRANSFER_INDICATORS_ID).deep_unpack();
|
||||
let show_app_menu = this._settings.get_value(SHOW_APP_MENU_ID);
|
||||
|
||||
|
||||
let transfer_back = this._transfered_indicators.filter(function(element) {
|
||||
return !transfers.hasOwnProperty(element.iname);
|
||||
});
|
||||
|
||||
|
||||
this._transferBack(transfer_back);
|
||||
|
||||
|
||||
for(let iname in transfers) {
|
||||
if(transfers.hasOwnProperty(iname) && Main.panel.statusArea[iname]) {
|
||||
let monitor = transfers[iname];
|
||||
|
||||
|
||||
let indicator = Main.panel.statusArea[iname];
|
||||
let panel = this._findPanel(monitor);
|
||||
boxs.forEach(Lang.bind(this, function(box) {
|
||||
@@ -109,7 +109,7 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_findPanel: function(monitor) {
|
||||
for (let i = 0; i < Main.mmPanel.length; i++) {
|
||||
if (Main.mmPanel[i].monitorIndex == monitor) {
|
||||
@@ -118,7 +118,7 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
|
||||
_transferBack: function(transfer_back, panel) {
|
||||
transfer_back.forEach(Lang.bind(this, function(element) {
|
||||
this._transfered_indicators.splice(this._transfered_indicators.indexOf(element));
|
||||
@@ -138,12 +138,12 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
}
|
||||
}));
|
||||
},
|
||||
|
||||
|
||||
_extensionStateChanged: function() {
|
||||
this._findAvailableIndicators();
|
||||
this.transferIndicators();
|
||||
},
|
||||
|
||||
|
||||
_updateSessionIndicators: function() {
|
||||
let session_indicators = [];
|
||||
session_indicators.push('MultiMonitorsAddOn');
|
||||
@@ -155,11 +155,11 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
}
|
||||
this._session_indicators = session_indicators;
|
||||
this._available_indicators = [];
|
||||
|
||||
|
||||
this._findAvailableIndicators();
|
||||
this.transferIndicators();
|
||||
},
|
||||
|
||||
|
||||
_findAvailableIndicators: function() {
|
||||
let available_indicators = [];
|
||||
let statusArea = Main.panel.statusArea;
|
||||
@@ -179,26 +179,23 @@ var StatusIndicatorsController = new Lang.Class({
|
||||
var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
Name: 'MultiMonitorsAppMenuButton',
|
||||
Extends: Panel.AppMenuButton,
|
||||
|
||||
|
||||
_init: function(panel) {
|
||||
if (panel.monitorIndex==undefined)
|
||||
this._monitorIndex = Main.layoutManager.primaryIndex;
|
||||
else
|
||||
else
|
||||
this._monitorIndex = panel.monitorIndex;
|
||||
this._actionOnWorkspaceGroupNotifyId = 0;
|
||||
this._targetAppGroup = null;
|
||||
this._lastFocusedWindow = null;
|
||||
this.parent(panel);
|
||||
|
||||
let display;
|
||||
display = global.screen || global.display;
|
||||
|
||||
this._windowEnteredMonitorId = display.connect('window-entered-monitor',
|
||||
|
||||
this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor',
|
||||
Lang.bind(this, this._windowEnteredMonitor));
|
||||
this._windowLeftMonitorId = display.connect('window-left-monitor',
|
||||
this._windowLeftMonitorId = global.screen.connect('window-left-monitor',
|
||||
Lang.bind(this, this._windowLeftMonitor));
|
||||
},
|
||||
|
||||
|
||||
_windowEnteredMonitor : function(metaScreen, monitorIndex, metaWin) {
|
||||
if (monitorIndex == this._monitorIndex) {
|
||||
switch(metaWin.get_window_type()){
|
||||
@@ -224,9 +221,9 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_findTargetApp: function() {
|
||||
|
||||
|
||||
if (this._actionOnWorkspaceGroupNotifyId) {
|
||||
this._targetAppGroup.disconnect(this._actionOnWorkspaceGroupNotifyId);
|
||||
this._actionOnWorkspaceGroupNotifyId = 0;
|
||||
@@ -234,11 +231,8 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
}
|
||||
let groupWindow = false;
|
||||
let groupFocus = false;
|
||||
|
||||
let display;
|
||||
display = global.screen || global.workspace_manager;
|
||||
|
||||
let workspace = display.get_active_workspace();
|
||||
|
||||
let workspace = global.screen.get_active_workspace();
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
let focusedApp = tracker.focus_app;
|
||||
if (focusedApp && focusedApp.is_on_workspace(workspace)){
|
||||
@@ -250,7 +244,7 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
if(win.has_focus()){
|
||||
this._lastFocusedWindow = win;
|
||||
// global.log(this._monitorIndex+": focus :"+win.get_title()+" : "+win.has_focus());
|
||||
return focusedApp;
|
||||
return focusedApp;
|
||||
}
|
||||
else
|
||||
groupWindow = true;
|
||||
@@ -262,7 +256,7 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
if(groupFocus && groupWindow){
|
||||
if(focusedApp != this._targetApp){
|
||||
this._targetAppGroup = focusedApp;
|
||||
this._actionOnWorkspaceGroupNotifyId = this._targetAppGroup.connect('notify::action-group',
|
||||
this._actionOnWorkspaceGroupNotifyId = this._targetAppGroup.connect('notify::action-group',
|
||||
Lang.bind(this, this._sync));
|
||||
// global.log(this._monitorIndex+": gConnect :"+win.get_title()+" : "+win.has_focus());
|
||||
}
|
||||
@@ -277,15 +271,14 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
// global.log(this._monitorIndex+": newAppFocus");
|
||||
return this._startingApps[i];
|
||||
}
|
||||
|
||||
|
||||
if (this._lastFocusedWindow && this._lastFocusedWindow.located_on_workspace(workspace) &&
|
||||
this._lastFocusedWindow.get_monitor() == this._monitorIndex){
|
||||
// global.log(this._monitorIndex+": lastFocus :"+this._lastFocusedWindow.get_title());
|
||||
return tracker.get_window_app(this._lastFocusedWindow);
|
||||
}
|
||||
|
||||
display = global.screen || global.display;
|
||||
let windows = display.get_tab_list(Meta.TabList.NORMAL_ALL, workspace);
|
||||
let windows = global.screen.get_display().get_tab_list(Meta.TabList.NORMAL_ALL, workspace);
|
||||
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
if(windows[i].get_monitor() == this._monitorIndex){
|
||||
@@ -302,13 +295,10 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
this._targetApp.disconnect(this._actionGroupNotifyId);
|
||||
this._actionGroupNotifyId = 0;
|
||||
}
|
||||
|
||||
let display;
|
||||
display = global.screen || global.display;
|
||||
|
||||
display.disconnect(this._windowEnteredMonitorId);
|
||||
display.disconnect(this._windowLeftMonitorId);
|
||||
|
||||
|
||||
global.screen.disconnect(this._windowEnteredMonitorId);
|
||||
global.screen.disconnect(this._windowLeftMonitorId);
|
||||
|
||||
this.parent();
|
||||
}
|
||||
});
|
||||
@@ -316,7 +306,7 @@ var MultiMonitorsAppMenuButton = new Lang.Class({
|
||||
const MultiMonitorsActivitiesButton = new Lang.Class({
|
||||
Name: 'MultiMonitorsActivitiesButton',
|
||||
Extends: PanelMenu.Button,
|
||||
|
||||
|
||||
handleDragOver: Panel.ActivitiesButton.prototype["handleDragOver"],
|
||||
_onCapturedEvent: Panel.ActivitiesButton.prototype["_onCapturedEvent"],
|
||||
_onEvent: Panel.ActivitiesButton.prototype["_onEvent"],
|
||||
@@ -348,12 +338,12 @@ const MultiMonitorsActivitiesButton = new Lang.Class({
|
||||
this.actor.remove_style_pseudo_class('overview');
|
||||
this.actor.remove_accessible_state (Atk.StateType.CHECKED);
|
||||
}));
|
||||
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
this._xdndTimeOut = 0;
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
Main.overview.disconnect(this._showingId);
|
||||
Main.overview.disconnect(this._hidingId);
|
||||
@@ -376,9 +366,9 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
|
||||
_init : function(monitorIndex, mmPanelBox) {
|
||||
this.monitorIndex = monitorIndex;
|
||||
|
||||
|
||||
this._currentVersion = Config.PACKAGE_VERSION.split('.');
|
||||
|
||||
|
||||
this.actor = new Shell.GenericContainer({ name: 'panel', reactive: true });
|
||||
this.actor._delegate = this;
|
||||
|
||||
@@ -406,11 +396,11 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||
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) {
|
||||
@@ -425,33 +415,30 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
}));
|
||||
|
||||
mmPanelBox.panelBox.add(this.actor);
|
||||
|
||||
|
||||
Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar")+" "+this.monitorIndex, 'focus-top-bar-symbolic',
|
||||
{ sortGroup: CtrlAltTab.SortGroup.TOP });
|
||||
|
||||
|
||||
this._updatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._updatePanel));
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>24) {
|
||||
this._trackedWindows = new Map();
|
||||
this._actorAddedId = global.window_group.connect('actor-added', Lang.bind(this, this._onWindowActorAdded));
|
||||
this._actorRemovedId = global.window_group.connect('actor-removed', Lang.bind(this, this._onWindowActorRemoved));
|
||||
this._switchWorkspaceId = global.window_manager.connect('switch-workspace', Lang.bind(this, this._updateSolidStyle));
|
||||
|
||||
|
||||
global.window_group.get_children().forEach(metaWindowActor => {
|
||||
if (metaWindowActor['get_meta_window'] && metaWindowActor.get_meta_window().get_window_type() != Meta.WindowType.DESKTOP)
|
||||
this._onWindowActorAdded(null, metaWindowActor);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
|
||||
let display;
|
||||
display = global.screen || global.display;
|
||||
|
||||
this._workareasChangedId = display.connect('workareas-changed', () => { this.actor.queue_relayout(); });
|
||||
this._workareasChangedId = global.screen.connect('workareas-changed', () => { this.actor.queue_relayout(); });
|
||||
}
|
||||
|
||||
|
||||
this._updatePanel();
|
||||
|
||||
|
||||
this._settings = Convenience.getSettings();
|
||||
this._showActivitiesId = this._settings.connect('changed::'+SHOW_ACTIVITIES_ID,
|
||||
Lang.bind(this, this._showActivities));
|
||||
@@ -460,53 +447,50 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
this._showAppMenuId = this._settings.connect('changed::'+SHOW_APP_MENU_ID,
|
||||
Lang.bind(this, this._showAppMenu));
|
||||
this._showAppMenu();
|
||||
|
||||
|
||||
this._showDateTimeId = this._settings.connect('changed::'+SHOW_DATE_TIME_ID,
|
||||
Lang.bind(this, this._showDateTime));
|
||||
this._showDateTime();
|
||||
|
||||
},
|
||||
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
|
||||
|
||||
if (this._currentVersion[0]==3 && this._currentVersion[1]>26) {
|
||||
let display;
|
||||
display = global.screen || global.display;
|
||||
|
||||
display.disconnect(this._workareasChangedId);
|
||||
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);
|
||||
global.window_manager.disconnect(this._switchWorkspaceId);
|
||||
|
||||
|
||||
this._trackedWindows.forEach(function (value, key, map) {
|
||||
value.forEach(id => {
|
||||
key.disconnect(id);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Main.overview.disconnect(this._showingId);
|
||||
Main.overview.disconnect(this._hidingId);
|
||||
this._settings.disconnect(this._showActivitiesId);
|
||||
this._settings.disconnect(this._showAppMenuId);
|
||||
// Tweener.removeTweens(actor);
|
||||
|
||||
|
||||
Main.ctrlAltTabManager.removeGroup(this.actor);
|
||||
|
||||
|
||||
Main.sessionMode.disconnect(this._updatedId);
|
||||
|
||||
|
||||
for (let name in this.statusArea) {
|
||||
if(this.statusArea.hasOwnProperty(name))
|
||||
this.statusArea[name].destroy();
|
||||
delete this.statusArea[name];
|
||||
}
|
||||
|
||||
|
||||
this.actor._delegate = null;
|
||||
},
|
||||
|
||||
|
||||
_showActivities: function() {
|
||||
let name = 'activities';
|
||||
if(this._settings.get_boolean(SHOW_ACTIVITIES_ID)){
|
||||
@@ -518,7 +502,7 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
this.statusArea[name].actor.visible = false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_showDateTime: function() {
|
||||
let name = 'dateMenu';
|
||||
if(this._settings.get_boolean(SHOW_DATE_TIME_ID)){
|
||||
@@ -530,7 +514,7 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
this.statusArea[name].actor.visible = false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_showAppMenu: function() {
|
||||
let name = 'appMenu';
|
||||
if(this._settings.get_boolean(SHOW_APP_MENU_ID)){
|
||||
@@ -557,7 +541,7 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
else
|
||||
alloc.natural_size = -1;
|
||||
},
|
||||
|
||||
|
||||
_updateSolidStyle: function() {
|
||||
if (this.actor.has_style_pseudo_class('overview') || !Main.sessionMode.hasWindows) {
|
||||
this._removeStyleClassName('solid');
|
||||
@@ -568,9 +552,7 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
return;
|
||||
|
||||
/* Get all the windows in the active workspace that are in the primary monitor and visible */
|
||||
let display;
|
||||
display = global.screen || global.workspace_manager;
|
||||
let activeWorkspace = display.get_active_workspace();
|
||||
let activeWorkspace = global.screen.get_active_workspace();
|
||||
let monitorIndex = this.monitorIndex;
|
||||
let windows = activeWorkspace.list_windows().filter(function(metaWindow) {
|
||||
return metaWindow.get_monitor() == monitorIndex &&
|
||||
@@ -593,7 +575,7 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
this._removeStyleClassName('solid');
|
||||
},
|
||||
|
||||
|
||||
|
||||
_hideIndicators: function() {
|
||||
for (let role in MULTI_MONITOR_PANEL_ITEM_IMPLEMENTATIONS) {
|
||||
let indicator = this.statusArea[role];
|
||||
@@ -619,4 +601,4 @@ var MultiMonitorsPanel = new Lang.Class({
|
||||
}
|
||||
return indicator;
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user