Removing the pending bound query on unregistration orphans any query already
awaiting it: nothing else in the dispatcher can complete it, so the js promise
never settles and the PromiseHolder and CefV8Context behind it stay alive.
Answer those waiters with false instead.
A source is only still pending at this point when the registration bailed out
because the main frame had no V8 context yet, which is the normal path for
objects the host registers before the first document loads.
* Fix high idle CPU from 1 kHz CEF message pump on macOS
The delay CEF passes to OnScheduleMessagePumpWork is a deadline, but it was
being used as the period of a recurring Observable.Interval. CEF requests 0
for the vast majority of calls, so the delayMs <= 0 -> 1 floor installed a
permanent 1 kHz pump and an idle app sat at roughly half a CPU core.
Poll at a fixed 30 Hz instead, matching cefclient's MainMessageLoopExternalPump
(kMaxTimerDelay) and CefSharp's WpfBrowserProcessHandler, and pump immediately
when CEF asks for work now. The interval is overridable via AppContext or an
environment variable, clamped so it cannot reintroduce either failure mode.
* Update Directory.Build.props
* Pump at Default priority and keep one immediate pump in flight
DispatcherPriority.Normal is not Avalonia's normal priority: Default is 0 and
Normal is 5, second from the top, above Render (4). Pumping at it let CEF
preempt layout and repaint on the path that fires most often, since CEF asks
for a 0 delay the vast majority of the time.
Default rather than Background or Input: Dispatcher.ExecuteJobsCore only runs
jobs at Input priority and below while the platform reports no pending OS
input, so either would stall the pump exactly while the user types or scrolls.
Default is the lowest priority still dispatched unconditionally, and it sits
below every render priority.
The immediate path also had no coalescing. OnScheduleMessagePumpWork is called
from any thread and every notification queued its own dispatcher job, even
though one DoMessageLoopWork drains everything pending. An Interlocked flag
keeps a single pump in flight, cleared before the pump runs so work CEF
schedules from inside DoMessageLoopWork still queues a fresh notification.
---------
Co-authored-by: Hélder Gonçalves <helder.goncalves@outsystems.com>
* Add previous attempts back
* Update README.md
* Minor fixes
- Removed unnecessary stuff on CefGlue.Common.targets
- Removed removal of important Avalonia stuff on the CefGlue.Demo.Avalonia project.
- Added an exception for the case of libcef not found on CefRuntime.cs (still crashes on Linux).
* load libcef before version check
* Update README.md
* Update README.md
* Linux support
* Missing check _needDispose.
* Fix DevTools in Linux.
* Update README.md
* Update README.md
* Update README.md
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/AvaloniaControl.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/AvaloniaControl.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update README.md
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Apply suggestions from code review
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Create LINUX.md
* Update README.md
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update README.md
* Update README.md
* Update CefGlue.CopyLocal.props
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update BrowserCefApp.cs
* Update AvaloniaControl.cs
* Put properties after the constructor
* Apply suggestions from code review
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
* Simplified platform detection logic
* Update CefRuntime.cs
* Update CefGlue/CefRuntime.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue/CefRuntime.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Fix build and update packages
* Raise version
---------
Co-authored-by: haltroy <thehaltroy@gmail.com>
Co-authored-by: Shaojun Li <i@shaojun.li>
* Add previous attempts back
* Update README.md
* Minor fixes
- Removed unnecessary stuff on CefGlue.Common.targets
- Removed removal of important Avalonia stuff on the CefGlue.Demo.Avalonia project.
- Added an exception for the case of libcef not found on CefRuntime.cs (still crashes on Linux).
* load libcef before version check
* Update README.md
* Update README.md
* Linux support
* Missing check _needDispose.
* Fix DevTools in Linux.
* Update README.md
* Update README.md
* Update README.md
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/AvaloniaControl.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/AvaloniaControl.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update README.md
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Apply suggestions from code review
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Create LINUX.md
* Update README.md
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update README.md
* Update README.md
* Update CefGlue.CopyLocal.props
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update BrowserCefApp.cs
* Update AvaloniaControl.cs
* Put properties after the constructor
* Apply suggestions from code review
* Update CefGlue.Avalonia/Platform/Linux/XWindow.cs
* Simplified platform detection logic
* Update CefRuntime.cs
* Update CefGlue/CefRuntime.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update CefGlue/CefRuntime.cs
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Apply suggestions from code review
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Update BrowserCefApp.cs
---------
Co-authored-by: Shaojun Li <i@shaojun.li>
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
Co-authored-by: João Neves <joao.neves@outsystems.com>
* Avalonia 11 upgrade
* Add missing styles
* Fix tests
* Raise version
* Upgrade avalonia to GA
* Update Directory.Packages.props
* Osr scale fix (#123)
* Updated OSR to use device scaling and added Viewbox container for Image host control.
* Update AvaloniaOffScreenControlHost.cs
Needs to use _control not e.Source, not sure why but must be something when packaged into the WebView
* Revised DeviceScaleFactor initialization.
* Accidentally commited key event changes...
* Apply suggestions from code review
* Fixes for AlphaFormat and DeviceScaleFactor setup
* Apply suggestions from code review
---------
Co-authored-by: João Neves <joaomiguelneves@gmail.com>
* Use Avalonia 11.0.9
* Organized imports for changed files
* Add popup handling example
---------
Co-authored-by: tkefauver <tkefauver@gmail.com>
Co-authored-by: João Mano <joao.mano@outsystems.com>