Mouse wheel scrolls to the end when used in the first time after some period

When I scroll the first time after without interacting (for example reading for a long time) in an application using the mouse wheel the scroll of document jumps to the beginning or to the end, depending if I scroll down or up. It is a problem of Mate, because using another desktop it doesn't occur. Is there some fix to it?