Improved mouse rectangle selection robustness (bug#38013)

Make the rectangular selection work better with
display-line-numbers-mode and side-by-side windows.
Also make the mouse track the text cursor in a consistent way.

* lisp/mouse.el (mouse--rectangle-track-cursor): Added constant.
(mouse-drag-region-rectangle): Take the line-number width into
account, and use window-relative columns.  Track either the cursor or
rectangle corner with more care.
1 job for master in 68 minutes and 53 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Test
failed #4399
test-all

01:08:53

 
Name Stage Failure
failed
test-all Test
Makefile:319: recipe for target 'check-doit' failed
make[2]: *** [check-doit] Error 1
make[2]: Leaving directory '/builds/emacs/emacs/test'
make[1]: *** [check-expensive] Error 2
Makefile:294: recipe for target 'check-expensive' failed
make[1]: Leaving directory '/builds/emacs/emacs/test'
Makefile:959: recipe for target 'check-expensive' failed
make: *** [check-expensive] Error 2
ERROR: Job failed: exit code 1