When you click on the mouse, glutpassivemotionfunc () is actually executed first than glutmousefunc ()! Just concluded, I don't know right.