Another experiment shows that bringing a window to the front by setting its index to 1 doesn’t give the window focus. The above GIF shows that. Note that the window made front seems to have focus briefly then loses it. Does anyone know how to give the front window the focus? I suppose I can just click on it, but I was hoping for something cleaner.