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 757470 - Allow selectability without editability
Allow selectability without editability
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-02 12:41 UTC by Emmanuele Bassi (:ebassi)
Modified: 2015-11-30 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
text: Allow selectability without editability (9.18 KB, patch)
2015-11-02 12:41 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Emmanuele Bassi (:ebassi) 2015-11-02 12:41:10 UTC
Selectable and editable are two separate concepts that ClutterText has been unfortunately conflating together.

Let's try and see if we can get away with changing the behaviour without breaking existing code.

Component: ClutterText
Comment 1 Emmanuele Bassi (:ebassi) 2015-11-02 12:41:13 UTC
Created attachment 314630 [details] [review]
text: Allow selectability without editability

Being able to select text and being able to edit text are two separate
capabilities, but ClutterText only allows the former with the latter.

The ClutterText:selectable property is set to TRUE by default, given
that it depends on the :editable property; this implies that all
ClutterText instances now are going to show a cursor as soon as they get
key focused. Obviously, this would make labels look a bit off — but if
you have a label then you would not give it key focus, either by
explicitly calling clutter_actor_grab_focus(), or by setting it as
reactive and allowing it to be clicked.

If this turns out to be a problem, we have various ways to avoid showing
a cursor — for instance, we could change the default value of the
selectable property, and ensure that setting the :editable property to
TRUE would also set the :selectable property as a side effect. Or we
could hide the cursor until the first button/touch press event. Finally,
we could always back this commit out if it proves to be too much of a
breakage for existing code bases.
Comment 2 Emmanuele Bassi (:ebassi) 2015-11-30 13:24:07 UTC
I pushed attachment 314630 [details] [review] to master.

Looking at the code in GNOME Shell, the only labels that are also reactive are the ones with the chance of showing URLs. For those, we can add an explicit 'selectable' property set to false.