Hover is done by the client telling the compositor it would like the cursor to change its shape if it is over a certain area the client is drawing. But the client does not know where the cursor is or where on the screen the client is (or even if the client is visible at all).