diff --git a/src/panel.js b/src/panel.js index a0558b0..1d62d69 100644 --- a/src/panel.js +++ b/src/panel.js @@ -1146,7 +1146,7 @@ export const Panel = GObject.registerClass( } if (actor instanceof St.BoxLayout) { - actor.vertical = isVertical + Utils.setBoxLayoutVertical(actor, isVertical) } else if ( actor != this.statusArea.appMenu && ((actor._delegate || actor) instanceof PanelMenu.ButtonBox || diff --git a/src/taskbar.js b/src/taskbar.js index 8107945..ed86bdc 100644 --- a/src/taskbar.js +++ b/src/taskbar.js @@ -535,6 +535,7 @@ export const Taskbar = class extends EventEmitter { _updateIconAnimations(pointerX, pointerY) { this._iconAnimationTimestamp = Date.now() let type = iconAnimationSettings.type + let vertical = this.dtpPanel.checkIfVertical() if (!pointerX || !pointerY) [pointerX, pointerY] = global.get_pointer() @@ -542,10 +543,8 @@ export const Taskbar = class extends EventEmitter { let [x, y] = item.get_transformed_position() let [width, height] = item.get_transformed_size() let [centerX, centerY] = [x + width / 2, y + height / 2] - let size = this._box.vertical ? height : width - let difference = this._box.vertical - ? pointerY - centerY - : pointerX - centerX + let size = vertical ? height : width + let difference = vertical ? pointerY - centerY : pointerX - centerX let distance = Math.abs(difference) let maxDistance = (iconAnimationSettings.extent / 2) * size diff --git a/src/utils.js b/src/utils.js index 53e4c76..6ee92a2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -182,15 +182,23 @@ export const TimeoutsHandler = class extends BasicHandler { } export function createBoxLayout(options) { - if (options && Config.PACKAGE_VERSION >= '48') { - // https://mutter.gnome.org/clutter/enum.Orientation.html - options.orientation = options.vertical ? 1 : 0 + if (options && 'vertical' in options) { + let vertical = options.vertical + delete options.vertical + setBoxLayoutVertical(options, vertical) } return new St.BoxLayout(options) } +export function setBoxLayoutVertical(box, vertical) { + if (Config.PACKAGE_VERSION >= '48') + // https://mutter.gnome.org/clutter/enum.Orientation.html + box.orientation = vertical ? 1 : 0 + else box.vertical = vertical +} + // This is wrapper to maintain compatibility with GNOME-Shell 3.30+ as well as // previous versions. export const DisplayWrapper = {