Fix compatibility issues. Track mouse manually, use long representation for colors, limit mouse event propagation