diff --git a/tiling-assistant@leleat-on-github/metadata.json b/tiling-assistant@leleat-on-github/metadata.json index 88e7e39..ed4d286 100644 --- a/tiling-assistant@leleat-on-github/metadata.json +++ b/tiling-assistant@leleat-on-github/metadata.json @@ -3,7 +3,8 @@ "name": "Tiling Assistant", "shell-version": [ "48", - "49" + "49", + "50" ], "url": "https://github.com/Leleat/Tiling-Assistant", "uuid": "tiling-assistant@leleat-on-github", diff --git a/tiling-assistant@leleat-on-github/src/common.js b/tiling-assistant@leleat-on-github/src/common.js index b98da75..198f65d 100644 --- a/tiling-assistant@leleat-on-github/src/common.js +++ b/tiling-assistant@leleat-on-github/src/common.js @@ -3,6 +3,8 @@ * *and* prefs files */ +import { Meta } from './dependencies/gi.js'; + /** * A Singleton providing access to the settings. */ @@ -321,3 +323,8 @@ var LayoutItem = class LayoutItem { this.loopType = null; } }; + +export function is_wayland_compositor() { + return Meta.is_wayland_compositor === undefined || + Meta.is_wayland_compositor(); +} diff --git a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js index 21bba34..37b5198 100644 --- a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js +++ b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js @@ -2,7 +2,7 @@ import { Clutter, GLib, GObject, Gio, Meta, Mtk } from '../dependencies/gi.js'; import { Main, WindowManager } from '../dependencies/shell.js'; import { WINDOW_ANIMATION_TIME } from '../dependencies/unexported/windowManager.js'; -import { Orientation, MoveModes, Settings } from '../common.js'; +import { Orientation, MoveModes, Settings, is_wayland_compositor } from '../common.js'; import { Rect, Util } from './utility.js'; import { TilingWindowManager as Twm } from './tilingWindowManager.js'; @@ -319,7 +319,7 @@ export default class TilingMoveHandler { const altL = Clutter.ModifierType.MOD1_MASK; const altGr = Clutter.ModifierType.MOD5_MASK; const meta = Clutter.ModifierType.MOD4_MASK; - const rmb = Meta.is_wayland_compositor() + const rmb = is_wayland_compositor() ? Clutter.ModifierType.BUTTON2_MASK : Clutter.ModifierType.BUTTON3_MASK; const pressed = [ // idxs come from settings diff --git a/tiling-assistant@leleat-on-github/src/extension/tilingPopup.js b/tiling-assistant@leleat-on-github/src/extension/tilingPopup.js index e43183e..c693800 100644 --- a/tiling-assistant@leleat-on-github/src/extension/tilingPopup.js +++ b/tiling-assistant@leleat-on-github/src/extension/tilingPopup.js @@ -1,8 +1,8 @@ -import { Clutter, GObject, Meta, St } from '../dependencies/gi.js'; +import { Clutter, GObject, St } from '../dependencies/gi.js'; import { Main } from '../dependencies/shell.js'; import * as SwitcherPopup from '../dependencies/unexported/switcherPopup.js'; -import { Direction, Orientation } from '../common.js'; +import { Direction, Orientation, is_wayland_compositor } from '../common.js'; import { Util } from './utility.js'; import { TilingWindowManager as Twm } from './tilingWindowManager.js'; import * as AltTab from './altTab.js'; @@ -52,7 +52,7 @@ export const TilingSwitcherPopup = GObject.registerClass({ // Destroy popup when touching outside of popup this.connect('touch-event', () => { - if (Meta.is_wayland_compositor()) + if (is_wayland_compositor()) this.fadeAndDestroy(); return Clutter.EVENT_PROPAGATE;