From a6a3095e56c967c90f9d1b8b6fe126ff39d8d7d3 Mon Sep 17 00:00:00 2001 From: Olaf Leidinger Date: Tue, 5 Nov 2013 02:32:46 +0100 Subject: [PATCH] use monitor constraint only if it is defined in the shell (GNOME >3.4) --- src/extension.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/extension.js b/src/extension.js index df22a77..406bad3 100644 --- a/src/extension.js +++ b/src/extension.js @@ -43,8 +43,12 @@ const TeaTimeFullscreenNotification = new Lang.Class({ // the center of itself this._bin = new St.Bin({ x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE}); - this._monitorConstraint = new Layout.MonitorConstraint(); - this._bin.add_constraint(this._monitorConstraint); + + if (typeof Layout.MonitorConstraint != 'undefined') { + // MonitorConstraint was introduced in gnome-3.6 + this._monitorConstraint = new Layout.MonitorConstraint(); + this._bin.add_constraint(this._monitorConstraint); + } Main.uiGroup.add_actor(this._bin); // a table imitating a vertical box layout to hold the texture and @@ -96,7 +100,9 @@ const TeaTimeFullscreenNotification = new Lang.Class({ this._texture.set_from_file(this._textureFiles[idx]); }, show: function() { - this._monitorConstraint.index = global.screen.get_current_monitor() + if (typeof Layout.MonitorConstraint != 'undefined') { + this._monitorConstraint.index = global.screen.get_current_monitor() + } Main.pushModal(this._bin); this._timeline.start(); this._lightbox.show();