I use two monitors for my Ubuntu box. At some point, for whatever reason, the two monitors were swapped. I switched back in system settings. But it kept behaving strangely. When it boots up, the two were still swapped, and swapped back after I logged in. After logging in the mouse cursor strangely sticks to the border between the two monitors.
Later I found a tip here to set the primary monitor in Ubuntu and this fixed all problems.