Bugzilla – Bug 224
Label text boxes: Drag and select doesn't select whole words properly
Last modified: 2018-08-20 11:45:45 UTC
reported by Bill Wharrie. Doesn't effect text boxes in e.g. Metadata Editor. Not apparent on Windows or Ubuntu. Is a nuisance given there is no right-click > Select All either.
I doubt this is really OSX specific. Click and shift-click in labels certainly do not behave analogously to most text editors, and that is all about Audacity's own logic.
This was not quite intentionally fixed at https://github.com/audacity/audacity/commit/06fd4818156f3c689512c3c1a2cfda323575fa08 I say not quite intentionally, because I was doing some cleanup of confusing stuff in LabelTrack that I thought would be only preliminary to this bug and others. I wanted to understand why this fixed this bug before proceeding. I think I do now. A short answer is that the code was relying too much on doing certain delayed changes of label track state in the repaint procedure (a bad idea for code clarity), and assumed that a paint event would happen between the left click and the first drag event. But in fact the click and at least one drag event are dispatched first, and only then came the painting. By not delaying certain changes until the painting, but doing them at once in click and drag -- I fixed this bug without fully understanding why.
This bug is fixed, construing the steps to reproduce very exactly. However. Let step be a click-drag-release rather than just a click. Then, the behavior is still strange. But rather than reopen this bug, please let the new bug 1443 track this and other anomalies.
Following the steps to reproduce - testing on macOS Sierra 10.12.6 with 53c3adf 03Aug17 3e39771 "longish" is correctly selected in full Also sanity checked on lated Wdows nightly wher it is ok too