Skip to content

Engine CefSharp

Taiizor edited this page Jun 5, 2026 · 1 revision

Engine: CefSharp

Sucrose.Live.CefSharp is Sucrose's bundled-Chromium browser engine, built on the Chromium Embedded Framework via CefSharp.Wpf.HwndHost with offscreen (windowless) rendering. It renders all five browser-capable types — Gif, Url, Web, Video, and YouTube — and is the default engine for Url, Web, and YouTube. Unlike WebView, it ships its own CEF native binaries and serves themes over a built-in local HTTP server. Together with WebView, it is one of the two engines that deliver Sucrose's audio-reactive and system-status JavaScript APIs. This page covers the technology, supported types, the VC++ runtime requirement and auto-download, CEF settings, command-line arguments, the local HTTP server, the JS bridge, the customization panel, and extra handlers.

Table of contents

At a glance

Property Value
Assembly Sucrose.Live.CefSharp.exe
Tech CEF / CefSharp (CefSharp.Wpf.HwndHost, windowless rendering)
Supported types Gif, Url, Web, Video, YouTube
Default for Url, Web, YouTube
Preprocessor symbols ENGINE, LIVE_CEFSHARP
Runtime requirement VC++ Redistributable ≥ 14.40.33816.0 (auto-download offered)
Local serving Built-in Watson.Lite HTTP server (http://localhost:{port}/)
Interactivity Yes (uses RawInput.Sharp)
Audio/system-data injection Yes (Web type)
Properties panel PropertiesType.CefSharp

Technology

CefSharp embeds the Chromium Embedded Framework through CefSharp.Wpf.HwndHost, running with offscreen / windowless rendering (WindowlessRenderingEnabled = true). The CEF native binaries are shipped with the engine, so unlike WebView it does not depend on a separately-installed evergreen runtime.

Supported wallpaper types

CefSharp renders all of Gif, Url, Web, Video, and YouTube, and is the default engine for Url, Web, and YouTube. It does not render the Application type (that is Aurora-only). See Type Url, Type Web, Type YouTube, Type Gif, and Type Video.

Runtime requirement and auto-download

The pre-launch Check reads the Visual C++ Redistributable version from the registry (SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\{x86|x64|ARM64}) and requires 14.40.33816.0. If the installed version is too old, a dialog offers four options:

Option Behavior
Continue Proceed anyway
Download Fetch VC_redist.{arch}.exe from SMMRU.VCRedist and install it
Remember Snooze the prompt
Close Exit the engine

See Runtime Dependencies and System Requirements.

CEF settings

The engine configures CefSettings with:

  • UserAgent = SMMG.UserAgent — the Sucrose user agent string.
  • PersistSessionCookies = true.
  • IgnoreCertificateErrors = true.
  • Cache folder %AppData%\<App>\Cache\CefSharp.
  • Native log file CefSharpNative-*.log.
  • Locale auto-selected from the *.pak files matching the current culture.

Command-line arguments

Arguments come from the engine setting CefArguments (defaults in Internal.CefArguments, in dictionary form). They mirror WebView's flags, for example:

disable-gpu-compositing
off-screen-rendering-enabled=1
multi-threaded-message-loop
no-sandbox
autoplay-policy=no-user-gesture-required
Setting Effect
HardwareAcceleration ON enable-gpu=1 + enable-gpu-vsync=1
HardwareAcceleration OFF disable-gpu=1 + disable-gpu-vsync=1 (skipped on Germanium)
DeveloperPort (Developer Mode) sets RemoteDebuggingPort (handled like WebView's remote debugging)

Germanium note: if the engine detects a Germanium Windows build variant (IsGermanium()), it removes the disable-gpu-compositing flag, and the Hardware-Acceleration-OFF GPU flags are skipped for that variant.

See Settings Wallpaper and Settings Other.

Local HTTP server

CefSharp serves the theme through a built-in Watson.Lite web server (SSECSEWWS = Sucrose.Shared.Engine.CefSharp.Extension.WatsonWebServer). LocalServer.Host() provides the base URL (http://localhost:{port}/), and the server is stopped on exit. This is the main delivery difference from WebView: WebView serves via file:///, while CefSharp serves the same theme over localhost HTTP. See Create Web Architecture.

JavaScript bridge: audio and system data

CefSharp is one of the two engines (the other is WebView) that deliver Sucrose's live-data JavaScript APIs to Web-type wallpapers:

  • The theme ships a SucroseCompatible.json declaring the JS callbacks it wants (SystemAudio, VolumeLevel, SystemBios, SystemDate, SystemTheme, SystemMemory, SystemBattery, SystemGraphic, SystemNetwork, SystemStorage, SystemProcessor, SystemMotherboard, plus LoopMode/ShuffleMode/ThemeType/StretchMode).
  • If SystemAudio is declared, the engine flips Backgroundog's AudioRequired flag, starts a communication channel (CommunicationType: Pipe / Signal / Transmission), and injects the data into the page via the browser's ExecuteScriptAsync path.
  • Customization controls are pushed via the property file watcher using the JS template SucrosePropertyListener('{0}', {1});.

See Create Audio API, Create System API, Create JS Bridge, and Create Property Listener Filters.

Customization panel

When you click Customize on a CefSharp wallpaper, the Property service renders the PropertiesType.CefSharp panel from the CefProperties JSON. It exposes the same filter set as WebView:

Control Notes
scale (zoom)
saturate
hue-rotate
brightness
contrast
blur
grayscale
sepia
invert
mirror Dropdown
animation Flat / Flip / Pulse / Shake / Bounce / Wiggle
playbackRate
muted Toggle
caption Toggle

See Customizing Wallpaper and Property Service.

Extra handlers

The CefSharp shared project adds several Chromium-specific handlers and extensions beyond the common engine layer:

  • CustomContextMenu, CustomKeyboard, CustomDownload handlers.
  • Screenshot and Interaction extensions.

Strengths and limitations

Strengths

  • Default engine for Url, Web, and YouTube — no setup needed for the common web cases.
  • Bundles its own CEF binaries, so it does not depend on an evergreen browser runtime being installed.
  • Full support for audio-reactive and system-status Web wallpapers.
  • Offscreen rendering plus extra handlers (context menu, keyboard, download, screenshot, interaction).
  • Interactive (mouse/keyboard via RawInput.Sharp).

Limitations

  • Requires the VC++ Redistributable (≥ 14.40.33816.0); offers an auto-download if missing.
  • Cannot render the Application type.
  • Larger on-disk footprint than WebView because it ships CEF binaries; browser overhead is higher than native MpvPlayer for plain Gif/Video.

See also

Home

Getting Started

Wallpaper Types

Using Sucrose

Settings Reference

Creating Wallpapers

Engine Reference

Automation & Command Line

Architecture & Internals

Data, Files & Diagnostics

Building & Contributing

Help & Support

Clone this wiki locally