I've written two different implementations of a snap-to-window behaviour, but right now I have a problem I don't quite know how to deal with. As it is now a window doesn't care about how the other windows are layered and will snap to the closest window, even if the closest window is all covered. I don't think this is a desired behaviour, but I don't know what to do about it. I'm not quite familar with the properties of a window. Like what is meant by a window being visible? I also don't know what the desired behaviour should be. Should windows only snap to top layered windows, or any part of a visible window?
Any input or suggestions would be appreciated. Mattias