Skip to content

Commit

Permalink
Merge pull request #29 from p91paul/gs-3.14
Browse files Browse the repository at this point in the history
Provide compatibility for gnome-shell 3.14
  • Loading branch information
dmo60 committed Oct 29, 2014
2 parents b3d6870 + 606cc79 commit c22c771
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CoverflowAltTab@dmo60.de/extension.js
Expand Up @@ -41,8 +41,11 @@ function enable() {
else
platform = new Platform.PlatformCinnamon18();
keybinder = HAS_META_KEYBIND_API ? new Keybinder.KeybinderNewApi() : new Keybinder.KeybinderOldApi();
} else {
if(parseInt(PACKAGE_VERSION.split(".")[1]) >= 10 && PACKAGE_VERSION >= "3.10.0") {
} else {
if(parseInt(PACKAGE_VERSION.split(".")[1]) >= 14 && PACKAGE_VERSION >= "3.14.0") {
platform = new Platform.PlatformGnomeShell314();
keybinder = new Keybinder.KeybinderNewGSApi();
} else if(parseInt(PACKAGE_VERSION.split(".")[1]) >= 10 && PACKAGE_VERSION >= "3.10.0") {
platform = new Platform.PlatformGnomeShell310();
keybinder = new Keybinder.KeybinderNewGSApi();
} else if(PACKAGE_VERSION >= "3.8.0") {
Expand Down
2 changes: 1 addition & 1 deletion CoverflowAltTab@dmo60.de/metadata.json
@@ -1,6 +1,6 @@
{
"cinnamon-version": ["1.2", "1.4", "1.6", "1.8"],
"shell-version": ["3.4", "3.6", "3.8", "3.10", "3.12"],
"shell-version": ["3.4", "3.6", "3.8", "3.10", "3.12", "3.14"],
"uuid": "CoverflowAltTab@dmo60.de",
"name": "Coverflow Alt-Tab",
"description": "Replacement of Alt-Tab, iterates through windows in a cover-flow manner.",
Expand Down
62 changes: 61 additions & 1 deletion CoverflowAltTab@dmo60.de/platform.js
Expand Up @@ -439,7 +439,6 @@ PlatformGnomeShell310.prototype = {
let backgrounds = this._backgroundGroup.get_children();
for (let i = 0; i < backgrounds.length; i++) {
let background = backgrounds[i]._delegate;

Tweener.addTween(background,
{ brightness: this.getSettings().dim_factor,
time: this.getSettings().animation_time,
Expand All @@ -454,7 +453,67 @@ PlatformGnomeShell310.prototype = {
let backgrounds = this._backgroundGroup.get_children();
for (let i = 0; i < backgrounds.length; i++) {
let background = backgrounds[i]._delegate;
Tweener.addTween(background,
{ brightness: 1.0,
time: this.getSettings().animation_time,
transition: TRANSITION_TYPE,
onComplete: onCompleteBind,
});
}
},

removeBackground: function() {
Main.uiGroup.remove_child(this._backgroundGroup);
}
};



function PlatformGnomeShell314() {
this._init.apply(this, arguments);
}

PlatformGnomeShell314.prototype = {
__proto__: PlatformGnomeShell.prototype,

_init: function() {
PlatformGnomeShell.prototype._init.apply(this, arguments);
},

getPrimaryModifier: function(mask) {
return imports.ui.switcherPopup.primaryModifier(mask);
},

initBackground: function() {
let Background = imports.ui.background;

this._backgroundGroup = new Meta.BackgroundGroup();
Main.uiGroup.add_child(this._backgroundGroup);
this._backgroundGroup.lower_bottom();
this._backgroundGroup.hide();
for (let i = 0; i < Main.layoutManager.monitors.length; i++) {
new Background.BackgroundManager({ container: this._backgroundGroup,
monitorIndex: i, });
}
},

dimBackground: function() {
this._backgroundGroup.show();
let backgrounds = this._backgroundGroup.get_children();
for (let i = 0; i < backgrounds.length; i++) {
let background = backgrounds[i];
Tweener.addTween(background,
{ brightness: this.getSettings().dim_factor,
time: this.getSettings().animation_time,
transition: TRANSITION_TYPE
});
}
},

undimBackground: function(onCompleteBind) {
let backgrounds = this._backgroundGroup.get_children();
for (let i = 0; i < backgrounds.length; i++) {
let background = backgrounds[i];
Tweener.addTween(background,
{ brightness: 1.0,
time: this.getSettings().animation_time,
Expand All @@ -468,3 +527,4 @@ PlatformGnomeShell310.prototype = {
Main.uiGroup.remove_child(this._backgroundGroup);
}
};

0 comments on commit c22c771

Please sign in to comment.