diff --git a/metadata.json b/metadata.json index 149a1e5..b427d57 100644 --- a/metadata.json +++ b/metadata.json @@ -3,8 +3,7 @@ "description" : "Bringing back vertically stacked workspaces", "original-author": "rens.althuis@gmail.com", "shell-version" : [ - "40", - "41" + "42" ], "url" : "", "uuid" : "vertical-overview@RensAlthuis.github.com", diff --git a/overviewControls.js b/overviewControls.js index 6b6f6f9..77a2a67 100644 --- a/overviewControls.js +++ b/overviewControls.js @@ -120,8 +120,9 @@ function exitOverviewAnimation() { } var ControlsManagerLayoutOverride = { - _computeWorkspacesBoxForState: function (state, box, startY, searchHeight, leftOffset, rightOffset) { - const workspaceBox = box.copy(); + _computeWorkspacesBoxForState(state, workAreaBox, searchHeight, dashHeight, thumbnailsHeight) { + const workspaceBox = workAreaBox.copy(); + const [startX, startY] = workAreaBox.get_origin(); const [width, height] = workspaceBox.get_size(); const { spacing } = this; const { expandFraction } = this._workspacesThumbnails; @@ -141,10 +142,10 @@ var ControlsManagerLayoutOverride = { case ControlsState.WINDOW_PICKER: case ControlsState.APP_GRID: workspaceBox.set_origin( - leftOffset + spacing, + this.leftOffset + spacing, startY + searchHeight + spacing * expandFraction); workspaceBox.set_size( - width - leftOffset - rightOffset - (spacing * 2), + width - this.leftOffset - this.rightOffset - (spacing * 2), height - startY - (searchHeight + spacing * expandFraction) * 2); break; } @@ -152,18 +153,19 @@ var ControlsManagerLayoutOverride = { return workspaceBox; }, - _getAppDisplayBoxForState: function(state, box, startY, searchHeight) { - const [width, height] = box.get_size(); + _getAppDisplayBoxForState(state, workAreaBox, searchHeight, dashHeight, appGridBox) { + const [startX, startY] = workAreaBox.get_origin(); + const [width, height] = workAreaBox.get_size(); const appDisplayBox = new Clutter.ActorBox(); const { spacing } = this; switch (state) { case ControlsState.HIDDEN: case ControlsState.WINDOW_PICKER: - appDisplayBox.set_origin(0, box.y2); + appDisplayBox.set_origin(startX, workAreaBox.y2); break; case ControlsState.APP_GRID: - appDisplayBox.set_origin(0, + appDisplayBox.set_origin(startX, startY + searchHeight + spacing); break; } diff --git a/util.js b/util.js index 1eb42dd..5def5ea 100644 --- a/util.js +++ b/util.js @@ -14,7 +14,7 @@ function overrideProto(proto, overrides) { for (var symbol in overrides) { if (symbol.startsWith('after_')) { - const actualSymbol = symbol.substr('after_'.length); + const actualSymbol = symbol.slice('after_'.length); const fn = proto[actualSymbol]; const afterFn = overrides[symbol] proto[actualSymbol] = function() { @@ -28,7 +28,7 @@ function overrideProto(proto, overrides) { else { backup[symbol] = proto[symbol]; if (symbol.startsWith('vfunc')) { - hookVfunc(proto, symbol.substr(6), overrides[symbol]); + hookVfunc(proto[Gi.gobject_prototype_symbol], symbol.slice(6), overrides[symbol]); } else { proto[symbol] = overrides[symbol]; diff --git a/workspacesView.js b/workspacesView.js index c8813ee..5b60d99 100644 --- a/workspacesView.js +++ b/workspacesView.js @@ -15,7 +15,9 @@ const Util = Self.imports.util; function override() { global.vertical_overview.GSFunctions['WorkspacesView'] = Util.overrideProto(WorkspacesView.WorkspacesView.prototype, WorkspacesViewOverride); - log('You may see an error below,\nSecondaryMonitorDisplay is defined as const for some reason.\nSince I\'m overriding values in that const an error show might show up.\n Feel free to ignore it'); + log('You may see an error below,\nSecondaryMonitorDisplay is defined as const for some reason\nSince I\'m overriding values in that const an error show might show up.\n Feel free to ignore it'); + SecondaryMonitorDisplay = WorkspacesView.SecondaryMonitorDisplay; + global.vertical_overview.GSFunctions['SecondaryMonitorDisplay'] = Util.overrideProto(WorkspacesView.SecondaryMonitorDisplay.prototype, SecondaryMonitorDisplayOverride); log('Thank you, please carry on');