From 0bca109ad82088bacae8805eeefb142259557eba Mon Sep 17 00:00:00 2001 From: dbuechel Date: Tue, 27 Aug 2019 11:25:38 +0200 Subject: [PATCH] SEBWIN-141: Made workaround for initial touch activation of browser control permanent, as there appears to be no other way to fix the issue. --- SafeExamBrowser.Browser/BrowserControl.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SafeExamBrowser.Browser/BrowserControl.cs b/SafeExamBrowser.Browser/BrowserControl.cs index 6902dd01..4436c2ab 100644 --- a/SafeExamBrowser.Browser/BrowserControl.cs +++ b/SafeExamBrowser.Browser/BrowserControl.cs @@ -6,6 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System; using CefSharp; using CefSharp.WinForms; using SafeExamBrowser.Contracts.UserInterface.Browser; @@ -107,5 +108,16 @@ namespace SafeExamBrowser.Browser { GetBrowser().SetZoomLevel(level); } + + protected override IWindowInfo CreateBrowserWindowInfo(IntPtr handle) + { + const uint WS_EX_NOACTIVATE = 0x8000000; + var windowInfo = base.CreateBrowserWindowInfo(handle); + + // Ensures that input elements within the browser control actually receive input when activated via touch. + windowInfo.ExStyle &= ~WS_EX_NOACTIVATE; + + return windowInfo; + } } }