From 8799a18c2e444b8aaa9fe2b429b373056be8829f Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Fri, 12 May 2017 00:02:30 +0900 Subject: [PATCH] Fix Firefox crashes on showing a move in full screen Since 78e2c1c, CallWndProc updates the current hook state on every WM_SETFOCUS for IE10 or later. Firefox crushes by this on expanding a movie to full screen. This fix makes CallWndProc update the state only on foreground windows or IE tabs. --- xkeymacsdll/xkeymacsdll.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xkeymacsdll/xkeymacsdll.cpp b/xkeymacsdll/xkeymacsdll.cpp index 5fbe565..45ddeab 100644 --- a/xkeymacsdll/xkeymacsdll.cpp +++ b/xkeymacsdll/xkeymacsdll.cpp @@ -260,8 +260,10 @@ LRESULT CALLBACK CXkeymacsDll::CallWndProc(int nCode, WPARAM wParam, LPARAM lPar SetIMEState(false); break; case WM_SETFOCUS: - SetIMEState(false); - ShowHookState(); + if (cwps->hwnd == GetForegroundWindow() || GetWindowLong(cwps->hwnd, GWL_STYLE) == 0x56000000) { + SetIMEState(false); + ShowHookState(); + } break; case WM_NCACTIVATE: if (cwps->wParam && cwps->hwnd == GetForegroundWindow()) { -- 2.11.0