VirtualBox

Changeset 63328 in vbox


Ignore:
Timestamp:
Aug 11, 2016 11:34:03 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8422: Desktop-widget watchdog rework (part 17): Leave the initial available-geometry null, that way we can distinguish the cases when it was 1. initially calculated and 2. recalculated after that; Send recalculated signal only in second case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp

    r63269 r63328  
    207207
    208208#ifdef VBOX_WS_X11
    209     /* Return cached available-geometry: */
    210     return m_availableGeometryData.value(iHostScreenIndex);
     209    /* Get cached available-geometry: */
     210    const QRect availableGeometry = m_availableGeometryData.value(iHostScreenIndex);
     211    /* Return cached available-geometry if it's valid or screen-geometry otherwise: */
     212    return availableGeometry.isValid() ? availableGeometry :
     213           QApplication::desktop()->screenGeometry(iHostScreenIndex);
    211214#else /* !VBOX_WS_X11 */
    212215    /* Redirect call to desktop-widget: */
     
    360363
    361364    /* Apply received data: */
     365    const bool fSendSignal = m_availableGeometryData.value(iHostScreenIndex).isValid();
    362366    m_availableGeometryData[iHostScreenIndex] = availableGeometry;
    363367    /* Forget finished worker: */
     
    368372
    369373    /* Notify listeners: */
    370     emit sigHostScreenWorkAreaRecalculated(iHostScreenIndex);
     374    if (fSendSignal)
     375        emit sigHostScreenWorkAreaRecalculated(iHostScreenIndex);
    371376}
    372377#endif /* VBOX_WS_X11 */
     
    439444        /* Get the screen-geometry: */
    440445        const QRect hostScreenGeometry = screenGeometry(iHostScreenIndex);
    441         /* Use the screen-geometry as the temporary value for available-geometry: */
    442         m_availableGeometryData[iHostScreenIndex] = hostScreenGeometry;
    443446
    444447        /* Connect worker listener: */
     
    457460    /* Destroy existing workers: */
    458461    qDeleteAll(m_availableGeometryWorkers);
    459     /* And clear their vectors: */
     462    /* And clear their vector: */
    460463    m_availableGeometryWorkers.clear();
    461     m_availableGeometryData.clear();
    462464}
    463465
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette