Skip to content
  • Ahmad Samir's avatar
    Invert the logic for Mouse Tracking events · a2ad2d70
    Ahmad Samir authored and Kurt Hindenburg's avatar Kurt Hindenburg committed
    Summary:
    Previously the logic was to set "usesMouse" (Emulation
    MODE_Mouse100{0,1,2,3}) to false to indicate that the program running
    in the terminal supports handling mouse events itself, i.e. the program
    is interested in receiving Mouse Tracking events; or set to true otherwise.
    
    Since this was confusing, use the inverse logic by replacing "usesMouse"
    with "usesMouseTracking".
    
    "usesMouseTracking" is set to true when the program running in the shell
    indicates it's interested in receiving Mouse Tracking events. Or false
    otherwise.
    
    For example, vim indicates it's interested in receiving Mouse Tracking
    evnets when using visual mouse mode:
    http://vimdoc.sourceforge.net/htmldoc/intro.html#Normal
    
    Mouse Tracking is an XTerm extension, for more information examine:
    http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
    
    Test Plan:
    Before:
     - Execute `printf '\e[?1003h'` to enable mouse tracking mode in konsole, now when you move the mouse events will be sent to the terminal when you move, click, drag the mouse
     - Pressing and holding the Shift key should let the mouse act as normal
    
     - Open a new tab or execute `printf 'e[?1003l'`, then open any file in vim, `:set mouse=a` then select some text with the mouse, note that VISUAL is displayed at the bottom of the window; right clicking _doesn't_ show the context menu as you'd expecte
     - Pressing and holding the Shift key should let the mouse act as normal
    
    Apply the diff, build, and try again, everything should work as before.
    
    Reviewers: #konsole, hindenburg
    
    Reviewed By: #konsole, hindenburg
    
    Subscribers: hindenburg, konsole-devel, #konsole
    
    Tags: #konsole
    
    Differential Revision: https://phabricator.kde.org/D13134
    a2ad2d70