GNOME Bugzilla – Bug 757470
Allow selectability without editability
Last modified: 2015-11-30 13:24:36 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
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.
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.