I've rebased it with after clipping changes, and split it into 4 different patches now. They all solve parts of the same bug though.
As a recap, the problem lies when we're clipping fullscreen windows and then doing window operations like creating a new X Window, move/resize dragging, and capturing mouse pointer.
It's likely not a very common situation since most times "fullscreen windows" means games or video players or the like, which have only one window, but the bug report should have details that it can happen with normal window creations or menus or whatever, and affects at least one app.