Changeset 52926 in vbox for trunk/src/VBox
- Timestamp:
- Oct 2, 2014 8:41:00 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 96361
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r52319 r52926 1001 1001 ComObjPtr<Progress> mptrCancelableProgress; 1002 1002 1003 /* The purpose of caching of some events is probably in order to1004 automatically fire them at new event listeners. However, there is no1005 (longer?) any code making use of this... */1006 #ifdef CONSOLE_WITH_EVENT_CACHE1007 struct1008 {1009 /** OnMousePointerShapeChange() cache */1010 struct1011 {1012 bool valid;1013 bool visible;1014 bool alpha;1015 uint32_t xHot;1016 uint32_t yHot;1017 uint32_t width;1018 uint32_t height;1019 com::SafeArray<BYTE> shape;1020 } mpsc;1021 1022 /** OnMouseCapabilityChange() cache */1023 struct1024 {1025 bool valid;1026 BOOL supportsAbsolute;1027 BOOL supportsRelative;1028 BOOL needsHostCursor;1029 } mcc;1030 1031 /** OnKeyboardLedsChange() cache */1032 struct1033 {1034 bool valid;1035 bool numLock;1036 bool capsLock;1037 bool scrollLock;1038 } klc;1039 1040 void clear()1041 {1042 RT_ZERO(mcc);1043 RT_ZERO(klc);1044 1045 /* We cannot RT_ZERO mpsc because of shape's vtable. */1046 mpsc.shape.setNull();1047 mpsc.valid = mpsc.visible = mpsc.alpha = false;1048 mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;1049 }1050 } mCallbackData;1051 #endif1052 1003 ComPtr<IEventListener> mVmListener; 1053 1004 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r52921 r52926 806 806 unconst(mEventSource).setNull(); 807 807 808 #ifdef CONSOLE_WITH_EVENT_CACHE809 mCallbackData.clear();810 #endif811 812 808 LogFlowThisFuncLeave(); 813 809 } … … 6338 6334 } 6339 6335 6340 #ifdef CONSOLE_WITH_EVENT_CACHE6341 /**6342 * @note Locks this object for writing.6343 */6344 #endif6345 6336 void Console::i_onMousePointerShapeChange(bool fVisible, bool fAlpha, 6346 6337 uint32_t xHot, uint32_t yHot, … … 6357 6348 AssertComRCReturnVoid(autoCaller.rc()); 6358 6349 6359 #ifdef CONSOLE_WITH_EVENT_CACHE6360 {6361 /* We need a write lock because we alter the cached callback data */6362 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);6363 6364 /* Save the callback arguments */6365 mCallbackData.mpsc.visible = fVisible;6366 mCallbackData.mpsc.alpha = fAlpha;6367 mCallbackData.mpsc.xHot = xHot;6368 mCallbackData.mpsc.yHot = yHot;6369 mCallbackData.mpsc.width = width;6370 mCallbackData.mpsc.height = height;6371 6372 /* start with not valid */6373 bool wasValid = mCallbackData.mpsc.valid;6374 mCallbackData.mpsc.valid = false;6375 6376 com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape));6377 if (aShape.size() != 0)6378 mCallbackData.mpsc.shape.initFrom(aShape);6379 else6380 mCallbackData.mpsc.shape.resize(0);6381 mCallbackData.mpsc.valid = true;6382 }6383 #endif6384 6350 com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape)); 6385 6351 if (!mMouse.isNull()) … … 6394 6360 } 6395 6361 6396 #ifdef CONSOLE_WITH_EVENT_CACHE6397 /**6398 * @note Locks this object for writing.6399 */6400 #endif6401 6362 void Console::i_onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, 6402 6363 BOOL supportsMT, BOOL needsHostCursor) … … 6407 6368 AutoCaller autoCaller(this); 6408 6369 AssertComRCReturnVoid(autoCaller.rc()); 6409 6410 #ifdef CONSOLE_WITH_EVENT_CACHE6411 {6412 /* We need a write lock because we alter the cached callback data */6413 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);6414 6415 /* save the callback arguments */6416 mCallbackData.mcc.supportsAbsolute = supportsAbsolute;6417 mCallbackData.mcc.supportsRelative = supportsRelative;6418 mCallbackData.mcc.needsHostCursor = needsHostCursor;6419 mCallbackData.mcc.valid = true;6420 }6421 #endif6422 6370 6423 6371 fireMouseCapabilityChangedEvent(mEventSource, supportsAbsolute, supportsRelative, supportsMT, needsHostCursor); … … 6454 6402 } 6455 6403 6456 #ifdef CONSOLE_WITH_EVENT_CACHE6457 /**6458 * @note Locks this object for writing.6459 */6460 #endif6461 6404 void Console::i_onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock) 6462 6405 { 6463 6406 AutoCaller autoCaller(this); 6464 6407 AssertComRCReturnVoid(autoCaller.rc()); 6465 6466 #ifdef CONSOLE_WITH_EVENT_CACHE6467 {6468 /* We need a write lock because we alter the cached callback data */6469 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);6470 6471 /* save the callback arguments */6472 mCallbackData.klc.numLock = fNumLock;6473 mCallbackData.klc.capsLock = fCapsLock;6474 mCallbackData.klc.scrollLock = fScrollLock;6475 mCallbackData.klc.valid = true;6476 }6477 #endif6478 6408 6479 6409 fireKeyboardLedsChangedEvent(mEventSource, fNumLock, fCapsLock, fScrollLock); … … 7529 7459 else 7530 7460 mVMDestroying = false; 7531 7532 #ifdef CONSOLE_WITH_EVENT_CACHE7533 if (SUCCEEDED(rc))7534 mCallbackData.clear();7535 #endif7536 7461 7537 7462 LogFlowThisFuncLeave();
Note:
See TracChangeset
for help on using the changeset viewer.