Skip to content

Commit

Permalink
Merge pull request #326 from adangel:issue-325
Browse files Browse the repository at this point in the history
Add missing toString methods in selection classes
  • Loading branch information
adangel committed Apr 7, 2022
2 parents 1fecc02 + 9a04fe1 commit 9cbe542
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

**🎉 Merged pull requests:**

* [#326](https://github.com/EasyScreenCast/EasyScreenCast/pull/326): Add missing toString methods in selection classes ([@adangel](https://github.com/adangel))

**🐛 Fixed bugs:**

* [#325](https://github.com/EasyScreenCast/EasyScreenCast/issues/325): TypeError: GObject_Object.prototype.toString called on incompatible Object

**Full Changelog**: <https://github.com/EasyScreenCast/EasyScreenCast/compare/1.5.0...HEAD>

# v1.5.0 (42) (2022-03-05)
Expand Down
48 changes: 38 additions & 10 deletions selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,19 @@ const Capture = GObject.registerClass({

Main.uiGroup.add_actor(this._areaResolution);

if (Main.pushModal(this._areaSelection)) {
this._signalCapturedEvent = global.stage.connect(
'captured-event',
this._onCaptureEvent.bind(this)
);

this._setCaptureCursor();
} else {
Lib.TalkativeLog('-£-Main.pushModal() === false');
this._signalCapturedEvent = global.stage.connect(
'captured-event',
this._onCaptureEvent.bind(this)
);
this._prevFocus = global.stage.get_key_focus();
if (this._prevFocus !== null) {
this._prevFocusDestroyId = this._prevFocus.connect('destroy', () => {
this._prevFocus = null;
});
}
global.stage.set_key_focus(this._areaSelection);

this._setCaptureCursor();

Main.sessionMode.connect('updated', () => this._updateDraw());
}
Expand Down Expand Up @@ -122,6 +125,7 @@ const Capture = GObject.registerClass({
_onCaptureEvent(actor, event) {
if (event.type() === Clutter.EventType.KEY_PRESS) {
if (event.get_key_symbol() === Clutter.KEY_Escape) {
Lib.TalkativeLog('-£-capture selection stop with KEY_Escape');
this._stop();
}
}
Expand Down Expand Up @@ -179,7 +183,11 @@ const Capture = GObject.registerClass({
global.stage.disconnect(this._signalCapturedEvent);
this._setDefaultCursor();
Main.uiGroup.remove_actor(this._areaSelection);
Main.popModal(this._areaSelection);
if (this._prevFocus) {
this._prevFocus.disconnect(this._prevFocusDestroyId);
global.stage.set_key_focus(this._prevFocus);
this._prevFocus = null;
}
Main.uiGroup.remove_actor(this._areaResolution);
this._areaSelection.destroy();
this.emit('stop');
Expand All @@ -196,6 +204,10 @@ const Capture = GObject.registerClass({

Ext.Indicator._doDelayAction();
}

toString() {
return this.GTypeName;
}
});

Signals.addSignalMethods(Capture.prototype);
Expand Down Expand Up @@ -245,6 +257,10 @@ var SelectionArea = GObject.registerClass({
}
}
}

toString() {
return this.GTypeName;
}
});

Signals.addSignalMethods(SelectionArea.prototype);
Expand Down Expand Up @@ -340,6 +356,10 @@ var SelectionWindow = GObject.registerClass({
Lib.TalkativeLog('-£-window highlight off');
this._capture.clearSelection();
}

toString() {
return this.GTypeName;
}
});

Signals.addSignalMethods(SelectionWindow.prototype);
Expand Down Expand Up @@ -395,6 +415,10 @@ var SelectionDesktop = GObject.registerClass({
this._capture._saveRect(x, y, height, width);
}
}

toString() {
return this.GTypeName;
}
});

Signals.addSignalMethods(SelectionDesktop.prototype);
Expand Down Expand Up @@ -474,6 +498,10 @@ var AreaRecording = GObject.registerClass({
isVisible() {
return this._visible;
}

toString() {
return this.GTypeName;
}
});

Signals.addSignalMethods(AreaRecording.prototype);
Expand Down

0 comments on commit 9cbe542

Please sign in to comment.