Changeset 46359 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 3, 2013 12:24:48 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86173
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r46342 r46359 42 42 : m_pMachineView(pMachineView) 43 43 , m_width(0), m_height(0) 44 , m_fIs Deleted(false)45 #if defined (Q_OS_WIN32)44 , m_fIsScheduledToDelete(false) 45 #ifdef Q_OS_WIN 46 46 , m_iRefCnt(0) 47 #endif 47 #endif /* Q_OS_WIN */ 48 48 { 49 49 /* Assign mahine-view: */ … … 64 64 UIFrameBuffer::~UIFrameBuffer() 65 65 { 66 /* Deinitialize critical-section: */ 66 67 RTCritSectDelete(&m_critSect); 68 69 /* Disconnect NotifyUpdate handler: */ 70 if (m_pMachineView) 71 disconnect(this, SIGNAL(sigNotifyUpdate(int, int, int, int)), 72 m_pMachineView, SLOT(sltHandleNotifyUpdate(int, int, int, int))); 67 73 } 68 74 … … 166 172 BOOL *pbFinished) 167 173 { 168 if (m_fIsDeleted) 174 /* Make sure frame-buffer is not yet scheduled for removal: */ 175 if (m_fIsScheduledToDelete) 169 176 return E_FAIL; 170 177 178 /* Currently screen ID is not used: */ 171 179 NOREF(uScreenId); 180 181 /* Mark request as not-yet-finished: */ 172 182 *pbFinished = FALSE; 173 lock(); /* See comment in setView(). */ 183 184 /* See comment in setView(): */ 185 lock(); 186 187 /* Widget resize is NOT thread safe and never will be, 188 * We have to notify the machine-view with the async event to perform resize operation, 189 * later it will be replaced with signal stuff. */ 174 190 if (m_pMachineView) 175 191 QApplication::postEvent(m_pMachineView, … … 178 194 uWidth, uHeight)); 179 195 else 180 /* Report to the VM thread that we finished resizing and rely on the 196 /* Mark request as finished. 197 * It is required to report to the VM thread that we finished resizing and rely on the 181 198 * synchronisation when the new view is attached. */ 182 199 *pbFinished = TRUE; 183 unlock(); 184 185 return S_OK; 186 } 187 188 STDMETHODIMP UIFrameBuffer::NotifyUpdate(ULONG uX, ULONG uY, ULONG uW, ULONG uH) 189 { 200 201 /* Unlock thread finally: */ 202 unlock(); 203 204 /* Confirm RequestResize: */ 205 return S_OK; 206 } 207 208 STDMETHODIMP UIFrameBuffer::NotifyUpdate(ULONG uX, ULONG uY, ULONG uWidth, ULONG uHeight) 209 { 210 /* Make sure frame-buffer is not yet scheduled for removal: */ 211 if (m_fIsScheduledToDelete) 212 return E_FAIL; 213 190 214 /* See comment in setView(): */ 191 215 lock(); … … 194 218 * So we have to notify the machine-view with the async signal to perform update operation. */ 195 219 if (m_pMachineView) 196 emit sigNotifyUpdate(uX, uY, uW , uH);220 emit sigNotifyUpdate(uX, uY, uWidth, uHeight); 197 221 198 222 /* Unlock thread finally: */ … … 346 370 unlock(); 347 371 } 372 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r46293 r46359 118 118 virtual ~UIFrameBuffer(); 119 119 120 void set Deleted(bool fIsDeleted) { m_fIsDeleted = fIsDeleted; }120 void setScheduledToDelete(bool fIsScheduledToDelete) { m_fIsScheduledToDelete = fIsScheduledToDelete; } 121 121 122 122 NS_DECL_ISUPPORTS 123 123 124 #if defined (Q_OS_WIN32)124 #ifdef Q_OS_WIN 125 125 STDMETHOD_(ULONG, AddRef)() 126 126 { … … 135 135 return cnt; 136 136 } 137 #endif 137 #endif /* Q_OS_WIN */ 138 138 139 139 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) … … 159 159 BOOL *pbFinished); 160 160 161 STDMETHOD(NotifyUpdate) (ULONG uX, ULONG uY, ULONG uW , ULONG uH);161 STDMETHOD(NotifyUpdate) (ULONG uX, ULONG uY, ULONG uWidth, ULONG uHeight); 162 162 163 163 STDMETHOD(VideoModeSupported) (ULONG uWidth, ULONG uHeight, ULONG uBPP, … … 214 214 215 215 virtual void viewportScrolled(int /* iX */, int /* iY */) {} 216 #endif 216 #endif /* VBOX_WITH_VIDEOHWACCEL */ 217 217 218 218 virtual void setView(UIMachineView * pView); … … 226 226 QSize m_scaledSize; 227 227 int64_t m_WinId; 228 bool m_fIs Deleted;228 bool m_fIsScheduledToDelete; 229 229 230 230 /* To avoid a seamless flicker, … … 241 241 QRegion m_asyncVisibleRegion; 242 242 243 #if defined (Q_OS_WIN32)244 243 private: 245 244 245 #ifdef Q_OS_WIN 246 246 long m_iRefCnt; 247 #endif 247 #endif /* Q_OS_WIN */ 248 248 }; 249 249 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r46293 r46359 530 530 { 531 531 /* Warn framebuffer about its no more necessary: */ 532 m_pFrameBuffer->set Deleted(true);532 m_pFrameBuffer->setScheduledToDelete(true); 533 533 /* Detach framebuffer from Display: */ 534 534 CDisplay display = session().GetConsole().GetDisplay(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45736 r46359 957 957 { 958 958 /* Warn framebuffer about its no more necessary: */ 959 pFb->set Deleted(true);959 pFb->setScheduledToDelete(true); 960 960 /* Detach framebuffer from Display: */ 961 961 CDisplay display = session().GetConsole().GetDisplay();
Note:
See TracChangeset
for help on using the changeset viewer.