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.
This commit is contained in:
@@ -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;
|
||||
|
||||
-10
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user