Author Topic: Losing Focus When Task Complete  (Read 22660 times)

KevanB

  • Newbie
  • *
  • Posts: 2
    • View Profile
Losing Focus When Task Complete
« on: December 24, 2018, 17:16:40 »
Dear All,

I'm not sure if this is a Multi Commander issue or a Windows10 "feature".

If I copy all the files from one dir. into a dir. in the other pane Multi Commander "loses" the focus on completion and the screen flips to another program running.

If I only copy some files ( ie so that the original directory is not empty)  Multi Commander stays "in focus" and on screen.

Is this a setting I have accidently switch on, Muti Commander's correct method of working, or a W10 feature?

I have tried to find an answer on the net and in these forums but to no avail.

Thank you in advance

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #1 on: December 26, 2018, 00:39:26 »
I have not seen anything like that.  It is Windows that manage what windows should become active when anohter closes. MC do not do a lot of that it self since apps can't steal focus when they want.

How to you start a copy of files.. Is MC copy files using its own copy operation or does it uses Windows windows copy operation.  (Is the Windows progress dialog shown or MC one ?)

KevanB

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Losing Focus When Task Complete
« Reply #2 on: December 26, 2018, 12:15:50 »
Dear Mathias,

Thank you very much for the reply.

I am using the MC copy - the MC progress screen shows.  It also happens when deleting files.  It seems to be anything that leaves the originating directory empty at the end of the process.  I noticed from looking back through the forum that someone else mentioned this back in Nov'12.

I suspect this is a W10 "feature" as I think it occurs in LibreOffice , but I need to check the circumstances.

I can stop it by altering Core Settings\Filesystem\Copy & Move and Delete options to keep the progress box open after the operation so it not a major issue just a little inconvenient.

Regards,

Kevan

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #3 on: December 28, 2018, 14:24:44 »
Hmm I have not seen that happen. But I got a faint memory of a similar issue that was fixed by updating graphic drivers..

All file operation are happening in the background in its own thread.. so the main app is not locked. But windows should be able to active MC when windows is closed. But if you move away and are doing other work in other windows during the file operations. Then
It might not work. since windows have already activated another window and the OP does not allow other apps to steal focus from an app that is active. But If you do not do anything MC should be the next windows in the active window stack and it should be active.
Should like a Windows,  I'm running Win10 1809 now and I'm not able to recreate it.  It is a very strange behaviour

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #4 on: December 28, 2018, 14:58:58 »
Actually I think was able to trigger it sometimes in Win10 1809, but not in 1803,  ( I Think...)  ,   This must be a bug in Windows
« Last Edit: December 28, 2018, 15:46:58 by Mathias (Author) »

Guuffee

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Losing Focus When Task Complete
« Reply #5 on: December 31, 2018, 19:15:46 »
Hi,
Have the same issue. Win 10/1809, MC running either from portable or local drive installed instance.
After longer operations (even if focus is not changed to other application during copying/moving) focus is automatically switched to application which was active before MC.
It sometimes happens few times in a row - as I do some operations one after another.
Otherwise - I'm happy with your product. THX:)
« Last Edit: December 31, 2018, 19:30:05 by Guuffee »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #6 on: January 03, 2019, 14:14:00 »
Yes Something have changed in Windows 10 1809 to make this happens.

I believe it to be a bug. Or MS have change how the rules on how Windows decide on what window to activate,
I reported the bug, But if Microsoft fix it is another issue. I'm waiting a while before wasting time to look for a workaround.

What happens in MC is because the progress windows for file operation is shown from its one background thread. (so that the main UI is not blocked).
So I'm looking for more programs that do this that also suffers from the change in Windows. so they can be reported to the Windows Team so they might fix the issue.
So if you see this issue in other apps please let me know.

Jengo

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Losing Focus When Task Complete
« Reply #7 on: March 09, 2019, 00:47:33 »
I had this issue also for some time now and tried different things to find out where it came from without success. Then today I specifically installed Windows 1809 on my second machine—where the bug did not occur—just to test if the new Windows version was the problem. And: yes it was. After that I found this thread.  ::)

I figured that it only happens if in the move/copy/delete dialog a message box is triggered where you have to choose an option. After you made the choice and the move/copy/delete dialog closes Multi Commander doesn’t get the focus back but the last used window before Multi Commander gets it.

If you want to trigger the bug, delete a non-empty folder or try to delete a used file.

