Files
UXP-Jihad/widget/headless/nsAppShell.cpp
T
NotAlexNoyle 97e18c8f69 headless toolkit
MOZ_WIDGET_TOOLKIT=headless: gfxPlatformHeadless + widget/headless backend + build wiring so libxul can link with no GTK/X (spike; Stage-1 GTK-bundled remains the shipping fallback).

Generated as a clean diff against UXP upstream  (Pale Moon); applies
independently (distinct files) to the pristine third_party/uxp submodule.

Imported from build/desktop/patches/0006-headless-toolkit.patch.
2026-11-03 08:53:27 -05:00

28 lines
923 B
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsAppShell.h"
#include "nsThreadUtils.h"
using mozilla::NewRunnableMethod;
// There is no native event source in the headless backend. XPCOM events are
// processed via the XPCOM thread event queue (NS_ProcessNextEvent), so we wake
// the base app shell by posting a runnable that fires its NativeEventCallback.
void
nsAppShell::ScheduleNativeEventCallback()
{
nsCOMPtr<nsIRunnable> event =
NewRunnableMethod(this, &nsAppShell::NativeEventCallback);
NS_DispatchToCurrentThread(event.forget());
}
bool
nsAppShell::ProcessNextNativeEvent(bool aMayWait)
{
// No native events in a headless process.
return false;
}