Skip to content

Commit

Permalink
Merge pull request #107 from alex4401/master
Browse files Browse the repository at this point in the history
Fix compatibility with GNOME3.34
  • Loading branch information
p91paul authored Sep 24, 2019
2 parents 6591fc0 + 699d7c4 commit bcdcda0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions [email protected]/coverflowSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ Switcher.prototype = {
let compositor = this._windows[i].get_compositor_private();
if (compositor) {
let texture = compositor.get_texture();
let [width, height] = texture.get_size();
let width, height
if (texture.get_size) {
[width, height] = texture.get_size()
} else {
let preferred_size_ok
[preferred_size_ok, width, height] = texture.get_preferred_size();
}

let scale = 1.0;
let previewWidth = monitor.width * PREVIEW_SCALE;
Expand All @@ -82,7 +88,7 @@ Switcher.prototype = {

let clone = new Clutter.Clone({
opacity: (!metaWin.minimized && metaWin.get_workspace() == currentWorkspace || metaWin.is_on_all_workspaces()) ? 255 : 0,
source: texture,
source: texture.get_size ? texture : compositor,
reactive: true,
anchor_gravity: Clutter.Gravity.CENTER,
x: ((metaWin.minimized) ? 0 : compositor.x + compositor.width / 2) - monitor.x,
Expand Down
10 changes: 8 additions & 2 deletions [email protected]/timelineSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ Switcher.prototype = {
let compositor = this._windows[i].get_compositor_private();
if (compositor) {
let texture = compositor.get_texture();
let [width, height] = texture.get_size();
let width, height
if (texture.get_size) {
[width, height] = texture.get_size()
} else {
let preferred_size_ok
[preferred_size_ok, width, height] = texture.get_preferred_size();
}

let scale = 1.0;
let previewWidth = monitor.width * PREVIEW_SCALE;
Expand All @@ -70,7 +76,7 @@ Switcher.prototype = {

let clone = new Clutter.Clone({
opacity: (!metaWin.minimized && metaWin.get_workspace() == currentWorkspace || metaWin.is_on_all_workspaces()) ? 255 : 0,
source: texture,
source: texture.get_size ? texture : compositor,
reactive: true,
anchor_gravity: Clutter.Gravity.WEST,
rotation_angle_y: 12,
Expand Down

0 comments on commit bcdcda0

Please sign in to comment.