Skip to content

Commit

Permalink
Fix some backward compatibility issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
spin83 committed May 1, 2020
1 parent 9865f9c commit 9c163b1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
8 changes: 4 additions & 4 deletions multi-monitors-add-on@spin83/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const Main = imports.ui.main;

const WorkspacesView = imports.ui.workspacesView;

const Config = imports.misc.config;
const GNOME_SHELL_VERSION = Config.PACKAGE_VERSION.split('.');

const ExtensionUtils = imports.misc.extensionUtils;
const MultiMonitors = ExtensionUtils.getCurrentExtension();
const Convenience = MultiMonitors.imports.convenience;
Expand All @@ -32,15 +35,12 @@ const MMLayout = MultiMonitors.imports.mmlayout;
const MMOverview = MultiMonitors.imports.mmoverview;
const MMIndicator = MultiMonitors.imports.indicator;

const Config = imports.misc.config;

const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides';
const MUTTER_SCHEMA = 'org.gnome.mutter';
const WORKSPACES_ONLY_ON_PRIMARY_ID = 'workspaces-only-on-primary';

const SHOW_INDICATOR_ID = 'show-indicator';
const SHOW_THUMBNAILS_SLIDER_ID = 'show-thumbnails-slider';
const GNOME_SHELL_VERSION = Config.PACKAGE_VERSION.split('.');

function copyClass (s, d) {
// global.log(s.name +" > "+ d.name);
Expand Down Expand Up @@ -158,7 +158,7 @@ const MultiMonitorsAddOn = new Lang.Class({
Main.overview.viewSelector._workspacesPage.destroy();
workspacesDisplay.actor = null;

workspacesDisplay = new WorkspacesView.WorkspacesDisplay34();
workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
Main.overview.viewSelector._workspacesDisplay = workspacesDisplay;
Main.overview.viewSelector._workspacesPage = Main.overview.viewSelector._addPage(workspacesDisplay.actor,
_("Windows"), 'focus-windows-symbolic');
Expand Down
2 changes: 1 addition & 1 deletion multi-monitors-add-on@spin83/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var MultiMonitorsIndicator = (() => {

this._mmStatusIcon = new St.BoxLayout({ style_class: 'multimonitor-status-indicators-box' });
this._mmStatusIcon.hide();
if (MultiMonitors.gnomeShellVersion()[1]<36) {
if (MultiMonitors.gnomeShellVersion()[1]<34) {
this.actor.add_child(this._mmStatusIcon);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion multi-monitors-add-on@spin83/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"gettext-domain": "multi-monitors-add-on",
"description": "Add multiple monitors overview and panel for gnome-shell.",
"url": "https://github.com/spin83/multi-monitors-add-on.git",
"version": 19.2
"version": 19.3
}
4 changes: 4 additions & 0 deletions multi-monitors-add-on@spin83/mmcalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Signals.addSignalMethods(MultiMonitorsCalendar34.prototype);
MultiMonitors.copyClass(Calendar.Calendar, MultiMonitorsCalendar34);

var MultiMonitorsEventsSection = (() => {
if (MultiMonitors.gnomeShellVersion()[1]<36)
return null;
let MultiMonitorsEventsSection = class MultiMonitorsEventsSection extends MessageList.MessageListSection {
_init() {
super._init();
Expand Down Expand Up @@ -173,6 +175,8 @@ const MultiMonitorsEventsSection34 = class MultiMonitorsEventsSection34 extends
MultiMonitors.copyClass(Calendar.EventsSection, MultiMonitorsEventsSection34);

var MultiMonitorsNotificationSection = (() => {
if (MultiMonitors.gnomeShellVersion()[1]<36)
return null;
let MultiMonitorsNotificationSection = class MultiMonitorsNotificationSection extends MessageList.MessageListSection {
_init() {
super._init();
Expand Down
12 changes: 11 additions & 1 deletion multi-monitors-add-on@spin83/mmoverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ const ViewSelector = imports.ui.viewSelector;
const LayoutManager = imports.ui.layout;
const Background = imports.ui.background;
const WorkspacesView = imports.ui.workspacesView;
const SwipeTracker = imports.ui.swipeTracker;
let SwipeTracker = null;

const ExtensionUtils = imports.misc.extensionUtils;
const CE = ExtensionUtils.getCurrentExtension();
const MultiMonitors = CE.imports.extension;
const Convenience = CE.imports.convenience;

if (MultiMonitors.gnomeShellVersion()[1]>34) {
SwipeTracker = imports.ui.swipeTracker;
}

const THUMBNAILS_ON_LEFT_SIDE_ID = 'thumbnails-on-left-side';

var MultiMonitorsWorkspaceThumbnail = (() => {
Expand Down Expand Up @@ -880,6 +884,8 @@ var MultiMonitorsOverview = class MultiMonitorsOverview {
};

var MultiMonitorsTouchpadSwipeGesture = (() => {
if (MultiMonitors.gnomeShellVersion()[1]<36)
return null;
let MultiMonitorsTouchpadSwipeGesture = class MultiMonitorsTouchpadSwipeGesture extends GObject.Object {
_init(allowedModes) {
super._init();
Expand Down Expand Up @@ -921,6 +927,8 @@ var MultiMonitorsTouchpadSwipeGesture = (() => {
})();

var MultiMonitorsTouchSwipeGesture = (() => {
if (MultiMonitors.gnomeShellVersion()[1]<36)
return null;
let MultiMonitorsTouchSwipeGesture = class MultiMonitorsTouchSwipeGesture extends Clutter.GestureAction {
_init(allowedModes, nTouchPoints, thresholdTriggerEdge) {
super._init();
Expand Down Expand Up @@ -968,6 +976,8 @@ var MultiMonitorsTouchSwipeGesture = (() => {
})();

var MultiMonitorsSwipeTracker = (() => {
if (MultiMonitors.gnomeShellVersion()[1]<36)
return null;
let MultiMonitorsSwipeTracker = class MultiMonitorsSwipeTracker extends GObject.Object {
_init(actor, allowedModes, params) {
super._init();
Expand Down

0 comments on commit 9c163b1

Please sign in to comment.