Abstract:
A computer and a method for controlling an operating state of a device thereof are disclosed. The method comprises: detecting that a display portion and a host portion of the computer are in a state of being disconnected from each other; and generating a state event or a control instruction corresponding to the disconnected state for switching the device to an inactive state. With the present invention, when the state of a computer changes, e.g., when a display portion and a host portion of a portable computer are separated, an operating system can control a device to switch its operating state, e.g., deactivate the device, based on a generated state event. In this way, it is possible to avoid unnecessary power consumption of the entire computer due to the active state of the device, and any potential security risk can be eliminated.