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

Add missing toString methods in selection classes #326

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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