Changeset 39711 in vbox
- Timestamp:
- Jan 6, 2012 5:58:41 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r39493 r39711 790 790 ComObjPtr<Progress> mptrCancelableProgress; 791 791 792 /* The purpose of caching of some events is probably in order to 793 automatically fire them at new event listeners. However, there is no 794 (longer?) any code making use of this... */ 795 #ifdef CONSOLE_WITH_EVENT_CACHE 792 796 struct 793 797 { … … 803 807 uint32_t height; 804 808 com::SafeArray<BYTE> shape; 805 } 806 mpsc; 809 } mpsc; 807 810 808 811 /** OnMouseCapabilityChange() cache */ … … 813 816 BOOL supportsRelative; 814 817 BOOL needsHostCursor; 815 } 816 mcc; 818 } mcc; 817 819 818 820 /** OnKeyboardLedsChange() cache */ … … 823 825 bool capsLock; 824 826 bool scrollLock; 825 } 826 klc; 827 } klc; 827 828 828 829 void clear() 829 830 { 830 /* We cannot do memset() on mpsc to avoid cleaning shape's vtable */ 831 RT_ZERO(mcc); 832 RT_ZERO(klc); 833 834 /* We cannot RT_ZERO mpsc because of shape's vtable. */ 831 835 mpsc.shape.setNull(); 832 836 mpsc.valid = mpsc.visible = mpsc.alpha = false; 833 837 mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0; 834 ::memset(&mcc, 0, sizeof mcc);835 ::memset(&klc, 0, sizeof klc);836 838 } 837 } 838 mCallbackData; 839 } mCallbackData; 840 #endif 839 841 ComPtr<IEventListener> mVmListener; 840 842 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r39647 r39711 699 699 unconst(mEventSource).setNull(); 700 700 701 #ifdef CONSOLE_WITH_EVENT_CACHE 701 702 mCallbackData.clear(); 703 #endif 702 704 703 705 LogFlowThisFuncLeave(); … … 5700 5702 AssertComRCReturnVoid(autoCaller.rc()); 5701 5703 5704 #ifndef CONSOLE_WITH_EVENT_CACHE 5705 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 5706 #else 5702 5707 /* We need a write lock because we alter the cached callback data */ 5703 5708 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 5721 5726 mCallbackData.mpsc.shape.resize(0); 5722 5727 mCallbackData.mpsc.valid = true; 5728 #endif 5723 5729 5724 5730 fireMousePointerShapeChangedEvent(mEventSource, fVisible, fAlpha, xHot, yHot, width, height, ComSafeArrayInArg(pShape)); … … 5740 5746 AssertComRCReturnVoid(autoCaller.rc()); 5741 5747 5748 #ifndef CONSOLE_WITH_EVENT_CACHE 5749 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 5750 #else 5742 5751 /* We need a write lock because we alter the cached callback data */ 5743 5752 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 5748 5757 mCallbackData.mcc.needsHostCursor = needsHostCursor; 5749 5758 mCallbackData.mcc.valid = true; 5759 #endif 5750 5760 5751 5761 fireMouseCapabilityChangedEvent(mEventSource, supportsAbsolute, supportsRelative, needsHostCursor); … … 5800 5810 AssertComRCReturnVoid(autoCaller.rc()); 5801 5811 5812 #ifndef CONSOLE_WITH_EVENT_CACHE 5813 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 5814 #else 5802 5815 /* We need a write lock because we alter the cached callback data */ 5803 5816 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 5808 5821 mCallbackData.klc.scrollLock = fScrollLock; 5809 5822 mCallbackData.klc.valid = true; 5823 #endif 5810 5824 5811 5825 fireKeyboardLedsChangedEvent(mEventSource, fNumLock, fCapsLock, fScrollLock); … … 6925 6939 mVMDestroying = false; 6926 6940 6941 #ifdef CONSOLE_WITH_EVENT_CACHE 6927 6942 if (SUCCEEDED(rc)) 6928 6943 mCallbackData.clear(); 6944 #endif 6929 6945 6930 6946 LogFlowThisFuncLeave();
Note:
See TracChangeset
for help on using the changeset viewer.