Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let touchpadSettings;
export function enable(extension) {
signals = new Utils.Signals();
// Touchpad swipes only works in Wayland
if (!Meta.is_wayland_compositor())
if (!Utils.is_wayland_compositor())
return;

touchpadSettings = new Gio.Settings({
Expand Down
2 changes: 1 addition & 1 deletion patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function enable(extension) {
// save the last display server used
gsettings.set_string(
'last-used-display-server',
Meta.is_wayland_compositor() ? "Wayland" : "Xorg"
Utils.is_wayland_compositor() ? "Wayland" : "Xorg"
);

mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
Expand Down
4 changes: 2 additions & 2 deletions stackoverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export class StackOverlay {
return bail(); // Should normally have a neighbour. Bail!

let width = neighbour.clone.targetX + space.targetX - minResizeEdge;
if (space.isPlaceable(metaWindow) || Meta.is_wayland_compositor())
if (space.isPlaceable(metaWindow) || Utils.is_wayland_compositor())
width = Math.min(width, 1);
overlay.x = this.monitor.x;
overlay.width = Math.max(width, 1);
Expand All @@ -464,7 +464,7 @@ export class StackOverlay {
let frame = neighbour.get_frame_rect();
frame.x = neighbour.clone.targetX + space.targetX;
let width = this.monitor.width - (frame.x + frame.width) - minResizeEdge;
if (space.isPlaceable(metaWindow) || Meta.is_wayland_compositor())
if (space.isPlaceable(metaWindow) || Utils.is_wayland_compositor())
width = 1;
width = Math.max(width, 1);
overlay.x = this.monitor.x + this.monitor.width - width;
Expand Down
6 changes: 3 additions & 3 deletions tiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ export class Space extends Array {

this.fixOverlays();

if (!Meta.is_wayland_compositor()) {
if (!Utils.is_wayland_compositor()) {
// See startAnimate
Main.layoutManager.untrackChrome(this.background);
}
Expand Down Expand Up @@ -1463,7 +1463,7 @@ export class Space extends Array {
}

startAnimate() {
if (!this._isAnimating && !Meta.is_wayland_compositor()) {
if (!this._isAnimating && !Utils.is_wayland_compositor()) {
// Tracking the background fixes issue #80
// It also let us activate window clones clicked during animation
// Untracked in moveDone
Expand Down Expand Up @@ -3162,7 +3162,7 @@ export const Spaces = class Spaces extends Map {
// Fixes a weird bug where mouse input stops
// working after mousing to another monitor on
// X11.
if (!Meta.is_wayland_compositor()) {
if (!Utils.is_wayland_compositor()) {
to.startAnimate();
}

Expand Down
7 changes: 7 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ export function setBackgroundImage(actor, resource_path) {
actor.content_repeat = Clutter.ContentRepeat.BOTH;
}

export function is_wayland_compositor() {
if (typeof Meta.is_wayland_compositor === 'function')
return Meta.is_wayland_compositor()
else
return true // GNOME 50+ is always a Wayland compositor
}

/**
* Backwards compatible function. Attempts to use Cogl.Color with a fallback
* to Clutter.Color.
Expand Down
Loading