After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687954 - Add a SelectArea() DBus method
Add a SelectArea() DBus method
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 681844
 
 
Reported: 2012-11-09 01:46 UTC by Cosimo Cecchi
Modified: 2013-01-03 11:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a SelectArea() DBus method (8.50 KB, patch)
2012-11-09 01:46 UTC, Cosimo Cecchi
reviewed Details | Review
Add a SelectArea() DBus method (8.45 KB, patch)
2012-12-07 15:27 UTC, Cosimo Cecchi
reviewed Details | Review
Add a SelectArea() DBus method (8.92 KB, patch)
2012-12-07 18:07 UTC, Cosimo Cecchi
reviewed Details | Review
Add a SelectArea() DBus method (8.90 KB, patch)
2012-12-07 20:01 UTC, Cosimo Cecchi
reviewed Details | Review
Add a SelectArea() DBus method (8.95 KB, patch)
2012-12-07 20:29 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2012-11-09 01:46:57 UTC
This was requested by Bastien for bug 681844.
Comment 1 Cosimo Cecchi 2012-11-09 01:46:59 UTC
Created attachment 228519 [details] [review]
Add a SelectArea() DBus method

This will be useful for e.g. selecting an area for a screenshot.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-11-26 21:52:39 UTC
Review of attachment 228519 [details] [review]:

::: js/ui/selectArea.js
@@ +43,3 @@
+
+        this._rubberband = new Clutter.Canvas();
+        this._rubberband.connect('draw', Lang.bind(this, this._onRubberbandDraw));

Hm. Have you considered using a simple Clutter.Rectangle with a border and background color which you manipulate the x/y/width/height of, rather than doing cairo drawing?

@@ +129,3 @@
+        global.unset_cursor();
+
+        this.emit('destroy', geometry);

I don't really like the signal name. I'd prefer something like 'finished'.
Comment 3 Cosimo Cecchi 2012-12-07 15:27:21 UTC
Created attachment 230978 [details] [review]
Add a SelectArea() DBus method

--

- use ClutterRectangle
- rename destroy to finished
- more cleanups
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-12-07 17:50:08 UTC
Review of attachment 230978 [details] [review]:

::: js/ui/selectArea.js
@@ +111,3 @@
+
+    _onButtonRelease: function(actor, event) {
+        this._destroy(this._getGeometry());

I'd like to see us fade out the area like we do with rubber bands in e.g. Nautilus.
Comment 5 Cosimo Cecchi 2012-12-07 18:07:27 UTC
Created attachment 230987 [details] [review]
Add a SelectArea() DBus method

--

Good idea - how about this?
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-12-07 19:21:33 UTC
Review of attachment 230987 [details] [review]:

Hm, I'm not sure if the fade-out is something that we should add on escape, and I'm also not sure if it will appear in the screenshot.
Comment 7 Cosimo Cecchi 2012-12-07 20:01:57 UTC
Created attachment 230997 [details] [review]
Add a SelectArea() DBus method

--

Don't fade out when cancelling with Escape.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-12-07 20:23:05 UTC
Review of attachment 230997 [details] [review]:

::: js/ui/selectArea.js
@@ +125,3 @@
+        }
+
+        if (fade)

Tweener will do this for you automatically if you mark time as 0:

   { opacity: 0,
     time: fade ? 0.2 : 0,
     ... });
Comment 9 Cosimo Cecchi 2012-12-07 20:29:04 UTC
Created attachment 230999 [details] [review]
Add a SelectArea() DBus method

--

Good point; updated patch.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-12-07 20:39:44 UTC
Review of attachment 230999 [details] [review]:

Sure.
Comment 11 Cosimo Cecchi 2013-01-03 11:57:56 UTC
Attachment 230999 [details] pushed as dd19459 - Add a SelectArea() DBus method