From 9b630b387cb81731679de675ff42ede12eb18490 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 20 Dec 2011 19:00:13 +0100 Subject: [PATCH] native-window-placement: remove grid positioning strategy If one wants the extension, clearly he doesn't want the default layout of windows, therefore it doesn't make sense to replicate it and to keep settings for it. --- .../native-window-placement/extension.js | 43 +------------------ ...ons.native-window-placement.gschema.xml.in | 10 ----- 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 0772ee4b..d3721e09 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -20,11 +20,6 @@ const Tweener = imports.ui.tweener; const Workspace = imports.ui.workspace; const WindowPositionFlags = Workspace.WindowPositionFlags; -const WindowPlacementStrategy = { - NATURAL: 0, - GRID: 1, -}; - let _me, _metadata; // testing settings for natural window placement strategy: @@ -112,7 +107,6 @@ let winInjections, workspaceInjections, connectedSignals; function resetState() { winInjections = { }; workspaceInjections = { }; - workViewInjections = { }; connectedSignals = [ ]; } @@ -120,12 +114,6 @@ function enable() { resetState(); let settings = _me.convenience.getSettings(_metadata, 'native-window-placement'); - let placementStrategy = settings.get_enum('strategy'); - let signalId = settings.connect('changed::strategy', function() { - placementStrategy = settings.get_enum('strategy'); - // we don't update immediately, we wait for a relayout - // (and hope for the best) - }); connectedSignals.push({ obj: settings, id: signalId }); let useMoreScreen = settings.get_boolean('use-more-screen'); signalId = settings.connect('changed::use-more-screen', function() { @@ -304,25 +292,6 @@ function enable() { } workspaceInjections['_calculateWindowTransformationsNatural'] = undefined; - /** - * _calculateWindowTransformationsGrid: - * @clones: Array of #MetaWindow - * - * Returns clones with matching target coordinates and scales to arrange windows in a grid. - */ - Workspace.Workspace.prototype._calculateWindowTransformationsGrid = function(clones) { - let slots = this._computeAllWindowSlots(clones.length); - clones = this._orderWindowsByMotionAndStartup(clones, slots); - let targets = []; - - for (let i = 0; i < clones.length; i++) { - targets[i] = this._computeWindowLayout(clones[i].metaWindow, slots[i]); - } - - return [clones, targets]; - } - workspaceInjections['_calculateWindowTransformationsGrid'] = undefined; - /** * positionWindows: * @flags: @@ -347,17 +316,7 @@ function enable() { let targets = []; let scales = []; - switch (placementStrategy) { - case WindowPlacementStrategy.NATURAL: - [clones, targets] = this._calculateWindowTransformationsNatural(clones); - break; - default: - log ('Invalid window placement strategy'); - placementStrategy = WindowPlacementStrategy.GRID; - case WindowPlacementStrategy.GRID: - [clones, targets] = this._calculateWindowTransformationsGrid(clones); - break; - } + [clones, targets] = this._calculateWindowTransformationsNatural(clones); let currentWorkspace = global.screen.get_active_workspace(); let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace; diff --git a/extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in b/extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in index 873bfd7b..cf763995 100644 --- a/extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in +++ b/extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in @@ -1,15 +1,5 @@ - - - - - - 'natural' - <_summary>Window placement strategy - <_description>The algorithm used to layout thumbnails in the overview. 'grid' to use the default grid based algorithm, - 'natural' to use another one that reflects more the position and size of the actual window - true <_summary>Use more screen for windows