Matthias515566

  • Power Member
  • ****
  • Posts: 323
    • View Profile
Re: Losing Focus When Task Complete
« Reply #8 on: March 09, 2019, 02:19:53 »
I have not seen anything like that
i reported this already...... http://forum.multicommander.com/forum/index.php?topic=2666.msg9164#msg9164

Maybe you can change the kind of the progress windows that they are no longer have a own place in the taskbar. This boxes should be inside of MC and not outside with a own place on the taskbar.
« Last Edit: March 09, 2019, 02:27:18 by Matthias515566 »

Jengo

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Losing Focus When Task Complete
« Reply #9 on: March 09, 2019, 07:36:16 »
i reported this already...... http://forum.multicommander.com/forum/index.php?topic=2666.msg9164#msg9164

I had seen your post, too. But this thread is older, and heading and description are more detailed. That’s why I choose to post here, even though Matthias (Author) posted a more recent answer in your thread.

But I think, you have a good point. It’s odd that the copy/move/delete dialog gets its own icon in the task bar and is not stacked above the “main” icon. Maybe this might really solve the problem.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #10 on: March 10, 2019, 17:55:22 »
I have not seen anything like that
i reported this already...... http://forum.multicommander.com/forum/index.php?topic=2666.msg9164#msg9164

Maybe you can change the kind of the progress windows that they are no longer have a own place in the taskbar. This boxes should be inside of MC and not outside with a own place on the taskbar.
That is not the problem. Problem is that Windows have change how they decided what window to but pack into focus. It's a bug in Windows. But since not many program does this. I suspect this bug is not there top priorotiy.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #11 on: March 10, 2019, 18:00:29 »
i reported this already...... http://forum.multicommander.com/forum/index.php?topic=2666.msg9164#msg9164

I had seen your post, too. But this thread is older, and heading and description are more detailed. That’s why I choose to post here, even though Matthias (Author) posted a more recent answer in your thread.

But I think, you have a good point. It’s odd that the copy/move/delete dialog gets its own icon in the task bar and is not stacked above the “main” icon. Maybe this might really solve the problem.

That is not the problem.  What is shown on the taskbar does not matter. Problem is that when active windows goes away the next window in the stack should be set to focus.
And most of the times it is MC. But if you navigated away from MC And then back to the progress windows, Then it should not be MC that pops up when it goes away.
Problem is that Windows takes the wrong window. But it only happens in some special condition like when windows are run from background thread and dialog is not modal.

Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Losing Focus When Task Complete
« Reply #12 on: April 01, 2019, 13:24:05 »
I've had the same problem since win10 1809.
When I have multiple windows open it will pull up the last viewed window, losing MC focus.
I do not need to navigate away during the MC operation, just to move around with MC & other windows running.
e.g. I use the browser then switch to MC, run an op, wait for MC to complete it's task & then browser will pop-up.
BUT If I navigate up/out from the source dir whilst op is running I do not lose focus

I am suspicious of the VGA driver involvement in this as it appears more frequent on some AMD driver versions than on NVDA.  I do not have enough different hardware to test this suspicion fully tho :(
« Last Edit: April 01, 2019, 18:30:03 by Ulfhednar »

Jengo

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Losing Focus When Task Complete
« Reply #13 on: April 01, 2019, 19:05:49 »
I am suspicious of the VGA driver involvement in this as it appears more frequent on some AMD driver versions than on NVDA.  I do not have enough different hardware to test this suspicion fully tho :(

I think this is not related to any video driver issues since I have an Intel GPU (inside a CPU) and an nVIDIA GPU which both show the same behavior.

And Matthias already stated that this seems to be a bug in the window handler of Windows 10 1809.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Losing Focus When Task Complete
« Reply #14 on: April 03, 2019, 13:03:56 »
No, Gfx drivers is not the cause.. it is a change/bug in Windows since Windows 1809.
And I'm working on a workaround, whoever it require a lot of redesign in how progress dialogs and error dialog are handled, So it have taken some times but it is almost ready for the next beta version.


Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Losing Focus When Task Complete
« Reply #15 on: April 04, 2019, 11:34:03 »
OK thanks guys.
I had a sequence of different hardware, different driver builds & variable focus loss on 2 PCs with W10 so I wondered... Navigating away within MC seems to always defeat this loss tho.
Thanks for creating some code to handle this Mathias ;)