Ticket #3722 (new defect)

Opened 19 months ago

Last modified 18 months ago

Double clicking on empty area executes last item

Reported by: egmont Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


Forking from #3715:

Go to a directory which has fewer entries than the height of the panel widget.

Double click on the empty area at the bottom.

Actual behavior: The last item is executed (if executable) or entered (if directory or archive).

Expected behavior: Nothing (other than the last item getting selected on the first click).

Unexpected execution of a binary can potentially be quite dangerous, and it's sure unexpected to execute it if you double clicked somewhere else.

(Similary I'm wondering whether the leftmost and rightmost columns (the borders which aren't highlighted) should be excluded as well.)

Change History

comment:1 Changed 18 months ago by and

Yes makes sense to prevent execute of last element BY ACCIDENT of an inexperienced user.

comment:2 Changed 18 months ago by mooffie

The patch--

  • probably fails for "brief" listing.
  • doesn't address egmont's note about excluding left/right borders.
  • could have been nicer if it factored out MSG_MOUSE_DRAG's code for figuring out a file index from coordinates.

comment:3 Changed 18 months ago by and

Thanks mooffie, can you test next patch?

comment:4 Changed 18 months ago by mooffie

Have you considered idea #3 in my previous comment?

Some day we'll support drag & drop and then what? Will we duplicate these calculations for the 3rd time?

While MSG_MOUSE_DRAG also needs to know when the mouse cursor it outside the files, perhaps we can still share the code in a way that isn't inelegant.

comment:5 Changed 18 months ago by and

Honestly I was focused on MSG_MOUSE_CLICK bug fixing because I can reproduce egmonts findings about "Double clicking".

I don't want touch MSG_MOUSE_DRAG (and maybe break it) by fixing "double clicking" here.

Note: See TracTickets for help on using tickets.