Charging puts computer into sleep mode

I have a problem with the power management on my laptop.

Basically whenever I plug in or unplug my laptop from the mains supply my laptop goes into sleep mode.

It’s quite annoying especially if i’m downloading something.

This doesn’t happen in Windows so must be a linux issue.

Does anyone know how I can fix this?

Just some to further testing and power management doesn’t seem to be working properly at all.

If I suspend my computer.
The first time I try to wake it up it will go on the log in screen for a second then go to sleep again. It only wakes up fully the second time.

If I hibernate it doesn’t wake up properly at all.

I just get a blank screen and then have to hold the power button down for a bit to force it to switch off.

I have a Toshiba Equium/Satellite A100 - 338

Anyone with the same or similar model of laptop to mine know how I can get power management working properly?

Which desktop? KDE4 or Gnome? These things can be configured, don’t know about GNOME, but in KDE4 you can make it do whatever you want, through systemsettings - powermanagement. Play around with the profiles and when the laptop should switch to another profile.

It’s gnome.

The power management features in gnome seem to be very basic.

Is it possible to switch between Gnome and KDE and back again without reinstalling everything?

Or can I use KDE power management features in Gnome?

Never mind.

I searched the software manager for toshiba and it found a program called fnfx. The description says ‘Support for function key combinations on Toshiba laptops’

Anyway this program not only got the function keys working but it has also fixed the power management issues I was getting.

Although this seems to be fixed for the asking person someone may have a similar problem in the future.
I had this problem also and found a workaround.
Under GNOME 2.28 and my notebook went to sleep if I plug in or plug out the power plug.
I discovered that on this occasions only the display was logged if I changed the Power Management Preferences (reach it with right click on the battery in the Notification Area).

For both registers “On AC Power” and “On Battery Power” you have to change the action for “If laptop lid is closed” to “Blank screen”.

So I still have to unlock the display but not to wake the hole laptop from “sleep” like “hibernate” (suspend-to-disk)or “suspend” (suspend-to-ram).

The hardware of notebooks/the kernel/GNOME Power Manager seems not always to distinguish between plugging in/out external power supply (or the [temporal] electrical power variation caused by that) and the signal if the lid/ is closed.

There seems to be a bug report in “GNOME Power Manager”: