Page MenuHome

Fix T55589: Microsoft Surface pens does not send first events when moves
ClosedPublic

Authored by Christopher Peerman (chris_82) on Jan 13 2019, 10:15 PM.

Details

Summary

I took a look at this an found we were getting a WM_GESTURENOTIFY event and then nothing for quite a while. Suspecting that the Gesture recognition architecture may be to blame I turned it off using RegisterTouchWindow. When testing this disables the gesture API and immediately sends all events to our window for processing.

Also still works with Wintab :)

Diff Detail

Repository
rB Blender

Event Timeline

intern/ghost/intern/GHOST_WindowWin32.cpp
388

When you free m_user32 here, won't getDPIHint below run into trouble?

Christopher Peerman (chris_82) marked 2 inline comments as done.Jan 13 2019, 10:45 PM

I created this based off the blender2.8 branch.

intern/ghost/intern/GHOST_WindowWin32.cpp
388

It's freeing up the reference to user32.dll in the destructor. We shouldn't be calling anything after the destructor is called so getDPIHint shouldn't run into trouble. Here is the full context:

GHOST_WindowWin32::~GHOST_WindowWin32()
{
	if (m_Bar) {
		m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
		m_Bar->Release();
	}

	if (m_wintab) {
		GHOST_WIN32_WTClose fpWTClose = (GHOST_WIN32_WTClose) ::GetProcAddress(m_wintab, "WTClose");
		if (fpWTClose) {
			if (m_tablet)
				fpWTClose(m_tablet);
			delete m_tabletData;
			m_tabletData = NULL;
		}
	}

	if (m_customCursor) {
		DestroyCursor(m_customCursor);
		m_customCursor = NULL;
	}

	if (m_hWnd != NULL && m_hDC != NULL && releaseNativeHandles()) {
		::ReleaseDC(m_hWnd, m_hDC);
	}

	if (m_hWnd) {
		if (m_dropTarget) {
			// Disable DragDrop
			RevokeDragDrop(m_hWnd);
			// Release our reference of the DropTarget and it will delete itself eventually.
			m_dropTarget->Release();
		}
		::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, NULL);
		::DestroyWindow(m_hWnd);
		m_hWnd = 0;
	}

	if (m_user32) {
		FreeLibrary(m_user32);
		m_user32 = NULL;
	}
}
This revision is now accepted and ready to land.Jan 14 2019, 12:25 PM
This revision was automatically updated to reflect the committed changes.