Skip to content
  • Luis Javier Merino's avatar
    Avoid using wrong coordinates on extendSelection · a8726def
    Luis Javier Merino authored and Kurt Hindenburg's avatar Kurt Hindenburg committed
    It seems MR 659 exposed an old bug (sorry!).  When extending the selection
    (shift + left mouse button) and there was no previous point of reference
    (either a selection, or a previous mouse press, with no intervening
    normal/alternate screen switches), extendSelection() was using the position
    measured in _pixels_ instead of char cells to initialize the point of reference
    for further selection extend operations.
    
    Before MR 659, this tended to result in the selection extending from the mouse
    position to the lower right corner on a subsequent selection extend operation.
    
    Now, if there is no previous point of reference, use the cursor position.
    Whether to also use the cursor position as point of reference if there is no
    existing selection merits further consideration.
    
    To reproduce the bug, open a new Konsole, and shift+LMB twice (once to set the
    out of bounds point of reference, and another one to actually create a
    selection) before doing any other mouse button presses.
    
    BUG: 458822
    BUG: 398320
    a8726def