mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1031362 Part2: Refine InkCollector to enable it only on Win7. r=smaug
This commit is contained in:
parent
d908d1a2d4
commit
2c0f3cacb5
@ -112,3 +112,11 @@ WinPointerEvents::GetPointerPenInfo(uint32_t aPointerId,
|
||||
}
|
||||
return getPointerPenInfo(aPointerId, aPenInfo);
|
||||
}
|
||||
|
||||
bool
|
||||
WinPointerEvents::ShouldEnableInkCollector()
|
||||
{
|
||||
// We need InkCollector on Win7. For Win8 or later, we handle WM_POINTER* for
|
||||
// pen.
|
||||
return !IsWin8OrLater();
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public:
|
||||
bool GetPointerType(uint32_t aPointerId, POINTER_INPUT_TYPE *aPointerType);
|
||||
bool GetPointerInfo(uint32_t aPointerId, POINTER_INFO *aPointerInfo);
|
||||
bool GetPointerPenInfo(uint32_t aPointerId, POINTER_PEN_INFO *aPenInfo);
|
||||
|
||||
bool ShouldEnableInkCollector();
|
||||
private:
|
||||
// Function prototypes
|
||||
typedef BOOL (WINAPI* GetPointerTypePtr)(uint32_t aPointerId,
|
||||
|
@ -582,7 +582,9 @@ nsWindow::nsWindow()
|
||||
// Init theme data
|
||||
nsUXThemeData::UpdateNativeThemeInfo();
|
||||
RedirectedKeyDownMessageManager::Forget();
|
||||
InkCollector::sInkCollector = new InkCollector();
|
||||
if (mPointerEvents.ShouldEnableInkCollector()) {
|
||||
InkCollector::sInkCollector = new InkCollector();
|
||||
}
|
||||
|
||||
Preferences::AddBoolVarCache(&gIsPointerEventsEnabled,
|
||||
"dom.w3c_pointer_events.enabled",
|
||||
@ -617,8 +619,10 @@ nsWindow::~nsWindow()
|
||||
|
||||
// Global shutdown
|
||||
if (sInstanceCount == 0) {
|
||||
InkCollector::sInkCollector->Shutdown();
|
||||
InkCollector::sInkCollector = nullptr;
|
||||
if (InkCollector::sInkCollector) {
|
||||
InkCollector::sInkCollector->Shutdown();
|
||||
InkCollector::sInkCollector = nullptr;
|
||||
}
|
||||
IMEHandler::Terminate();
|
||||
NS_IF_RELEASE(sCursorImgContainer);
|
||||
if (sIsOleInitialized) {
|
||||
@ -4178,7 +4182,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
|
||||
// Messages should be only at topLevel window.
|
||||
&& nsWindowType::eWindowType_toplevel == mWindowType
|
||||
// Currently this scheme is used only when pointer events is enabled.
|
||||
&& gfxPrefs::PointerEventsEnabled()) {
|
||||
&& gfxPrefs::PointerEventsEnabled() && InkCollector::sInkCollector) {
|
||||
InkCollector::sInkCollector->SetTarget(mWnd);
|
||||
InkCollector::sInkCollector->SetPointerId(pointerId);
|
||||
}
|
||||
@ -5351,6 +5355,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
||||
case MOZ_WM_PEN_LEAVES_HOVER_OF_DIGITIZER:
|
||||
{
|
||||
LPARAM pos = lParamToClient(::GetMessagePos());
|
||||
MOZ_ASSERT(InkCollector::sInkCollector);
|
||||
uint16_t pointerId = InkCollector::sInkCollector->GetPointerId();
|
||||
if (pointerId != 0) {
|
||||
WinPointerInfo pointerInfo;
|
||||
|
Loading…
Reference in New Issue
Block a user