No way to determine X11 window xid or xrandr output xid from an AtspiAccessible?
I'm currently writing an X11 window manager for my smartphone. If I connect an external display, mouse and keyboard to it I can use my smartphone like a regular PC. Now, I need to figure out when to show the onscreen keyboard, and I want to only do that if some input field of a window on the smartphone display is active, but not, if one on an external display is. In the future, there may also be multiple windows which have the focus simultaneously, and there may be more than one onscreen keyboard.
My main problem is now, to know if I should show the onscreen keyboard, I need some way to know which focused windows on which screens are "editable" (need some kind of text input). While I can figure out that something editable was focussed using at-spi2, by listening for object:state-changed:focused
and checking what role the focused AtspiAccessible has, there seams, as far as I can tell, to be no reliable way to tell which X11 Window that AtspiAccessible belongs to, nor does there seem to be a reliable way to figure out which xrandr outputs it is on. Please note, since I'm writing an X11 window manager, things which use at-spi2 but don't use X11 aren't relevant in this case.
It would be preferable to me if there was some reliable way to figure out the X11 Window, just knowing the xrandr output / monitor would still be insufficient in some cases, (for example, if I where to implement split screen functionality but I had to hide one window while the onscreen keyboard is visible to fit them all on the screen), but it would still be better than nothing.
I'm also open to alternate suggestions how I could achieve my goal of figuring out when the onscreen keyboard should be shown, as long as those don't change the goal.