Not really SCL problem but CefSharp
 
Forums / SmartComponent Library - Developer Forum / Not really SCL problem but CefSharp

Not really SCL problem but CefSharp

4 posts, 0 answered
  1. Patrik Wikström
    Patrik Wikström avatar
    73 posts
    Registered:
    15 Oct 2018
    14 Jan
    Link to this post
    Do any of you have experience with CefSharp in that way that if it is active in your Progress application then it occasionally is missing keyboard events e.g. misses characters even when you are typing in Progress fields. Found some things about this but haven't manage to solve this problem.

    We have it setup as single threaded and using a Timer for the call Cef:DoMessageLoopWork.
    ...
    mSettings:MultiThreadedMessageLoop = FALSE.
    ...
    CefSharp.Cef:DoMessageLoopWork().
    ...
  2. Mike Fechner
    Mike Fechner avatar
    343 posts
    Registered:
    14 Sep 2016
    16 Jan in reply to Patrik Wikström
    Link to this post
    I haven't experienced that issue. But we are not using Progress GUI Widgets that much anywhere.

    Can you provide details? 

    And can you also share some references to the "some things" you have found - probably on the Internet? 
  3. Patrik Wikström
    Patrik Wikström avatar
    73 posts
    Registered:
    15 Oct 2018
    16 Jan in reply to Mike Fechner
    Link to this post

    https://github.com/cztomczak/cefpython/issues/246
    "Using external message pump will improve performance, but it is also required to get rid of some bugs, like missing keyboard events on Mac/Windows reported on the CEF Forum"

    Under the title "MultiThreadedMessageLoop", we have had the Timer-based solution in use. Not the one described as a better solution, because of mulithreding issues using that approach.

    "A more advanced option involves setting CefSettings.ExternalMessagePump = true; and implementing IBrowserProcessHandler.OnScheduleMessagePumpWork. This allows CEF to notify when it needs to perform work, in some instances this may make your application more responsive. "
    https://github.com/cefsharp/CefSharp/wiki/General-Usage

    What we are looking into now is to create a .NET class that would call an event on the main UI thread and which could be subscribed from an ABL class.

    Some Progress and .NET co-operation links:
    https://community-archive.progress.com/forums/00019/36671.html
    https://community-archive.progress.com/forums/00019/00842.html

  4. Patrik Wikström
    Patrik Wikström avatar
    73 posts
    Registered:
    15 Oct 2018
    1 day and 22 hours ago
    Link to this post
    We might have solved this problem by creating a .NET native class and dll for BrowserProcessHandler e.g. our quick and dirty is something like below. The input value of 30 is the value for the Timer Interval (1000 / 30) that the .NET class uses.

                DEFINE VARIABLE xTaskScheduler AS "System.Threading.Tasks.TaskScheduler" NO-UNDO.

                IF SynchronizationContext:Current <> ? THEN
                    xTaskScheduler = TaskScheduler:FromCurrentSynchronizationContext().
                ELSE
                    xTaskScheduler = TaskScheduler:Current.

                mSettings:ExternalMessagePump = TRUE.
                xInitialize = CefSharp.Cef:Initialize(mSettings, TRUE, NEW ScheduleMessagePumpBrowserProcessHandler(xTaskScheduler, 30)).

4 posts, 0 answered