Home > Technology > Force zoomed workspaces in GNOME 3.2

Force zoomed workspaces in GNOME 3.2

October 7, 2011

I jumped the gun and updated to Fedora 16 in beta, which comes with GNOME 3.2 as well.  With that comes a tweaked extension interface, so my prior hack needs modification.  I do notice the new behavior that Florian mentioned last time, where the workspaces display now only hides if just one workspace is in use.  So my previous annoyance is not so bad anymore, but I’ve grown accustomed having it always-zoomed, no matter what.  Same as before, put these in ~/.local/share/gnome-shell/extensions/zoomWorkspacesDisplay@cuviper.com/:

metadata.json :

{
    "shell-version": ["3.2"],
    "uuid": "zoomWorkspacesDisplay@cuviper.com",
    "name": "Zoom Workspaces Display",
    "description": "Forces the workspaces display to always be zoomed",
    "url": "https://blog.cuviper.com/",
    "original-authors": "Josh Stone"
}

extension.js :

const Overview = imports.ui.main.overview;
const WorkspacesView = imports.ui.workspacesView;

function init(metadata) {}

let _saved_updateAlwaysZoom;

function enable() {
    let p = WorkspacesView.WorkspacesDisplay.prototype;
    _saved_updateAlwaysZoom = p._updateAlwaysZoom;
    p._updateAlwaysZoom = function() {
        this._alwaysZoomOut = true;
    };
    Overview._workspacesDisplay._alwaysZoomOut = true;
}

function disable() {
    let p = WorkspacesView.WorkspacesDisplay.prototype;
    p._updateAlwaysZoom = _saved_updateAlwaysZoom;
    Overview._workspacesDisplay._alwaysZoomOut = false;
    Overview._workspacesDisplay._updateAlwaysZoom();
}

I’m throwing it up on github too. If I need any more tweaks, I’ll just push there rather than blogging about it.

Advertisement
%d bloggers like this: