#829032 assword does scary things when the window it wants to type into goes away

#829032#5
Date:
2016-06-29 21:33:40 UTC
From:
To:
Some tools that need a password pop up their own password-entry dialog
box.  With the kbd focus in that dialog box, I'll invoke "assword gui"
and choose a password.

Due to circumstances outside of assword's control, sometimes those
dialog boxes go away before i've selected the context from the assword
gui.

If i don't notice that the dialog went away before hitting enter,
assword appears to type the password into some arbitrary window.

instead, assword should decline to type (and possibly should show the
user an error message when it can figure out what happened).

Even better would be if "assword gui" could detect when the target
window goes away, so that it could interrupt the user even before they
select a context.

#829032#10
Date:
2016-08-14 03:29:22 UTC
From:
To:
How can assword detect that the original window has disappeared?  Is
there an xdo command that can provide that info?

jamie.

#829032#15
Date:
2017-04-26 16:26:43 UTC
From:
To:
hm, it looks like the issue is that a window ID can trivially get
reassigned to a new window.  So if we're just storing the window ID and
replaying it, we can end up targeting the new window.

we could be slightly more robust by ensuring that the window's pid stays
the same -- so that we're not targeting an entirely different
application.  That wouldn't fix the situation where a process spawns a
window, removes it, and then spawns a new one that grabs the same
windowid.  But it would catch where a window goes away and a separate
process ends up spawning the window that is restored.

we could also test the windowname to ensure that it's the same thing it
was when we were invoked, as an extra double-check.