Bug 425707 - Unexpected Konsole mouse cursor position change when changing cursor shape
Summary: Unexpected Konsole mouse cursor position change when changing cursor shape
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: 20.04.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-23 12:00 UTC by oldherl
Modified: 2020-08-23 12:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Video clip showing the bug, konsole 20.04.3 on Arch Linux (1.27 MB, video/webm)
2020-08-23 12:00 UTC, oldherl
Details
No bug on my modified konsole. (1.00 MB, video/webm)
2020-08-23 12:03 UTC, oldherl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description oldherl 2020-08-23 12:00:33 UTC
Created attachment 131123 [details]
Video clip showing the bug, konsole 20.04.3 on Arch Linux

SUMMARY
In Konsole, when changing from mouse-tracking application (e.g. mouse-enabled tmux or vim) to default (e.g. exiting tmux), the mouse cursor moves unexpectedly. 

STEPS TO REPRODUCE
1. Open a Konsole window and run a mouse-enabled tmux in it.
2. Type "exit" but no Enter key
3. Move the mouse cursor to the end of PS1
4. Press Enter to exit tmux.

OBSERVED RESULT

Unexpected mouse position change. The cursor is not in the same place as before the Enter key. In my video it jumps up for almost one character height.

See the video clip "konsolebug".

EXPECTED RESULT

Only the shape would change from Arrow (application mouse tracking mode) to I-Beam (default), but the position should not change.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 20.04.3
KDE Frameworks Version: 5.72.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION

I can reproduce it on git `master` branch of konsole and the same version for all other libraries.
I cloned the konsole source code from git and did a bit of debugging. Seems that it's caused by `KCursor::setAutoHideCursor`. I removed that line so that the cursor won't auto-hide on key strokes, and the bug disappears. Hope that helps.
I recorded in "konsolenobug" video.
Comment 1 oldherl 2020-08-23 12:03:38 UTC
Created attachment 131124 [details]
No bug on my modified konsole.

Uploaded a video with my modified konsole. Bug disappears. 
I removed line 549 of TerminalDisplay.cpp,
`KCursor::setAutoHideCursor(this, true);`

Sorry for the hand-held phone videos. The bug won't appear in screenshots because the recording software would "fix" the bug!