Hi tinypoodle
Switching the desktop probably changes the root window. In order to capture the window you clicked on, imlib2.grab
needs to know its position, size, etc. I believe that involves making a series of calls to X starting with the root windows
ID to find all the child window IDs until a match is found. If the window you clicked on does not exist on that desktop,
it won't be found and nothing is captured. Even if it could be found, you would get a black (or gray) image since the
image imlib2.grab creates is of what is visible on the screen.