I'm having the same problem with Ubuntu 7.04, kernel 2.6.20-15-generic on a IBM T40 laptop. It seems like the problem goes away if I go to Power Management and change "When battery is critcally low" to "Do nothing". I guess there is a defect in the Power Management application so it think's there is no power left when the laptop is switching from battery to power supply.
I'm having the same problem with Ubuntu 7.04, kernel 2.6.20-15-generic on a IBM T40 laptop. It seems like the problem goes away if I go to Power Management and change "When battery is critcally low" to "Do nothing". I guess there is a defect in the Power Management application so it think's there is no power left when the laptop is switching from battery to power supply.