On Sat 2016-08-13 20:29:22 -0700, Jameson Graef Rollins wrote: > On Wed, Jun 29 2016, Daniel Kahn Gillmor <d...@fifthhorseman.net> wrote: >> 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. > > How can assword detect that the original window has disappeared? Is > there an xdo command that can provide that info?
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. --dkg