I have an old project where I wanted to make your desktop into a physics sandbox. I wrote a 20 line C program which read the size of all open windows and streamed that to my Java program, which in turn created a JBox2D body of each window. Maximized windows and any window behind them were ignored. I then drew these using Java2D to a fully transparent fullscreen JFrame. It worked, but the performance of a 1920x1080 transparent JFrame was laughable, and I also had some problems when windows were moved around (kaboooooom said the physics), so I dropped it. It did "work" though.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org