Resume usage of main panel on primary monitor

This commit is contained in:
Charles Gagnon
2019-12-28 22:02:17 -05:00
parent 77ae9ca855
commit 9dd4a021d1
6 changed files with 207 additions and 145 deletions

View File

@@ -99,7 +99,7 @@ var taskbarAppIcon = Utils.defineClass({
ParentConstrParams: [[0, 'app'], [2]],
_init: function(appInfo, panel, iconParams, previewMenu) {
this.panel = panel;
this.dtpPanel = panel;
this._nWindows = 0;
this.window = appInfo.window;
this.isLauncher = appInfo.isLauncher;
@@ -356,7 +356,7 @@ var taskbarAppIcon = Utils.defineClass({
let scrollAction = Me.settings.get_string('scroll-icon-action');
if (scrollAction === 'PASS_THROUGH') {
return this.panel._onPanelMouseScroll(actor, event);
return this.dtpPanel._onPanelMouseScroll(actor, event);
} else if (scrollAction === 'NOTHING' || (!this.window && !this._nWindows)) {
return;
}
@@ -537,7 +537,7 @@ var taskbarAppIcon = Utils.defineClass({
return global.display.focus_window &&
(!Me.settings.get_boolean('multi-monitors') || // only check same monitor index if multi window is enabled.
!Me.settings.get_boolean('isolate-monitors') ||
global.display.focus_window.get_monitor() === this.panel.monitor.index);
global.display.focus_window.get_monitor() === this.dtpPanel.monitor.index);
},
_setAppIconPadding: function() {
@@ -807,7 +807,7 @@ var taskbarAppIcon = Utils.defineClass({
}
} else {
//grouped application behaviors
let monitor = this.panel.monitor;
let monitor = this.dtpPanel.monitor;
let appHasFocus = this._checkIfFocusedApp() && this._checkIfMonitorHasFocus();
switch (buttonAction) {
@@ -1190,7 +1190,7 @@ var taskbarAppIcon = Utils.defineClass({
acceptDrop: function() { return false; },
getAppIconInterestingWindows: function(isolateMonitors) {
return getInterestingWindows(this.app, this.panel.monitor, isolateMonitors);
return getInterestingWindows(this.app, this.dtpPanel.monitor, isolateMonitors);
}
});

View File

@@ -356,7 +356,7 @@ var Intellihide = Utils.defineClass({
},
_checkIfGrab: function() {
if (GrabHelper._grabHelperStack.some(gh => gh._owner == this._dtpPanel.grabOwner)) {
if (GrabHelper._grabHelperStack.some(gh => gh._owner == this._dtpPanel.panel.actor)) {
//there currently is a grab on a child of the panel, check again soon to catch its release
this._timeoutsHandler.add([T1, CHECK_GRAB_MS, () => this._queueUpdatePanelPosition()]);

182
panel.js
View File

@@ -59,6 +59,7 @@ const Transparency = Me.imports.transparency;
const _ = imports.gettext.domain(Me.imports.utils.TRANSLATION_DOMAIN).gettext;
let tracker = Shell.WindowTracker.get_default();
var panelBoxes = ['_leftBox', '_centerBox', '_rightBox'];
var sizeFunc;
var fixedCoord;
var varCoord;
@@ -116,14 +117,9 @@ var dtpPanel = Utils.defineClass({
_init: function(panelManager, monitor, panelBox, isSecondary) {
let position = getPosition();
this.callParent('_init', { name: 'panel', reactive: true });
this.bg = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this.bg.add_child(this);
Utils.wrapActor(this);
this._delegate = this;
this.callParent('_init', { layout_manager: new Clutter.BinLayout() });
this._timeoutsHandler = new Utils.TimeoutsHandler();
this._signalsHandler = new Utils.GlobalSignalsHandler();
@@ -135,52 +131,65 @@ var dtpPanel = Utils.defineClass({
this.isSecondary = isSecondary;
this._sessionStyle = null;
if (position == St.Side.TOP) {
this._leftCorner = new Panel.PanelCorner(St.Side.LEFT);
this._rightCorner = new Panel.PanelCorner(St.Side.RIGHT);
Utils.wrapActor(this._leftCorner);
Utils.wrapActor(this._rightCorner);
this.add_actor(this._leftCorner.actor);
this.add_actor(this._rightCorner.actor);
}
if (isSecondary) {
this.statusArea = {};
this.panel = new St.Widget({ name: 'panel', reactive: true });
this.statusArea = this.panel.statusArea = {};
this._leftBox = new St.BoxLayout({ name: 'panelLeft' });
this._centerBox = new St.BoxLayout({ name: 'panelCenter' });
this._rightBox = new St.BoxLayout({ name: 'panelRight' });
//next 3 functions are needed by other extensions to add elements to the secondary panel
this.panel.addToStatusArea = function(role, indicator, position, box) {
return Main.panel.addToStatusArea.call(this, role, indicator, position, box);
};
this.menuManager = new PopupMenu.PopupMenuManager(this);
this.grabOwner = this;
this.panel._addToPanelBox = function(role, indicator, position, box) {
Main.panel._addToPanelBox.call(this, role, indicator, position, box);
};
this.panel._onMenuSet = function(indicator) {
Main.panel._onMenuSet.call(this, indicator);
};
this._leftBox = this.panel._leftBox = new St.BoxLayout({ name: 'panelLeft' });
this._centerBox = this.panel._centerBox = new St.BoxLayout({ name: 'panelCenter' });
this._rightBox = this.panel._rightBox = new St.BoxLayout({ name: 'panelRight' });
this.menuManager = this.panel.menuManager = new PopupMenu.PopupMenuManager(this.panel);
//adding the clock to the centerbox will correctly position it according to dtp settings (event actor-added)
this._setPanelMenu('show-status-menu-all-monitors', 'aggregateMenu', dtpSecondaryAggregateMenu, this._rightBox, true);
this._setPanelMenu('show-clock-all-monitors', 'dateMenu', DateMenu.DateMenuButton, this._centerBox, true);
this.panel.add_child(this._leftBox);
this.panel.add_child(this._centerBox);
this.panel.add_child(this._rightBox);
if (position == St.Side.TOP) {
this.panel._leftCorner = new Panel.PanelCorner(St.Side.LEFT);
this.panel._rightCorner = new Panel.PanelCorner(St.Side.RIGHT);
Utils.wrapActor(this.panel._leftCorner);
Utils.wrapActor(this.panel._rightCorner);
this.panel.add_child(this.panel._leftCorner.actor);
this.panel.add_child(this.panel._rightCorner.actor);
}
} else {
this.panel = Main.panel;
this.statusArea = Main.panel.statusArea;
this.menuManager = Main.panel.menuManager;
this.grabOwner = Main.panel.actor;
setMenuArrow(this.statusArea.aggregateMenu._indicators.get_last_child(), position);
['_leftBox', '_centerBox', '_rightBox'].forEach(p => {
Main.panel.actor.remove_child(Main.panel[p]);
this[p] = Main.panel[p];
});
panelBoxes.forEach(p => this[p] = Main.panel[p]);
}
this.add_child(this._leftBox);
this.add_child(this._centerBox);
this.add_child(this._rightBox);
Utils.wrapActor(this.panel);
Utils.wrapActor(this.statusArea.activities || 0);
this.panel.actor._delegate = this;
this.add_child(this.panel.actor);
if (Main.panel._onButtonPress) {
this._signalsHandler.add([
this,
this.panel.actor,
[
'button-press-event',
'touch-event'
@@ -190,7 +199,7 @@ var dtpPanel = Utils.defineClass({
}
if (Main.panel._onKeyPress) {
this._signalsHandler.add([this, 'key-press-event', Main.panel._onKeyPress.bind(this)]);
this._signalsHandler.add([this.panel.actor, 'key-press-event', Main.panel._onKeyPress.bind(this)]);
}
Main.ctrlAltTabManager.addGroup(this, _("Top Bar")+" "+ monitor.index, 'focus-top-bar-symbolic',
@@ -237,16 +246,35 @@ var dtpPanel = Utils.defineClass({
}
}
this._adjustForOverview();
this._setPanelGhostSize();
this._setPanelPosition();
if (!this.isSecondary && this.statusArea.dateMenu) {
// remove the extra space before the clock when the message-indicator is displayed
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', () => [0,0]);
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_height', () => [0,0]);
if (!this.isSecondary) {
if (this.panel.vfunc_allocate) {
this._panelConnectId = 0;
Utils.hookVfunc(this.panel.__proto__, 'allocate', (box, flags) => this._mainPanelAllocate(box, flags));
} else {
this._panelConnectId = this.panel.actor.connect('allocate', (actor, box, flags) => this._mainPanelAllocate(actor, box, flags));
}
if (this.statusArea.dateMenu) {
// remove the extra space before the clock when the message-indicator is displayed
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', () => [0,0]);
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_height', () => [0,0]);
}
}
// The main panel's connection to the "allocate" signal is competing with this extension
// trying to move the centerBox over to the right, creating a never-ending cycle.
// Since we don't have the ID to disconnect that handler, wrap the allocate() function
// it calls instead. If the call didn't originate from this file, ignore it.
panelBoxes.forEach(b => {
this[b].allocate = (box, flags, isFromDashToPanel) => {
if (isFromDashToPanel) {
this[b].__proto__.allocate.call(this[b], box, flags);
}
}
});
this.menuManager._oldChangeMenu = this.menuManager._changeMenu;
this.menuManager._changeMenu = (menu) => {
if (!Me.settings.get_boolean('stockgs-panelbtn-click-only')) {
@@ -272,13 +300,16 @@ var dtpPanel = Utils.defineClass({
this._setClockLocation(Me.settings.get_string('location-clock'));
this._displayShowDesktopButton(Me.settings.get_boolean('show-showdesktop-button'));
this.add_style_class_name('dashtopanelMainPanel ' + getOrientation());
this.panel.actor.add_style_class_name('dashtopanelMainPanel ' + getOrientation());
// Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to
//animate a null target since some variables are not initialized when the viewSelector is created
if(Main.overview.viewSelector._activePage == null)
Main.overview.viewSelector._activePage = Main.overview.viewSelector._workspacesPage;
this._adjustForOverview();
this._setPanelGhostSize();
if(this.taskbar._showAppsIconWrapper)
this.taskbar._showAppsIconWrapper._dtpPanel = this;
@@ -344,7 +375,7 @@ var dtpPanel = Utils.defineClass({
() => this._onBoxActorAdded(this._rightBox)
],
[
this,
this.panel.actor,
'scroll-event',
this._onPanelMouseScroll.bind(this)
],
@@ -421,16 +452,13 @@ var dtpPanel = Utils.defineClass({
this._myPanelGhost.get_parent().remove_actor(this._myPanelGhost);
panelBoxes.forEach(b => delete this[b].allocate);
if (!this.isSecondary) {
this._setVertical(this, false);
this._setVertical(this.panel.actor, false);
this.remove_style_class_name('dashtopanelPanel vertical horizontal');
this.panel.actor.remove_style_class_name('dashtopanelPanel vertical horizontal dashtopanelMainPanel ' + getOrientation());
['_leftBox', '_centerBox', '_rightBox'].forEach(p => {
this.remove_child(Main.panel[p]);
Main.panel.actor.add_child(Main.panel[p]);
});
this._setActivitiesButtonVisible(true);
this._setClockLocation("BUTTONSLEFT");
this._displayShowDesktopButton(false);
@@ -447,6 +475,14 @@ var dtpPanel = Utils.defineClass({
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', DateMenu.IndicatorPad.prototype.vfunc_get_preferred_width);
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_height', DateMenu.IndicatorPad.prototype.vfunc_get_preferred_height);
}
if (this._panelConnectId) {
this.panel.actor.disconnect(this._panelConnectId);
} else {
Utils.hookVfunc(this.panel.__proto__, 'allocate', this.panel.__proto__.vfunc_allocate);
}
this.panel.actor._delegate = this.panel;
} else {
this._removePanelMenu('dateMenu');
this._removePanelMenu('aggregateMenu');
@@ -455,19 +491,6 @@ var dtpPanel = Utils.defineClass({
Main.ctrlAltTabManager.removeGroup(this);
},
//next 3 functions are needed by other extensions to add elements to the secondary panel
addToStatusArea: function(role, indicator, position, box) {
return Main.panel.addToStatusArea.call(this, role, indicator, position, box);
},
_addToPanelBox: function(role, indicator, position, box) {
Main.panel._addToPanelBox.call(this, role, indicator, position, box);
},
_onMenuSet: function(indicator) {
Main.panel._onMenuSet.call(this, indicator);
},
handleDragOver: function(source, actor, x, y, time) {
if (source == Main.xdndHandler) {
@@ -587,7 +610,7 @@ var dtpPanel = Utils.defineClass({
this._myPanelGhost[isOverviewFocusedMonitor ? 'show' : 'hide']();
if (isOverviewFocusedMonitor) {
Utils.getPanelGhost().set_height(this.geom.position == St.Side.TOP ? 0 : Main.panel.actor.height);
Utils.getPanelGhost().set_size(1, this.geom.position == St.Side.TOP ? 0 : 32);
}
}
},
@@ -655,6 +678,10 @@ var dtpPanel = Utils.defineClass({
};
},
_mainPanelAllocate: function(box, flags) {
this.panel.actor.set_allocation(box, flags);
},
vfunc_allocate: function(box, flags) {
this.set_allocation(box, flags);
@@ -727,28 +754,29 @@ var dtpPanel = Utils.defineClass({
childBoxRight[varCoord.c2] = panelAllocVarSize;
}
if (this._leftCorner) {
this.panel.actor.allocate(new Clutter.ActorBox({ x1: 0, y1: 0, x2: this.geom.w, y2: this.geom.h }), flags);
this._leftBox.allocate(childBoxLeft, flags, 1);
this._centerBox.allocate(childBoxCenter, flags, 1);
this._rightBox.allocate(childBoxRight, flags, 1);
if (this.geom.position == St.Side.TOP) {
let childBoxLeftCorner = new Clutter.ActorBox();
let [ , cornerSize] = this._leftCorner.actor[sizeFunc](-1);
let [ , cornerSize] = this.panel._leftCorner.actor[sizeFunc](-1);
childBoxLeftCorner[varCoord.c1] = 0;
childBoxLeftCorner[varCoord.c2] = cornerSize;
childBoxLeftCorner[fixedCoord.c1] = panelAllocFixedSize;
childBoxLeftCorner[fixedCoord.c2] = panelAllocFixedSize + cornerSize;
let childBoxRightCorner = new Clutter.ActorBox();
[ , cornerSize] = this._rightCorner.actor[sizeFunc](-1);
[ , cornerSize] = this.panel._rightCorner.actor[sizeFunc](-1);
childBoxRightCorner[varCoord.c1] = panelAllocVarSize - cornerSize;
childBoxRightCorner[varCoord.c2] = panelAllocVarSize;
childBoxRightCorner[fixedCoord.c1] = panelAllocFixedSize;
childBoxRightCorner[fixedCoord.c2] = panelAllocFixedSize + cornerSize;
this._leftCorner.actor.allocate(childBoxLeftCorner, flags);
this._rightCorner.actor.allocate(childBoxRightCorner, flags);
this.panel._leftCorner.actor.allocate(childBoxLeftCorner, flags);
this.panel._rightCorner.actor.allocate(childBoxRightCorner, flags);
}
this._leftBox.allocate(childBoxLeft, flags);
this._centerBox.allocate(childBoxCenter, flags);
this._rightBox.allocate(childBoxRight, flags);
},
_setPanelPosition: function() {
@@ -757,13 +785,13 @@ var dtpPanel = Utils.defineClass({
this.set_size(this.geom.w, this.geom.h);
container.set_position(this.geom.x, this.geom.y);
this._setVertical(this, checkIfVertical());
this._setVertical(this.panel.actor, checkIfVertical());
// styles for theming
Object.keys(St.Side).forEach(p => {
let cssName = 'dashtopanel' + p.charAt(0) + p.slice(1).toLowerCase();
this[(St.Side[p] == this.geom.position ? 'add' : 'remove') + '_style_class_name'](cssName);
this.panel.actor[(St.Side[p] == this.geom.position ? 'add' : 'remove') + '_style_class_name'](cssName);
});
Main.layoutManager._updateHotCorners();
@@ -861,8 +889,8 @@ var dtpPanel = Utils.defineClass({
_setActivitiesButtonVisible: function(isVisible) {
if(this.statusArea.activities)
isVisible ? this.statusArea.activities.actor.show() :
this.statusArea.activities.actor.hide();
isVisible ? this.statusArea.activities.container.show() :
this.statusArea.activities.container.hide();
},
_setAppmenuVisible: function(isVisible) {

View File

@@ -50,6 +50,7 @@ const LookingGlass = imports.ui.lookingGlass;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const Layout = imports.ui.layout;
const WM = imports.ui.windowManager;
const WorkspacesView = imports.ui.workspacesView;
var dtpPanelManager = Utils.defineClass({
@@ -76,9 +77,6 @@ var dtpPanelManager = Utils.defineClass({
Utils.wrapActor(Main.panel);
Utils.wrapActor(Main.overview.dash || 0);
Main.panel.actor.hide();
Main.layoutManager.panelBox.height = 0;
this.primaryPanel = this._createPanel(dtpPrimaryMonitor);
this.allPanels = [ this.primaryPanel ];
@@ -120,6 +118,10 @@ var dtpPanelManager = Utils.defineClass({
this.setFocusedMonitor(dtpPrimaryMonitor);
if (Panel.checkIfVertical()) {
Main.wm._getPositionForDirection = newGetPositionForDirection;
}
if (reset) return;
this._oldViewSelectorAnimateIn = Main.overview.viewSelector._animateIn;
@@ -205,7 +207,7 @@ var dtpPanelManager = Utils.defineClass({
]
);
['_leftBox', '_centerBox', '_rightBox'].forEach(c => this._signalsHandler.add(
Panel.panelBoxes.forEach(c => this._signalsHandler.add(
[Main.panel[c], 'actor-added', (parent, child) => this._adjustPanelMenuButton(this._getPanelMenuButton(child), this.primaryPanel.monitor, Panel.getPosition())]
));
@@ -230,20 +232,34 @@ var dtpPanelManager = Utils.defineClass({
this._removePanelBarriers(p);
p.disable();
Main.layoutManager.removeChrome(p.panelBox);
p.panelBox.destroy();
if (p.isSecondary) {
Main.layoutManager.removeChrome(p.panelBox);
p.panelBox.destroy();
} else {
p.panelBox.remove_child(p);
p.remove_child(p.panel.actor);
p.panelBox.add(p.panel.actor);
}
});
if (BoxPointer.BoxPointer.prototype.vfunc_get_preferred_height) {
Utils.hookVfunc(BoxPointer.BoxPointer.prototype, 'get_preferred_height', BoxPointer.BoxPointer.prototype.vfunc_get_preferred_height);
}
delete Main.wm._getPositionForDirection;
if (reset) return;
this._setKeyBindings(false);
this._signalsHandler.destroy();
if (Main.layoutManager.primaryMonitor) {
Main.layoutManager.panelBox.set_position(Main.layoutManager.primaryMonitor.x, Main.layoutManager.primaryMonitor.y);
Main.layoutManager.panelBox.set_size(Main.layoutManager.primaryMonitor.width, -1);
}
Main.layoutManager._updateHotCorners = this._oldUpdateHotCorners;
Main.layoutManager._updateHotCorners();
@@ -262,10 +278,7 @@ var dtpPanelManager = Utils.defineClass({
Main.overview.viewSelector._workspacesDisplay._updateWorkspacesViews = this._oldUpdateWorkspacesViews;
Utils.getPanelGhost().set_height(Main.panel.actor.height);
Main.panel.actor.show();
Main.layoutManager.panelBox.set_height(-1);
Utils.getPanelGhost().set_size(-1, -1);
if (this._needsDashItemContainerAllocate) {
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', function(box, flags) { this.vfunc_allocate(box, flags); });
@@ -300,11 +313,20 @@ var dtpPanelManager = Utils.defineClass({
},
_createPanel: function(monitor, isSecondary) {
let panelBox = new St.BoxLayout({ name: 'panelBox' });
let panel = new Panel.dtpPanel(this, monitor, panelBox, isSecondary);
let panelBox;
let panel;
if (isSecondary) {
panelBox = new St.BoxLayout({ name: 'panelBox' });
Main.layoutManager.addChrome(panelBox, { affectsStruts: true, trackFullscreen: true });
} else {
panelBox = Main.layoutManager.panelBox;
panelBox.remove_child(Main.panel);
}
panel = new Panel.dtpPanel(this, monitor, panelBox, isSecondary);
panelBox.add(panel);
panelBox.add(panel.bg);
Main.layoutManager.addChrome(panelBox, { affectsStruts: true, trackFullscreen: true });
panel.enable();
panelBox.visible = !monitor.inFullscreen;
@@ -492,7 +514,6 @@ function newViewSelectorAnimateIn(oldPage) {
function newViewSelectorAnimateOut(page) {
let oldPage = page;
let vs = Main.overview.viewSelector;
if (page == vs._appsPage &&
@@ -511,6 +532,21 @@ function newViewSelectorAnimateOut(page) {
}
}
function newGetPositionForDirection(direction, fromWs, toWs) {
let [xDest, yDest] = WM.WindowManager.prototype._getPositionForDirection(direction, fromWs, toWs);
if (direction == Meta.MotionDirection.UP ||
direction == Meta.MotionDirection.UP_LEFT ||
direction == Meta.MotionDirection.UP_RIGHT) {
yDest -= Main.panel.height;
} else if (direction != Meta.MotionDirection.LEFT &&
direction != Meta.MotionDirection.RIGHT) {
yDest += Main.panel.height;
}
return [xDest, yDest];
}
function newDoSpringAnimation(animationDirection) {
this._grid.opacity = 255;
this._grid.animateSpring(animationDirection, Main.overview.getShowAppsButton());
@@ -588,19 +624,17 @@ function newUpdateHotCorners() {
}
function newUpdatePanelBarrier(panel) {
if (this._rightPanelBarrier) {
this._rightPanelBarrier.destroy();
}
let barriers = {
_rightPanelBarrier: [],
_leftPanelBarrier: []
_rightPanelBarrier: [(panel.isSecondary ? panel : this)],
_leftPanelBarrier: [panel]
};
Object.keys(barriers).forEach(k => {
if (panel[k]) {
panel[k].destroy();
panel[k] = null;
let obj = barriers[k][0];
if (obj[k]) {
obj[k].destroy();
obj[k] = null;
}
});
@@ -650,27 +684,27 @@ function newUpdatePanelBarrier(panel) {
Object.keys(barriers).forEach(k => {
let barrierOptions = {
display: global.display,
directions: barriers[k][1]
directions: barriers[k][2]
};
barrierOptions[Panel.varCoord.c1] = barrierOptions[Panel.varCoord.c2] = barriers[k][0];
barrierOptions[Panel.varCoord.c1] = barrierOptions[Panel.varCoord.c2] = barriers[k][1];
barrierOptions[Panel.fixedCoord.c1] = fixed1;
barrierOptions[Panel.fixedCoord.c2] = fixed2;
panel[k] = new Meta.Barrier(barrierOptions);
barriers[k][0][k] = new Meta.Barrier(barrierOptions);
});
}
function _newLookingGlassResize() {
let topOffset = Panel.getPosition() == St.Side.TOP ? Panel.size : 0;
this._oldResize();
if (Panel.getPosition() == St.Side.TOP) {
this._hiddenY = Main.layoutManager.primaryMonitor.y + Panel.size - this.actor.height;
this._targetY = this._hiddenY + this.actor.height;
this.actor.y = this._hiddenY;
this._hiddenY = Main.layoutManager.primaryMonitor.y + topOffset - this.actor.height;
this._targetY = this._hiddenY + this.actor.height;
this.actor.y = this._hiddenY;
this._objInspector.actor.set_position(this.actor.x + Math.floor(this.actor.width * 0.1), this._targetY + Math.floor(this.actor.height * 0.1));
}
this._objInspector.actor.set_position(this.actor.x + Math.floor(this.actor.width * 0.1), this._targetY + Math.floor(this.actor.height * 0.1));
}
function _newLookingGlassOpen() {

View File

@@ -108,9 +108,9 @@ var taskbarActor = Utils.defineClass({
hupper = Math.floor(hupper);
scrollview._dtpFadeSize = hupper > hpageSize ? this._delegate.iconSize : 0;
if (this._delegate.panel.dynamicTransparency &&
this._currentBackgroundColor !== this._delegate.panel.dynamicTransparency.currentBackgroundColor) {
this._currentBackgroundColor = this._delegate.panel.dynamicTransparency.currentBackgroundColor;
if (this._delegate.dtpPanel.dynamicTransparency &&
this._currentBackgroundColor !== this._delegate.dtpPanel.dynamicTransparency.currentBackgroundColor) {
this._currentBackgroundColor = this._delegate.dtpPanel.dynamicTransparency.currentBackgroundColor;
let gradientStyle = 'background-gradient-start: ' + this._currentBackgroundColor +
'background-gradient-direction: ' + orientation;
@@ -161,7 +161,7 @@ var taskbar = Utils.defineClass({
Name: 'DashToPanel.Taskbar',
_init : function(panel) {
this.panel = panel;
this.dtpPanel = panel;
// start at smallest size due to running indicator drawing area expanding but not shrinking
this.iconSize = 16;
@@ -254,12 +254,12 @@ var taskbar = Utils.defineClass({
this._signalsHandler.add(
[
this.panel,
this.dtpPanel.panel.actor,
'notify::height',
() => this._queueRedisplay()
],
[
this.panel,
this.dtpPanel.panel.actor,
'notify::width',
() => this._queueRedisplay()
],
@@ -541,7 +541,7 @@ var taskbar = Utils.defineClass({
window: window,
isLauncher: isLauncher
},
this.panel,
this.dtpPanel,
{
setSizeManually: true,
showLabel: false,
@@ -747,8 +747,8 @@ var taskbar = Utils.defineClass({
},
sortAppsCompareFunction: function(appA, appB) {
return getAppStableSequence(appA, this.panel.monitor) -
getAppStableSequence(appB, this.panel.monitor);
return getAppStableSequence(appA, this.dtpPanel.monitor) -
getAppStableSequence(appB, this.dtpPanel.monitor);
},
getAppInfos: function() {
@@ -836,7 +836,7 @@ var taskbar = Utils.defineClass({
this._updateAppIcons();
// This will update the size, and the corresponding number for each icon on the primary panel
if (!this.panel.isSecondary) {
if (!this.dtpPanel.isSecondary) {
this._updateNumberOverlay();
}
@@ -849,7 +849,7 @@ var taskbar = Utils.defineClass({
_checkIfShowingFavorites: function() {
return Me.settings.get_boolean('show-favorites') &&
(!this.panel.isSecondary || Me.settings.get_boolean('show-favorites-all-monitors'));
(!this.dtpPanel.isSecondary || Me.settings.get_boolean('show-favorites-all-monitors'));
},
_getRunningApps: function() {
@@ -872,7 +872,7 @@ var taskbar = Utils.defineClass({
return apps.map(app => ({
app: app,
isLauncher: defaultIsLauncher || false,
windows: defaultWindows || AppIcons.getInterestingWindows(app, this.panel.monitor)
windows: defaultWindows || AppIcons.getInterestingWindows(app, this.dtpPanel.monitor)
.sort(sortWindowsCompareFunction)
}));
},
@@ -891,7 +891,7 @@ var taskbar = Utils.defineClass({
this._redisplay();
if (Panel.checkIfVertical()) {
this.showAppsButton.set_width(this.panel.geom.w);
this.showAppsButton.set_width(this.dtpPanel.geom.w);
this.previewMenu._updateClip();
}
},
@@ -1022,7 +1022,7 @@ var taskbar = Utils.defineClass({
let interestingWindows = {};
let getAppWindows = app => {
if (!interestingWindows[app]) {
interestingWindows[app] = AppIcons.getInterestingWindows(app, this.panel.monitor);
interestingWindows[app] = AppIcons.getInterestingWindows(app, this.dtpPanel.monitor);
}
let appWindows = interestingWindows[app]; //prevents "reference to undefined property Symbol.toPrimitive" warning
@@ -1128,12 +1128,12 @@ var taskbar = Utils.defineClass({
}
//temporarily use as primary the monitor on which the showapps btn was clicked
this.panel.panelManager.setFocusedMonitor(this.panel.monitor);
this.dtpPanel.panelManager.setFocusedMonitor(this.dtpPanel.monitor);
//reset the primary monitor when exiting the overview
let overviewHiddenId = Main.overview.connect('hidden', () => {
Main.overview.disconnect(overviewHiddenId);
this.panel.panelManager.setFocusedMonitor(this.panel.panelManager.primaryPanel.monitor, true);
this.dtpPanel.panelManager.setFocusedMonitor(this.dtpPanel.panelManager.primaryPanel.monitor, true);
});
// Finally show the overview

View File

@@ -37,10 +37,10 @@ var DynamicTransparency = Utils.defineClass({
this._windowOverlap = false;
this.currentBackgroundColor = 0;
this._initialPanelStyle = dtpPanel.get_style();
this._initialPanelStyle = dtpPanel.panel.actor.get_style();
if (this._dtpPanel._leftCorner) {
this._initialPanelCornerStyle = dtpPanel._leftCorner.actor.get_style();
if (this._dtpPanel.panel._leftCorner) {
this._initialPanelCornerStyle = dtpPanel.panel._leftCorner.actor.get_style();
}
this._signalsHandler = new Utils.GlobalSignalsHandler();
@@ -55,11 +55,11 @@ var DynamicTransparency = Utils.defineClass({
this._signalsHandler.destroy();
this._proximityManager.removeWatch(this._proximityWatchId);
this._dtpPanel.set_style(this._initialPanelStyle);
this._dtpPanel.panel.actor.set_style(this._initialPanelStyle);
if (this._dtpPanel._leftCorner) {
this._dtpPanel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
this._dtpPanel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
if (this._dtpPanel.panel._leftCorner) {
this._dtpPanel.panel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
this._dtpPanel.panel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
}
},
@@ -176,7 +176,7 @@ var DynamicTransparency = Utils.defineClass({
},
_updateComplementaryStyles: function() {
let panelThemeNode = this._dtpPanel.get_theme_node();
let panelThemeNode = this._dtpPanel.panel.actor.get_theme_node();
this._complementaryStyles = 'border-radius: ' + panelThemeNode.get_border_radius(0) + 'px;';
},
@@ -215,16 +215,16 @@ var DynamicTransparency = Utils.defineClass({
let transition = 'transition-duration:' + this.animationDuration;
let cornerStyle = '-panel-corner-background-color: ' + this.currentBackgroundColor + transition;
this._dtpPanel.bg.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles);
this._dtpPanel.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles);
if (this._dtpPanel._leftCorner) {
this._dtpPanel._leftCorner.actor.set_style(cornerStyle);
this._dtpPanel._rightCorner.actor.set_style(cornerStyle);
if (this._dtpPanel.panel._leftCorner) {
this._dtpPanel.panel._leftCorner.actor.set_style(cornerStyle);
this._dtpPanel.panel._rightCorner.actor.set_style(cornerStyle);
}
},
_setGradient: function() {
this._dtpPanel.set_style(
this._dtpPanel.panel.actor.set_style(
'background: none; ' +
'border-image: none; ' +
'background-image: none; ' +