Patent ID: 7624352

Claim:
A method for managing an original user interface of an application, the method comprising: generating, via a system thread, a plurality of events for handling by the application; generating a timestamp, via the system thread, comprising a time when each of the plurality of events are entered in an event queue of the application; checking, via the system thread, the event queue to determine the time when a last event in the plurality of events entered in the event queue, was handled by the application; signaling a hung state for the application when the application has not handled any of the plurality of events in the event queue for greater than a threshold time, wherein different types of events in the plurality of events entered in the event queue have their own threshold times; creating a ghost user interface in response to the hung state that appears in place of the original user interface, wherein creating the ghost user interface includes creating a ghost thread, which, in turn, creates the ghost user interface, wherein the ghost thread handles at least one event corresponding to a close operation in an area covered by the ghost user interface, the close operation comprising a forced termination of the application having the hung state, wherein the application is terminated by automatically invoking a computer operating system application program, wherein the plurality of events are divided into two sets of events, wherein a first set of events is handled by the ghost thread in lieu of the application, and wherein a second set of events is cached for later handling by the application after the application is no longer in the hung state, wherein the second set of events comprises input events with the ghost user interface in focus, wherein the ghost user interface is in focus when the ghost user interface is in the foreground; placing a high priority special event in an event queue of the application; and replacing the ghost user interface with the original user interface as a result of the high priority special event being handled by the application, wherein the high priority special event is handled ahead of other entries in the event queue, wherein the other entries in the event queue comprise a last location of the ghost user interface corresponding to a present location of the ghost user interface and which replaces, in the event queue, at least one intermediate move command previously executed on the ghost user interface, and wherein the last location of the ghost user interface is utilized as a location to restore the original user interface of the application.