From ba03f7f0b1d0c40acf997749949a0b0efe19e6d0 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 12 Feb 2021 10:39:33 -0800 Subject: Fix T85562: Remove Win32 RIM_INPUTSINK Removal of Win32 code that allows background windows to receive raw input. Differential Revision: https://developer.blender.org/D10408 Reviewed by Brecht Van Lommel --- intern/ghost/intern/GHOST_SystemWin32.cpp | 6 ------ intern/ghost/intern/GHOST_WindowWin32.cpp | 10 ---------- 2 files changed, 16 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index b71b6b9e170..fb53357bb24 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1511,12 +1511,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, // Keyboard events, processed //////////////////////////////////////////////////////////////////////// case WM_INPUT: { - // check WM_INPUT from input sink when ghost window is not in the foreground - if (wParam == RIM_INPUTSINK) { - if (GetFocus() != hwnd) // WM_INPUT message not for this window - return 0; - } // else wParam == RIM_INPUT - RAWINPUT raw; RAWINPUT *raw_ptr = &raw; UINT rawSize = sizeof(RAWINPUT); diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 18aa19c0863..377eb61874d 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -220,16 +220,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system, } } - if (parentwindow && !dialog) { - RAWINPUTDEVICE device = {0}; - device.usUsagePage = 0x01; /* usUsagePage & usUsage for keyboard*/ - device.usUsage = 0x06; /* http://msdn.microsoft.com/en-us/windows/hardware/gg487473.aspx */ - device.dwFlags |= - RIDEV_INPUTSINK; // makes WM_INPUT is visible for ghost when has parent window - device.hwndTarget = m_hWnd; - RegisterRawInputDevices(&device, 1, sizeof(device)); - } - // Initialize Windows Ink if (m_user32) { m_fpGetPointerInfoHistory = (GHOST_WIN32_GetPointerInfoHistory)::GetProcAddress( -- cgit v1.2.3