mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Fix inert scrollview on secondary panels
This commit is contained in:
32
panel.js
32
panel.js
@@ -128,19 +128,14 @@ var dtpPanelWrapper = new Lang.Class({
|
||||
});
|
||||
|
||||
if (this.panel.vfunc_allocate) {
|
||||
let vfuncAllocate = (box, flags) => {
|
||||
//panel inherits from St.Widget, invoke its parent allocation
|
||||
St.Widget.prototype.vfunc_allocate.call(this.panel, box, flags);
|
||||
this._allocate(null, box, flags);
|
||||
};
|
||||
|
||||
this._panelConnectId = 0;
|
||||
|
||||
if (this.isSecondary) {
|
||||
this.panel.allocateProxy = vfuncAllocate;
|
||||
} else {
|
||||
this._oldAllocate = this.panel.__proto__.vfunc_allocate;
|
||||
this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', vfuncAllocate);
|
||||
if (!this.panel.__proto__._dtpOldAllocate) {
|
||||
this.panel.__proto__._dtpOldAllocate = this.panel.__proto__.vfunc_allocate;
|
||||
this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', (box, flags) => {
|
||||
this.panel.set_allocation(box, flags);
|
||||
this._allocate(null, box, flags)
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this._panelConnectId = this.panel.actor.connect('allocate', (actor,box,flags) => this._allocate(actor,box,flags));
|
||||
@@ -277,8 +272,9 @@ var dtpPanelWrapper = new Lang.Class({
|
||||
|
||||
if (this._panelConnectId) {
|
||||
this.panel.actor.disconnect(this._panelConnectId);
|
||||
} else if (this._oldAllocate) {
|
||||
this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', this._oldAllocate);
|
||||
} else if (this.panel.__proto__._dtpOldAllocate) {
|
||||
this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', this.panel.__proto__._dtpOldAllocate);
|
||||
delete this.panel.__proto__._dtpOldAllocate;
|
||||
}
|
||||
|
||||
if (this.startIntellihideId) {
|
||||
@@ -381,11 +377,11 @@ var dtpPanelWrapper = new Lang.Class({
|
||||
},
|
||||
|
||||
_adjustForOverview: function() {
|
||||
let isFocusedMonitor = Main.overview.viewSelector._workspacesDisplay._primaryIndex == this.monitor.index;
|
||||
let isFocusedMonitor = this.panelManager.checkIfFocusedMonitor(this.monitor);
|
||||
let isOverview = !!Main.overview.visibleTarget;
|
||||
let isShown = !isOverview || (isOverview && isFocusedMonitor);
|
||||
|
||||
this.panel.actor[isShown ? 'show' : 'hide']();
|
||||
this.panelBox[isShown ? 'show' : 'hide']();
|
||||
|
||||
if (isOverview && isFocusedMonitor) {
|
||||
Main.overview._overview.add_actor(this._myPanelGhost);
|
||||
@@ -735,10 +731,8 @@ var dtpSecondaryPanel = new Lang.Class({
|
||||
|
||||
},
|
||||
|
||||
vfunc_allocate: function(box, flags) {
|
||||
(this.allocateProxy || function(){})(box, flags);
|
||||
},
|
||||
|
||||
vfunc_allocate: function(box, flags) {},
|
||||
|
||||
_setPanelMenu: function(settingName, propName, constr, container, isInit) {
|
||||
if (isInit) {
|
||||
this._panelMenuSignalIds.push(this._dtpSettings.connect(
|
||||
|
||||
@@ -227,7 +227,7 @@ var dtpPanelManager = new Lang.Class({
|
||||
},
|
||||
|
||||
setFocusedMonitor: function(monitor, ignoreRelayout) {
|
||||
if (Main.overview.viewSelector._workspacesDisplay._primaryIndex != monitor.index) {
|
||||
if (!this.checkIfFocusedMonitor(monitor)) {
|
||||
Main.overview.viewSelector._workspacesDisplay._primaryIndex = monitor.index;
|
||||
|
||||
Main.overview._overview.clear_constraints();
|
||||
@@ -239,6 +239,10 @@ var dtpPanelManager = new Lang.Class({
|
||||
}
|
||||
},
|
||||
|
||||
checkIfFocusedMonitor: function(monitor) {
|
||||
return Main.overview.viewSelector._workspacesDisplay._primaryIndex == monitor.index;
|
||||
},
|
||||
|
||||
_reset: function() {
|
||||
this.disable(true);
|
||||
this.enable(true);
|
||||
@@ -357,7 +361,7 @@ var dtpPanelManager = new Lang.Class({
|
||||
},
|
||||
|
||||
_newGetShowAppsButton: function() {
|
||||
return this.allPanels.find(p => p.monitor.index == Main.overview.viewSelector._workspacesDisplay._primaryIndex).taskbar.showAppsButton;
|
||||
return this.allPanels.find(p => this.checkIfFocusedMonitor(p.monitor)).taskbar.showAppsButton;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ var ProximityWatch = new Lang.Class({
|
||||
|
||||
_init: function(actor, mode, xThreshold, yThreshold, handler) {
|
||||
this.actor = actor;
|
||||
this.overlap = 0;
|
||||
this.mode = mode;
|
||||
this.threshold = [xThreshold, yThreshold];
|
||||
this.handler = handler;
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#dashtopanelThumbnailScrollview,
|
||||
#dashtopanelScrollview {
|
||||
-st-hfade-offset: 48px;
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .app-well-app:hover .overview-icon,
|
||||
#dashtopanelScrollview .app-well-app:focus .overview-icon {
|
||||
background: none;
|
||||
|
||||
@@ -136,8 +136,8 @@ var taskbarActor = new Lang.Class({
|
||||
let destFadeOffset = hiddenAppIconsBoxWidth > 0 ? SCROLLVIEW_FADE_SIZE : 0;
|
||||
|
||||
if (destFadeOffset != this._fadeOffset) {
|
||||
scrollview.update_fade_effect(0, destFadeOffset);
|
||||
this._fadeOffset = destFadeOffset;
|
||||
scrollview.get_effect('fade').enabled = this._fadeOffset > 0;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user