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 383810 - Text selection events not always announced
Text selection events not always announced
Status: RESOLVED FIXED
Product: lsr
Classification: Deprecated
Component: user interface
0.3.x
Other Linux
: Normal normal
: 0.5.0
Assigned To: Peter Parente
LSR maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-08 17:56 UTC by Peter Parente
Modified: 2007-02-13 21:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
not complete, handles some cases (6.21 KB, patch)
2007-02-12 21:52 UTC, Peter Parente
needs-work Details | Review
done for now (6.95 KB, patch)
2007-02-13 20:08 UTC, Peter Parente
committed Details | Review

Description Peter Parente 2006-12-08 17:56:09 UTC
In single line text controls, selection events precede caret movement events rather than follow them. In multiline (well, in gedit; need to confirm for other multiline), selection events follow caret movement rather precede them. The DefaultPerk only works in the later case currently (which also seems to make the most sense). In the former case, the selection announcement is clipped by the following caret movement.

Using an inhibitMayStop for the text selection event should help, but isn't the best solution because, in the latter case, we don't want the selection event to continue when the user presses the next key to navigate to another char.

Is there another fix? What about "caching" selection events that preceed and announcing them later when we get a caret in the former case?
Comment 1 Scott Haeger 2007-01-29 18:01:38 UTC
Inserted inhibitMayStop() for single line text boxes in selection event.  Fixed in repository. 
Comment 2 Peter Parente 2007-02-07 21:10:50 UTC
Broken when tabbing from one control with selection to another in LSR settings. LSR says "selected 0" instead of text in the control.
Comment 3 Peter Parente 2007-02-12 17:10:10 UTC
The simple text event handler doesn't have a focus handling method. The result is that selector events are fired for single line text boxes, rather than caret movement. Why, I don't know. I'm going to implement focus handler properly and see what happens.
Comment 4 Peter Parente 2007-02-12 21:52:01 UTC
Created attachment 82424 [details] [review]
not complete, handles some cases

Comments to follow...
Comment 5 Peter Parente 2007-02-13 17:51:59 UTC
There are many situations and implementations of text selection which differ in some key ways to make output from LSR inconsistent. Here are some typical user input events and the resulting AT-SPI events for text entry boxes (gtk, single line), text views (gtk, multiline), and edit bars (XUL, auto complete with drop down):

Text entry

Focus in (caret not at end)
1. focus
2. selection (whole string)

Focus in (caret previously moved from end)
1. focus
2. selection (whole string)
3. movement to end (if not already at end)

Shift-Left/Right
1. selection
2. movement

Text view

Focus in
1. focus

Shift-Left/Right
1. movement
2. selection

Edit bar

Focus in
1. focus
2. movement
3. selection

Shift-Left/Right
1. movement
2. selection
Comment 6 Peter Parente 2007-02-13 20:08:18 UTC
Created attachment 82481 [details] [review]
done for now

Handles most of the cases below by detecting whether or not the caret position as reported by the control matches the pointer POR known to LSR. If it doesn't, a caret movement will be received in the future, and so a selection event should inhibit stopping by the movement.

What this patch does not do properly is stop output when doing multiple shift selects in text boxes where selection comes before movement. The next select does not invoke mayStop because, if it did, selections immediately after focus would stop output about the focus. This behavior may be fixable with some thought about how to distinguish the two selection cases.
Comment 7 Peter Parente 2007-02-13 21:46:59 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.