Skip to content

Commit

Permalink
Merge pull request #101 from 13r0ck/gnome-41.3
Browse files Browse the repository at this point in the history
Fix gnome 41.3 & 42 (pop & ubuntu 22.04)
  • Loading branch information
RensAlthuis authored Apr 10, 2022
2 parents e326269 + a99a123 commit 564dc75
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"description" : "Bringing back vertically stacked workspaces",
"original-author": "[email protected]",
"shell-version" : [
"40",
"41"
"42"
],
"url" : "",
"uuid" : "[email protected]",
Expand Down
18 changes: 10 additions & 8 deletions overviewControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -141,29 +142,30 @@ 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;
}

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;
}
Expand Down
4 changes: 2 additions & 2 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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];
Expand Down
4 changes: 3 additions & 1 deletion workspacesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 564dc75

Please sign in to comment.