Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extension to load under GNOME 3.38 #276

Merged
merged 8 commits into from
Apr 9, 2021
2 changes: 1 addition & 1 deletion convenience.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function getSettings(schema) {
*/
function TalkativeLog(msg) {
if (Settings.getOption("b", Settings.VERBOSE_DEBUG_SETTING_KEY)) {
global.log("[ESC]" + msg);
log("[ESC]" + msg);
}
}

Expand Down
23 changes: 13 additions & 10 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const PopupMenu = imports.ui.popupMenu;
const MessageTray = imports.ui.messageTray;
const Slider = imports.ui.slider;
const Main = imports.ui.main;
const LibRecorder = imports.ui.screencast;

const Gettext = imports.gettext.domain(
"EasyScreenCast@iacopodeenosee.gmail.com"
Expand Down Expand Up @@ -78,13 +77,13 @@ const EasyScreenCast_Indicator = new Lang.Class({
}

//add enter/leave/click event
this.actor.connect("enter_event", (param1, param2, focus) =>
this.connect("enter_event", (param1, param2, focus) =>
this.refreshIndicator(param1, param2, true)
);
this.actor.connect("leave_event", (param1, param2, focus) =>
this.connect("leave_event", (param1, param2, focus) =>
this.refreshIndicator(param1, param2, false)
);
this.actor.connect("button_press_event", (actor, event) =>
this.connect("button_press_event", (actor, event) =>
this._onButtonPress(actor, event)
);

Expand Down Expand Up @@ -596,20 +595,21 @@ const EasyScreenCast_Indicator = new Lang.Class({
this.TimeSlider = new Slider.Slider(
Settings.getOption("i", Settings.TIME_DELAY_SETTING_KEY) / 100
);
this.TimeSlider.x_expand = true;
this.TimeSlider.y_expand = true;

this.TimeSlider.connect("notify::value", (item) => {
this.DelayTimeLabel.set_text(
Math.floor(item.value * 100).toString() + _(" Sec")
);
});

this.TimeSlider.connect("drag-end", () => this._onDelayTimeChanged());
this.TimeSlider.actor.connect("scroll-event", () =>
this.TimeSlider.connect("scroll-event", () =>
this._onDelayTimeChanged()
);

this.imSliderDelay.actor.add(this.TimeSlider.actor, {
expand: true,
});
this.imSliderDelay.add(this.TimeSlider);

return [this.DelayTimeTitle, this.imSliderDelay];
},
Expand All @@ -624,7 +624,7 @@ const EasyScreenCast_Indicator = new Lang.Class({
this.CtrlWebcam.startMonitor();

//add indicator
this.actor.add_actor(this.indicatorBox);
this.add_actor(this.indicatorBox);
},

/**
Expand All @@ -637,7 +637,7 @@ const EasyScreenCast_Indicator = new Lang.Class({
this.CtrlWebcam.stopMonitor();

//remove indicator
this.actor.remove_actor(this.indicatorBox);
this.remove_actor(this.indicatorBox);
},

/**
Expand Down Expand Up @@ -915,6 +915,9 @@ const EasyScreenCast_Indicator = new Lang.Class({
* @private
*/
_replaceStdIndicator: function (OPTtemp) {
if (Main.panel.statusArea["aggregateMenu"]._screencast === undefined) {
return
}
if (OPTtemp) {
Lib.TalkativeLog("-*-replace STD indicator");
Main.panel.statusArea[
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"3.26",
"3.27",
"3.28",
"3.30"
"3.30",
"3.38"
],
"uuid": "EasyScreenCast@iacopodeenosee.gmail.com",
"url": "https://github.com/EasyScreenCast/EasyScreenCast",
Expand Down
10 changes: 5 additions & 5 deletions utilnotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
const Lang = imports.lang;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Clutter = imports.gi.Clutter;
const St = imports.gi.St;
const Tweener = imports.ui.tweener;

const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
Expand Down Expand Up @@ -54,7 +54,7 @@ var NotifyManager = new Lang.Class({
notify.setResident(true);

Main.messageTray.add(this.source);
this.source.notify(notify);
this.source.showNotification(notify);

if (sound) {
notify.playSound();
Expand Down Expand Up @@ -105,10 +105,10 @@ var NotifyManager = new Lang.Class({
Math.floor(monitor.height / 2 - text.height / 2)
);

Tweener.addTween(text, {
text.ease({
opacity: 0,
time: 4,
transition: "easeOutQuad",
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: 4000,
onComplete: () => {
Main.uiGroup.remove_actor(text);
text = null;
Expand Down
5 changes: 3 additions & 2 deletions utilrecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const Shell = imports.gi.Shell;
const Main = imports.ui.main;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const LibRecorder = imports.ui.screencast;
const { loadInterfaceXML, loadSubInterfaceXML } = imports.misc.fileUtils;
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');

const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
Expand All @@ -26,7 +27,7 @@ const UtilGSP = Me.imports.utilgsp;
const Ext = Me.imports.extension;

const ScreenCastProxy = Gio.DBusProxy.makeProxyWrapper(
LibRecorder.ScreencastIface
ScreencastIface
);
let ScreenCastService = null;

Expand Down