Page 1 of 1
Delete dialog opening in background
Posted: 19 Aug 2013 12:24
by daniel_m
Some time ago, XYplorer started to open the "shift-delete" file dialog in the background, which makes deleting files/folders kind of awkward.
The problem occurs when I use the "right click context menu" with the shift key to delete a file/folder without using the recycle bin. It looks like timing matters, and I get the deletion dialog to appear in the foreground when I release the shift key immediately after I clicked on delete. When I don't release the shift key quickly enough, or when I keep it pressed down, the deletion dialog will open in the background (behind the XYplorer window).
Re: Delete dialog opening in background
Posted: 20 Aug 2013 05:16
by RalphM
I Shift+Delete all the time in XY but it never occured to me to use the right-click context menu for that action.
For me it's just easier to hit 'em both on the keyboard I guess and your problem never happened to me that way.
I know this doesn't really help to solve your problem, unless you're ready to change your habits.
Re: Delete dialog opening in background
Posted: 21 Aug 2013 14:36
by daniel_m
Well, my right hand is usually placed on the mouse and therefore I use the context menu. A "shift + delete" would require me to move my right hand from the mouse to the keyboard and back. Doesn't sound like a big deal, but it's surprisingly distracting ;-)
Re: Delete dialog opening in background
Posted: 21 Aug 2013 19:56
by SkyFrontier
1 - Under Tools, Customize KBoard Shortcuts..., locate the 'Delete (No Recycle Bin) Shift+Del' entry and REMOVE the key combo;
2 - Under User, Manage Commands..., Run Script, copy this code into Script (located in Command Properties) and make SHIFT+DEL to it under Assign KBoard Shortcut...:
Code: Select all
$list = get(selecteditemspathnames, |);
$tt = gettoken("$list", count, "|");
IF ($tt == 1) { $nm = getpathcomponent("$list", file); $cf = confirm("Are you sure to delete<crlf>$nm?"); }
ELSEIF ($tt != 1) { $cf = confirm("Are you sure to delete those $tt items?"); }
IF ($cf == 1) { delete 1, 1, "$list"; status "$tt item(s) gone for good.", "FF0000", "alert"; }
ELSEIF ($cf != 1) { status "Deletion of $tt item(s) canceled."; }
Reference:
http://www.xyplorer.com/xyfc//viewtopic ... 053#p64053
Re: Delete dialog opening in background
Posted: 22 Aug 2013 13:18
by daniel_m
Thanks, but unfortunately the script is not helping since it can only be invoked with the keyboard. In that case, the file deletion dialog is already always in the foreground and not causing any trouble.
In addition, the script calls the Windows file deletion dialog, which makes it necessary to confirm deletion twice (once for the script, once for Windows).
Hope this issue can be resolved somehow (even if it isn't caused by XYplorer but by Windows itself).
Re: Delete dialog opening in background
Posted: 22 Aug 2013 14:09
by highend
I have the same behavior once in a while, too.
One possible solution: An .ahk script / exe that runs in the background and checks if this deletion confirmation pops up and sets the "always on top" flag to get it back in the foreground.
Code: Select all
#NoEnv
;#NoTrayIcon
#SingleInstance force
#Persistent
SetTimer, CheckDialog, 250
return
CheckDialog:
IfWinExist, ahk_class #32770
WinSet, Top, , ahk_class #32770
return
Could be compiled (in that case, the #NoTrayIcon directive should be commented back in) and run from the autostart folder.
It's untested, because atm I can't get XY to show it in the background *sigh*
Re: Delete dialog opening in background
Posted: 22 Aug 2013 15:29
by SkyFrontier
daniel_m said:
"In addition, the script calls the Windows file deletion dialog, which makes it necessary to confirm deletion twice (once for the script, once for Windows)."
Here are some of my settings - so I don't have a second box to deal with:
Delete to recycle bin (Undo & Action Log) - unticked
Prompt before delete (Undo & Action Log) - ticked
Turn off delete confirmation (File Operations) - unticked - this is probably superseding windows bin global settings,
'don't move files to the bin' (which is ticked) and 'show a dialog confirm on exclusion', which is unticked (which is NOT respected, showing a confirm box under Win E - have to dig further but have no time for this as of now).
And yes, I focused on the 'Doesn't Sound Like A Big Deal - so why not?!' approach... (also may help others I saw having such a problem in the past).
Highend: does your solution works (theoretically) on *any* popoup originated from XYplorer...?
Re: Delete dialog opening in background
Posted: 22 Aug 2013 15:41
by highend
does your solution works (theoretically) on *any* popoup originated from XYplorer...?
It's a system dialog window, it's not tied to XY.
You'd have a hard time to do the same with windows, that are created by XY because the ahk_class is the same as the main application's window.
Re: Delete dialog opening in background
Posted: 22 Aug 2013 16:11
by daniel_m
highend's solution should work because it also takes care of the deletion dialog from the context menu (As stated before, the bug only occurs when deleting using the right-click context menu!). Still not a very convenient solution ... maybe I will start using ahk again ...