[gnome-shell] screenshot: Pass a Graphene.Point as PickPixel 'finished' signal
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] screenshot: Pass a Graphene.Point as PickPixel 'finished' signal
- Date: Wed, 16 Oct 2019 15:32:27 +0000 (UTC)
commit f67b409fc11a8f60de98fdf733e66439b8d76412
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Tue Sep 3 01:51:00 2019 +0200
screenshot: Pass a Graphene.Point as PickPixel 'finished' signal
This will allow to pass the data as native object when porting this to Clutter
actor.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
js/ui/screenshot.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index bbc1be499c..f3d1d02ddf 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported ScreenshotService */
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Graphene, Gio, GLib, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const GrabHelper = imports.ui.grabHelper;
@@ -198,7 +198,7 @@ var ScreenshotService = class {
let screenshot = this._createScreenshot(invocation, false);
if (!screenshot)
return;
- screenshot.pick_color(...coords, (o, res) => {
+ screenshot.pick_color(coords.x, coords.y, (_o, res) => {
let [success_, color] = screenshot.pick_color_finish(res);
let { red, green, blue } = color;
let retval = GLib.Variant.new('(a{sv})', [{
@@ -349,7 +349,8 @@ var PickPixel = class {
}
_onButtonRelease(actor, event) {
- this._result = event.get_coords();
+ let [x, y] = event.get_coords();
+ this._result = new Graphene.Point({ x, y });
this._grabHelper.ungrab();
return Clutter.EVENT_PROPAGATE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]