[gnome-shell-extensions] native-window-placement: remove grid positioning strategy



commit 9b630b387cb81731679de675ff42ede12eb18490
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Dec 20 19:00:13 2011 +0100

    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.

 extensions/native-window-placement/extension.js    |   43 +-------------------
 ...tensions.native-window-placement.gschema.xml.in |   10 -----
 2 files changed, 1 insertions(+), 52 deletions(-)
---
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index 0772ee4..d3721e0 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() {
@@ -305,25 +293,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:
      *  INITIAL - this is the initial positioning of the windows.
@@ -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 873bfd7..cf76399 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 @@
 <schemalist gettext-domain="gnome-shell-extensions">
-  <enum id="org.gnome.shell.extensions.native-window-placement.strategy">
-    <value nick="natural" value="0" />
-    <value nick="grid" value="1" />
-  </enum>
   <schema id="org.gnome.shell.extensions.native-window-placement" path="/org/gnome/shell/extensions/native-window-placement/">
-    <key name="strategy" enum="org.gnome.shell.extensions.native-window-placement.strategy">
-      <default>'natural'</default>
-      <_summary>Window placement strategy</_summary>
-      <_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</_description>
-    </key>
     <key name="use-more-screen" type="b">
       <default>true</default>
       <_summary>Use more screen for windows</_summary>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]