LibWebView+UI: Migrate some UI process init to LibWebView

No need to do this setup in every UI's main().
This commit is contained in:
Timothy Flynn 2025-06-10 19:20:46 -04:00 committed by Tim Flynn
parent 6430b215af
commit 39da2d9a2f
Notes: github-actions[bot] 2025-06-11 11:27:28 +00:00
10 changed files with 80 additions and 91 deletions

View file

@ -9,6 +9,7 @@
#include <AK/Platform.h>
#include <LibCore/Directory.h>
#include <LibCore/Environment.h>
#include <LibCore/Process.h>
#include <LibCore/Resource.h>
#include <LibCore/ResourceImplementationFile.h>
#include <LibCore/System.h>
@ -122,4 +123,18 @@ ErrorOr<Vector<ByteString>> get_paths_for_helper_process(StringView process_name
return paths;
}
ErrorOr<void> handle_attached_debugger()
{
#if defined(AK_OS_LINUX)
// Let's ignore SIGINT if we're being debugged because GDB incorrectly forwards the signal to us even when it's set
// to "nopass". See https://sourceware.org/bugzilla/show_bug.cgi?id=9425 for details.
if (TRY(Core::Process::is_being_debugged())) {
dbgln("Debugger is attached, ignoring SIGINT");
TRY(Core::System::signal(SIGINT, SIG_IGN));
}
#endif
return {};
}
}