Tk Source Code

View Ticket
Login
Ticket UUID: 13aabdb3c117faa2e595761feb902298bc9277d7
Title: Mouse click astray
Type: Bug Version: 8.6.7
Submitter: anonymous Created on: 2017-09-20 22:11:02
Subsystem: 18. [text] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-06 20:02:50
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-06 20:02:50
Description:
I got a strange mouse-click issue in a text widget where I had two blocks of texts with differing font sizes.
When I clicked at some lines (it looked that just some lines were affected, may be lines nearby bordering between the two blocks), the cursor went one-line wrong (like going one line downwards). At some situations this was for cca half of the affected line, and occasionally the affected line was mostly unreachable by mouse clicks.

I solve it via explicit binding for mouse click in text, using just the stuff that text widget provides: "$wdg mark set "insert" [$wdg index "@$x_pos,$y_pos"]". And it works correctly for me this way. Thus am not sure why it went bad without this. Notice that column position seemed to be correct, just the line went slipped.
User Comments: jan.nijtmans added on 2026-10-06 20:02:50:

Fixed in [9bf1844fa5d3fa3b|trunk], core-9-0-branch and core-8-6-branch.

Many thanks!


serhiy.storchaka added on 2026-09-18 21:02:11:

Reproduced: a click in the right half of the empty space after a line moves the insert cursor to the next line, because the bbox of the newline extends to the right edge and tk::TextClosestGap chooses the gap after it. Fix in branch [7408a3e775].


kvutza added on 2017-09-21 22:02:54:
Hi, actually I do not expect you to work on it (by now). It is reported here mainly to let you know about it. So that if you (or anyone else) will start to work on the related code for whatever reason, you can have this thing in mind then.

PS I've finally created a non-anonymous user ID here. You have it quite easy to report without having any real user ID.

fvogel added on 2017-09-21 20:24:14:
This is going to be tough to address without a reproducible demo script...