mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Set clipping container on panel creation
This commit is contained in:
@@ -90,7 +90,7 @@ var Intellihide = Utils.defineClass({
|
||||
|
||||
if (Me.settings.get_boolean('intellihide-hide-from-windows')) {
|
||||
this._proximityWatchId = this._proximityManager.createWatch(
|
||||
this._clipContainer,
|
||||
this._panelBox.get_parent(),
|
||||
Proximity.Mode[Me.settings.get_string('intellihide-behaviour')],
|
||||
0, 0,
|
||||
overlap => {
|
||||
@@ -208,30 +208,17 @@ var Intellihide = Utils.defineClass({
|
||||
},
|
||||
|
||||
_setTrackPanel: function(enable) {
|
||||
Main.layoutManager._untrackActor(this._panelBox);
|
||||
|
||||
if (enable) {
|
||||
this._clipContainer = new Clutter.Actor();
|
||||
Utils.setClip(this._clipContainer, this._panelBox.x, this._panelBox.y, this._panelBox.width, this._panelBox.height);
|
||||
|
||||
Main.layoutManager.removeChrome(this._panelBox);
|
||||
Main.layoutManager.addChrome(this._clipContainer, { affectsInputRegion: false });
|
||||
let trackedIndex = Main.layoutManager._findActor(this._panelBox);
|
||||
let actorData = Main.layoutManager._trackedActors[trackedIndex]
|
||||
|
||||
this._clipContainer.add_child(this._panelBox);
|
||||
Main.layoutManager.trackChrome(this._panelBox, { affectsInputRegion: true });
|
||||
actorData.affectsStruts = !enable;
|
||||
actorData.trackFullscreen = !enable;
|
||||
|
||||
this._timeoutsHandler.add([T4, 0, () => this._panelBox.set_position(0, 0)]);
|
||||
} else {
|
||||
this._panelBox.set_position(this._clipContainer.x, this._clipContainer.y);
|
||||
Main.layoutManager.removeChrome(this._clipContainer);
|
||||
|
||||
this._clipContainer.remove_child(this._panelBox);
|
||||
Main.layoutManager.addChrome(this._panelBox, { affectsStruts: true, trackFullscreen: true });
|
||||
}
|
||||
|
||||
this._panelBox.track_hover = enable;
|
||||
this._panelBox.reactive = enable;
|
||||
this._panelBox.visible = enable ? enable : this._panelBox.visible;
|
||||
|
||||
Main.layoutManager._queueUpdateRegions();
|
||||
},
|
||||
|
||||
_setRevealMechanism: function() {
|
||||
|
||||
2
panel.js
2
panel.js
@@ -776,7 +776,7 @@ var dtpPanel = Utils.defineClass({
|
||||
},
|
||||
|
||||
_setPanelPosition: function() {
|
||||
let container = this.intellihide && this.intellihide.enabled ? this.panelBox.get_parent() : this.panelBox;
|
||||
let container = this.panelBox.get_parent();
|
||||
|
||||
this.set_size(this.geom.w, this.geom.h);
|
||||
container.set_position(this.geom.x, this.geom.y);
|
||||
|
||||
@@ -235,13 +235,22 @@ var dtpPanelManager = Utils.defineClass({
|
||||
|
||||
p.disable();
|
||||
|
||||
let clipContainer = p.panelBox.get_parent();
|
||||
|
||||
Main.layoutManager._untrackActor(p.panelBox);
|
||||
Main.layoutManager.removeChrome(clipContainer);
|
||||
|
||||
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);
|
||||
|
||||
p.panelBox.set_position(clipContainer.x, clipContainer.y);
|
||||
|
||||
clipContainer.remove_child(p.panelBox);
|
||||
Main.layoutManager.addChrome(p.panelBox, { affectsStruts: true, trackFullscreen: true });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -319,20 +328,29 @@ var dtpPanelManager = Utils.defineClass({
|
||||
_createPanel: function(monitor, isSecondary) {
|
||||
let panelBox;
|
||||
let panel;
|
||||
|
||||
let clipContainer = new Clutter.Actor();
|
||||
|
||||
if (isSecondary) {
|
||||
panelBox = new St.BoxLayout({ name: 'panelBox' });
|
||||
Main.layoutManager.addChrome(panelBox, { affectsStruts: true, trackFullscreen: true });
|
||||
} else {
|
||||
panelBox = Main.layoutManager.panelBox;
|
||||
Main.layoutManager._untrackActor(panelBox);
|
||||
panelBox.remove_child(Main.panel.actor);
|
||||
Main.layoutManager.removeChrome(panelBox);
|
||||
}
|
||||
|
||||
Main.layoutManager.addChrome(clipContainer, { affectsInputRegion: false });
|
||||
clipContainer.add_child(panelBox);
|
||||
Main.layoutManager.trackChrome(panelBox, { trackFullscreen: true, affectsStruts: true, affectsInputRegion: true });
|
||||
|
||||
panel = new Panel.dtpPanel(this, monitor, panelBox, isSecondary);
|
||||
panelBox.add(panel);
|
||||
|
||||
panel.enable();
|
||||
|
||||
panelBox.visible = !monitor.inFullscreen;
|
||||
panelBox.set_position(0, 0);
|
||||
|
||||
Utils.setClip(clipContainer, clipContainer.x, clipContainer.y, panelBox.width, panelBox.height);
|
||||
|
||||
return panel;
|
||||
},
|
||||
|
||||
@@ -133,7 +133,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
let threshold = Me.settings.get_int('trans-dynamic-distance');
|
||||
|
||||
this._proximityWatchId = this._proximityManager.createWatch(
|
||||
this._dtpPanel.panelBox,
|
||||
this._dtpPanel.panelBox.get_parent(),
|
||||
Proximity.Mode[Me.settings.get_string('trans-dynamic-behavior')],
|
||||
isVertical ? threshold : 0,
|
||||
isVertical ? 0 : threshold,
|
||||
|
||||
Reference in New Issue
Block a user