How to unfocus (blur) Python-gi GTK+3 window on Linux
问题 What I want to do and why I want my window to unfocus, so the previous focused window is selected. Why? I want to interact with the previously selected window (from other programs). My current plan is: unfocus my window, use libxdo to simulate keystrokes, then focus my window again. My window can be set on top to help avoid flicking. Should be good enough. Looks simple to me. But I can't get it to work. What I've tried so far Hiding the window with Gtk.Widget.hide() and then showing it again: