VirtualBox

Ignore:
Timestamp:
Jun 11, 2014 11:30:54 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94334
Message:

FE/Qt: Runtime UI: save visible region when resizing.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r51537 r51602  
    225225    m_fUpdatesAllowed = false;
    226226
     227    /* While updates are disabled, visible region will be saved:  */
     228    m_pendingSyncVisibleRegion = QRegion();
     229
    227230    /* Acquire new pending bitmap: */
    228231    m_pendingSourceBitmap = 0;
     
    393396    }
    394397
    395     /* We are directly updating synchronous visible-region: */
    396     m_syncVisibleRegion = region;
    397     /* And send async-signal to update asynchronous one: */
    398     LogRel2(("UIFrameBuffer::SetVisibleRegion: Rectangle count=%lu, Sending to async-handler..\n",
    399              (unsigned long)uCount));
    400     emit sigSetVisibleRegion(region);
     398    if (m_fUpdatesAllowed)
     399    {
     400        /* We are directly updating synchronous visible-region: */
     401        m_syncVisibleRegion = region;
     402        /* And send async-signal to update asynchronous one: */
     403        LogRel2(("UIFrameBuffer::SetVisibleRegion: Rectangle count=%lu, Sending to async-handler..\n",
     404                 (unsigned long)uCount));
     405        emit sigSetVisibleRegion(region);
     406    }
     407    else
     408    {
     409        /* Save the region. */
     410        m_pendingSyncVisibleRegion = region;
     411        LogRel2(("UIFrameBuffer::SetVisibleRegion: Rectangle count=%lu, Saved..\n",
     412                 (unsigned long)uCount));
     413    }
    401414
    402415    /* Unlock access to frame-buffer: */
     
    575588    }
    576589
     590    lock();
     591
    577592    /* Enable screen updates: */
    578     lock();
    579593    m_fUpdatesAllowed = true;
     594
     595    if (!m_pendingSyncVisibleRegion.isEmpty())
     596    {
     597        /* Directly update synchronous visible-region: */
     598        m_syncVisibleRegion = m_pendingSyncVisibleRegion;
     599        m_pendingSyncVisibleRegion = QRegion();
     600
     601        /* And send async-signal to update asynchronous one: */
     602        LogRel2(("UIFrameBuffer::resizeEvent: Rectangle count=%lu, Sending to async-handler..\n",
     603                 (unsigned long)m_syncVisibleRegion.rectCount()));
     604        emit sigSetVisibleRegion(m_syncVisibleRegion);
     605    }
     606
    580607    unlock();
    581608}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r51543 r51602  
    299299      * because NotifyUpdate doesn't take into account these changes. */
    300300    QRegion m_asyncVisibleRegion;
     301    /** When the framebuffer is being resized, visible region is saved here.
     302      * The saved region is applied when updates are enabled again. */
     303    QRegion m_pendingSyncVisibleRegion;
    301304    /** @} */
    302305
Note: See TracChangeset for help on using the changeset viewer.

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