#54365: fix: don't crash creating a framed window on Wayland without a Linux UI theme
Description of Change
Fixes #49244.
After this change a framed BrowserWindow on Wayland opens without a title bar instead of crashing the process when no Linux UI toolkit is available (GTK failing under snap confinement, minimal VMs, missing XDG directories).
The client-side frame path dereferenced ui::LinuxUiTheme::GetForProfile() without a null check, and it is null in exactly those environments. Chrome checks the same call and falls back to its own frame.
CreateFrameView now uses the toolkit frame only when a theme exists and otherwise falls back to the self-drawn frame already used for frameless windows, logging a warning. Built and run on Linux; the no-toolkit branch was verified by reading, not on a confined snap.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
Notes: Fixed a crash when creating a framed window on Wayland in environments where GTK could not initialize.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron