Ejemplo n.º 1
0
/**
 * Inform VBox that we are no longer aware of advanced graphics functions
 * (i.e. dynamic resizing, seamless).
 *
 * @returns TRUE for success, FALSE for failure
 */
Bool
vboxDisableGraphicsCap(VBOXPtr pVBox)
{
    TRACE_ENTRY();
    if (!pVBox->useDevice)
        return FALSE;
    return RT_SUCCESS(VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS));
}
Ejemplo n.º 2
0
status_t VBoxDisplayService::_ServiceThread()
{
    LogFlow(("VBoxDisplayService::_ServiceThread"));

    VbglR3CtlFilterMask(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0);
    VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0);
    for (;;)
    {
        uint32_t events;
        int rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 5000, &events);
        if (rc == -6) // timed out?
            continue;

        if (RT_SUCCESS(rc))
        {
            uint32_t cx, cy, cBits, iDisplay;
            int rc2 = VbglR3GetDisplayChangeRequest(&cx, &cy, &cBits, &iDisplay, true);
            LogFlow(("rc2=%d screen %d size changed (%d, %d, %d)\n", rc2, iDisplay, cx, cy, cBits));

            if (RT_SUCCESS(rc2))
            {
                display_mode mode;
                fScreen.GetMode(&mode);
                if (cBits == 0)
                    cBits = get_depth_for_color_space(mode.space);

                mode.timing.h_display = cx;
                mode.timing.v_display = cy;
                mode.space            = get_color_space_for_depth(cBits);
                mode.virtual_width    = cx;
                mode.virtual_height   = cy;

                /*= {
                    {0, cx, 0, 0, cBits * cx / 8, cy, 0, 0, cBits * cy / 8, 0},
                    get_color_space_for_depth(cBits),
                    cx, cy, 0, 0, 0
                };*/

                fScreen.SetMode(&mode, false);
            }
        }
        else
            fExiting = true;

        LogFlow(("processed host event rc = %d\n", rc));
        if (fExiting)
            break;
    }
    return 0;
}