Closed cfraizer closed 3 years ago
I incorporated your changes, but I made one additional change.
I found that some windows (those from Emacs.app) would fail in PHAXUIElement
's processIdentifier
method.
So I changed line 174 in PHApp.m
to call [self.app processIdentifier]
.
(I'm a total Mac programming n00b, so I apologize if I've made this more difficult than it should be! I really appreciate all your help with this.)
Hmn. Something is still wrong. I don't really understand it.
Now PHWindow's focused method is broken. That is, Window.focused()
returns null
.
My guess is that changing the focus through SetFrontProcess
doesn't do the right thing that PHWindow
's focused
method looks at.
@cfraizer Hmm, could you also verify that it triggers the relevant events for focusing?
I'm not sure what you mean. (Sorry that I'm a bozo!) It certainly moves the focus—that is, it raises the correct window and that window has keyboard input focus, but after moving it, then Window.focused()
returns null
.
Ah, never mind on that other problem. I was returning the wrong value from PHApp
's focus
method and that uncovered a weird (ancient) bug in my own JavaScript that caused it to try to call the JS Window.focus()
method on a null object.
I've tested as many variations I can think of and the problem no longer occurs.
[ ] Updated related documentations
[ ] Added the change to the Changelog
I wasn't sure how you wanted to document this, so I didn't.
The only significant change is in
PHApp
'sfocus
method.Of course, I'd be happy to make any changes you suggest.