Switching Desktops: Responding to DrvAssertMode

When switching between desktops on a single display, the Window Manager makes sure that the desktops are properly redrawn and that a mouse pointer is enabled and put in the right location. The display device driver receives a call to DrvAssertMode only when there is a desktop switch.

This function causes the driver to make sure the indicated PDEV is in the mode specified when the PDEV was created, or is in text mode. The Window Manager then selects the correct pointer shape and moves it to the current position. Thus, GDI relieves the driver of the responsibility of maintaining the mouse pointer state.

GDI calls the DrvAssertMode function in the display driver to set the mode of a specified hardware device. This function selects either the mode specified when the display driver-defined PDEV structure was created or the default mode of the hardware. The driver should keep a record of the current mode of the PDEV.

GDI also calls DrvAssertMode, with the enable parameter set to FALSE, when the user switches from a windowed application to a full-screen application in x86 applications, or when switching desktops (on all platforms). The display driver must restore the video hardware to a default mode by sending an IOCTL_VIDEO_RESET_DEVICE in an EngDeviceIoControl call to the video port-miniport drivers.