- Timestamp:
- Apr 16, 2013 6:34:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r44529 r45580 159 159 160 160 NOREF(uScreenId); 161 /* A resize event can happen while we are switching machine view classes, 162 * but we synchronise afterwards so that shouldn't be a problem. We must 163 * temporarily remove the framebuffer in Display though while switching 164 * to respect the thread synchronisation logic (see UIFrameBuffer.h). */ 161 *pbFinished = FALSE; 162 lock(); /* See comment in setView(). */ 165 163 if (m_pMachineView) 166 164 QApplication::postEvent(m_pMachineView, … … 169 167 uWidth, uHeight)); 170 168 else 171 {172 169 /* Report to the VM thread that we finished resizing and rely on the 173 170 * synchronisation when the new view is attached. */ 174 171 *pbFinished = TRUE; 175 return S_OK; 176 } 177 178 *pbFinished = FALSE; 172 unlock(); 173 179 174 return S_OK; 180 175 } … … 201 196 *pbSupported = TRUE; 202 197 203 if (!m_pMachineView) 204 return S_OK; 205 QSize screen = m_pMachineView->maxGuestSize(); 198 lock(); /* See comment in setView(). */ 199 QSize screen; 200 if (m_pMachineView) 201 screen = m_pMachineView->maxGuestSize(); 202 unlock(); 206 203 if ( (screen.width() != 0) 207 204 && (uWidth > (ULONG)screen.width()) … … 250 247 ++ rects; 251 248 } 252 QApplication::postEvent(m_pMachineView, new UISetRegionEvent(reg)); 249 lock(); /* See comment in setView(). */ 250 if (m_pMachineView) 251 QApplication::postEvent(m_pMachineView, new UISetRegionEvent(reg)); 252 unlock(); 253 253 254 254 return S_OK; … … 272 272 void UIFrameBuffer::setView(UIMachineView * pView) 273 273 { 274 /* We are not supposed to use locking for things which are done 275 * on the GUI thread. Unfortunately I am not clever enough to 276 * understand the original author's wise synchronisation logic 277 * so I will do it anyway. */ 278 lock(); 274 279 m_pMachineView = pView; 275 280 m_WinId = (m_pMachineView && m_pMachineView->viewport()) ? (LONG64)m_pMachineView->viewport()->winId() : 0; 276 } 281 unlock(); 282 }
Note:
See TracChangeset
for help on using the changeset viewer.