Author Topic: Stop command if target window focus is lost  (Read 3106 times)

kourou

  • Jr. Member
  • **
  • Posts: 81
  • Anything that can go wrong will go wrong
    • FANNY (Discord)
Stop command if target window focus is lost
« on: November 30, 2019, 07:59:25 AM »
Hi there,  ;D
got a weird issue since VA update to 1.8.2, all my commands that have the option "stop command if target window is lost" checked, are trigerred even if my window is closed and not running. the window i am targetting is specified at a profile level.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Stop command if target window focus is lost
« Reply #1 on: November 30, 2019, 08:07:03 AM »
Are you sure this issue is only occurring now that you've updated to v1.8.2?

On my machine this behavior is exhibited by v1.7.8 as well (the behavior being if a target is specified that doesn't exist, it will use the active window, and the command will stop if the active window loses focus or is closed).


EDIT: Did you update from a version earlier than v1.7.8? v1.7.7 and earlier refuse to execute the command when the target is not found, unlike v1.7.8 which executes it regardless.

EDIT#2: If a command contains a keypress action, it is still prevented from executing in v1.8.2 when the "Stop command if target window focus is lost" option is checked.

kourou

  • Jr. Member
  • **
  • Posts: 81
  • Anything that can go wrong will go wrong
    • FANNY (Discord)
Re: Stop command if target window focus is lost
« Reply #2 on: November 30, 2019, 08:12:36 AM »
Are you sure this issue is only occurring now that you've updated to v1.8.2?

On my machine this behavior is exhibited by v1.7.8 as well (the behavior being if a target is specified that doesn't exist, it will use the active window, and the command will stop if the active window loses focus or is closed) with the target dropdown on the main window (which the profile-specific option replaces).

Yes it's new i have never seen that in any previous versions of VA. I don't target the active window i specified my window name at the profile level.
I also noticied that the field target window at general level (va main window) disapeared  :-\ even if i don't use this field.

kourou

  • Jr. Member
  • **
  • Posts: 81
  • Anything that can go wrong will go wrong
    • FANNY (Discord)
Re: Stop command if target window focus is lost
« Reply #3 on: November 30, 2019, 08:16:03 AM »
i think my previous version was 1.8 at least, i didn' t see the 1.8.1, or just i didn't noticed the updating. am on steam version by the way

kourou

  • Jr. Member
  • **
  • Posts: 81
  • Anything that can go wrong will go wrong
    • FANNY (Discord)
Re: Stop command if target window focus is lost
« Reply #4 on: November 30, 2019, 08:27:30 AM »
I've made a simple profile to test this, and i target the window at a command level, same issue. The window doesn't exist, the game not launched. VA is executed as Admin. Screenshot attached  ;)

kourou

  • Jr. Member
  • **
  • Posts: 81
  • Anything that can go wrong will go wrong
    • FANNY (Discord)
Re: Stop command if target window focus is lost
« Reply #5 on: November 30, 2019, 08:31:51 AM »
By the way, i think my previous version of VA was 1.7.8 since i haven't launched it since previous week end.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Stop command if target window focus is lost
« Reply #6 on: November 30, 2019, 07:18:27 PM »
I am able to reproduce this.  At some point, the check for an active target was stripped out on every action and only occurs when actual input is needed (for instance this all works fine if you have an action that, say, presses a key in a target window).  This was probably done for performance reasons, but threw the baby out with the bathwater.

I'll see what I can do.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Stop command if target window focus is lost
« Reply #7 on: November 30, 2019, 10:00:02 PM »
Ok -  if you guys want to give a try to what I've got so far, I've uploaded just the .exe (v1.8.2.1) to the, 'unofficial' sites (standalone and Steam):

http://voiceattack.com/unofficial     

and

http://voiceattack.com/unofficialsteam


There was some over-eager caching going on that I tidied up a bit.  I also found that if you have the, 'Resume' option selected and the target process is terminated, the resume would just keep waiting until the command was stopped.  There is a lazy check within the resume to check if the process was terminated.  Not necessarily a horrible thing to have it spinning in the background (as it probably doesn't occur that much)- just a little cleaner to have it stop the command and notify you.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Stop command if target window focus is lost
« Reply #8 on: November 30, 2019, 10:46:09 PM »
That appears to work well with my basic test command/profile (Steam and website versions).