Page 1 of 1

Opening a folder auto-selects the item under cursor

Posted: 12 Nov 2015 16:34
by Marco
I'm experiencing a "weird" behaviour that I don't remember I've ever enabled on purpose. I'm not posting this under Bugs because I can't repro on a fresh, so it's very likely that I did something wrong in the past in my configuration. Anyway... this is what happens. When I open a folder, the item under the mouse cursor is automatically selected.
myconfig.gif
How can I disable this?

Re: Opening a folder auto-selects the item under cursor

Posted: 13 Nov 2015 07:30
by bdeshi
Disable Configuration > Mouse Down Blow Up > On file icons as well.
Regardless, this doesn't happen if you open items by clicking anywhere except the icon.


====================

:bug: The child item is getting selected even after all mouseclicks are [supposedly] eaten by the open event -- apparently some clicks are leaking.
I'm sure clicks are leaking, because even programmed double-clicks end up selecting a child item.

Code: Select all

;AutoHotkey script
;place mouse cursor over a folder icon (where folder itemcount == folder's current list position)
SetMouseDelay, 0 ;Speedy Gonzales!
WinActivate, ahk_class ThunderRT6FormDC ;activate XY window
Sleep, 1000 ;waittasecond
Click 2 ;doubleclick
[/size]

[moved to bug reports]

Re: Opening a folder auto-selects the item under cursor

Posted: 13 Nov 2015 09:14
by admin
Yep, thanks for the bug and the analysis. Fix comes.

Re: Opening a folder auto-selects the item under cursor

Posted: 13 Nov 2015 16:32
by Marco
Thanks for the fix. Any chance you can improve it even with Configuration > Menus, Mouse, Safety > Mouse > Single click on icon opens list items?

Re: Opening a folder auto-selects the item under cursor

Posted: 13 Nov 2015 19:35
by admin
Ok. :)

Re: Opening a folder auto-selects the item under cursor

Posted: 14 Nov 2015 16:53
by Marco
Thanks, totally fixed!

Re: Opening a folder auto-selects the item under cursor

Posted: 16 Nov 2015 17:45
by TheQwerty
FYI, enabling both of those options is not recommended because it can lead to race-conditions and odd behavior. Largely due to the timing of when the item is focused and thus differences between <focitem> and <pfaitem>.

See for yourself, from fresh enable both:
Configuration | Menus, Mouse, Safety | Mouse | Single click on icon opens list items
Configuration | Mouse Down Blow Up | On file icons as well

Add PFA:

Code: Select all

"Floating Preview" {:Image}>::if (! Get('#178')) { #178; }
Select a zip file.
Click the icon of an image file.
2015-11-16 113751.png
Seem XY triggers the PFA based on the clicked item (an {:Image}), opens floating preview using the current item for its view mode (the zip), then makes the image the current item, updating the floating preview but not its mode.

Better example is to just observe the difference between <focitem> and <pfaitem> with a PFA such as:

Code: Select all

*>::echo "Foc: <focitem><crlf>PFA: <pfaitem>";
I brought this up previously and was deemed crazy. ;)

Re: Opening a folder auto-selects the item under cursor

Posted: 17 Nov 2015 16:04
by admin
Yes, it can be reproduced even without "Single click on icon opens list items" when you dbl-click the icon.

This cannot be changed. It's an extreme case and AFAIK only can happen when PFA calls scripts by numbers.

Re: Opening a folder auto-selects the item under cursor

Posted: 17 Nov 2015 16:58
by TheQwerty
admin wrote:This cannot be changed. It's an extreme case and AFAIK only can happen when PFA calls scripts by numbers.
Well the second PFA script shows that it's not just affecting CID-scripts, but if that really were the case then a "solution" is for you to provide a non-number alternative to #178, right? :P


Anyhow, I wasn't posting this in hopes of it being improved (I've resigned myself to the situation), just alerting others that combining those two options with PFA is a road that passes through Sadness City if your PFA scripts are not robust. ;)



I should have included the work-around for the script in the previous post, so here's that.

Obviously, it depends on what the script does, but generally (due to the nature of single-click on icon) you'll want to just select <pfaitem>. Where it get's tricky is all the ways the PFA can be triggered and the differences between opening a single item vs multiple items of same type vs multiple items of differing types.

This works well in PFA scripts that exhibit these problems:

Code: Select all

if (<pfaitem> != <curitem>) {
  selectitems <pfaitems>; // Note the 's' allows it to work for multiple items.
}
Thus, a better version of the above PFA is something like this:

Code: Select all

"Floating Preview" {:Image}>::if (Get('#178')) { return; } if (<pfaitem> != <curitem>) { selectitems <pfaitems>; } #178;