Ticket #3225 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

First Backspace/Delete ignored after mouse click in an input widget

Reported by: egmont Owned by: andrew_b
Priority: minor Milestone: 4.8.13
Component: mc-core Version: 4.8.12
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Take a one-line input widget, e.g. the "source" or "to" fields of an F5/F6 dialog, or the command line.

Make sure it contains some text.

Click in this widget with the mouse. The cursor moves there.

Press Backspace or Delete. Notice that this keypress is ignored.

A second press of Backspace or Delete performs its desired action as expected.

Attachments

mc-3225-bs-del-after-mouse-click.patch (763 bytes) - added by egmont 10 years ago.
fix

Change History

comment:1 follow-up: ↓ 3 Changed 10 years ago by egmont

Broken since commit a4e43788614cc1172c9a7a34b115fc177641a924.

Clicking creates a highlighted region of 0 length. BS/Del remove the highlighted region if any.

comment:2 Changed 10 years ago by egmont

Probably not the nicest way to fix this, but works.

Changed 10 years ago by egmont

fix

comment:3 in reply to: ↑ 1 Changed 10 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.13

Replying to egmont:

Broken since commit a4e43788614cc1172c9a7a34b115fc177641a924.

Clicking creates a highlighted region of 0 length. BS/Del remove the highlighted region if any.

Thanks for the tip!

Replying to egmont:

Probably not the nicest way to fix this, but works.

I think if bug is in mouse handler it should be fixed there.

Branch:3225_input_bs_del_after_mouse_click
Initial changeset:ddd336ad4d49e3535552a38cb7aa8c223f4a64ad
The bugfix itself is the 2nd commit in the branch.

comment:4 follow-up: ↓ 5 Changed 10 years ago by egmont

I'm sorry I forgot to mention one more special case why I chose to fix the bug at the BS/Del handler rather than in the mouse code. It's when you start dragging (highlighting) with the mouse, but drag it back to its starting point (a selection of 0 characters) and here you release it. If you press BS or Del after such an operation, it's still ignored with your patch.

comment:5 in reply to: ↑ 4 Changed 10 years ago by andrew_b

Replying to egmont:

when you start dragging (highlighting) with the mouse, but drag it back to its starting point (a selection of 0 characters) and here you release it. If you press BS or Del after such an operation, it's still ignored with your patch.

Fixed in the temporary 3rd commit.

comment:6 follow-up: ↓ 7 Changed 10 years ago by egmont

Cool, thanks.

There's one more bug somewhere in your patches: When you first move the mouse by 1 cell, the cursor moves but that one character is not highlighted. (When you move by 1 more cell, both cells get highlighted. The behavior of a subsequent keypress suggests that it's probably a display problem only and the underlying logic of what's where is correct.)

comment:7 in reply to: ↑ 6 Changed 10 years ago by andrew_b

Replying to egmont:

When you first move the mouse by 1 cell, the cursor moves but that one character is not highlighted.

Fixed.

comment:8 Changed 10 years ago by slavazanko

  • Votes for changeset set to slavazanko
  • Branch state changed from on review to approved

comment:9 Changed 10 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [4513bd649c69e1fe874ec3825015469d252bedd0].

git log --pretty=oneline aa6ad48..4513bd6

comment:10 Changed 10 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.