Fix incomplete functionality, nullable warnings, and async issues

Incomplete functionality fixes:
- SkiaEditor: Wire up Completed event to fire on focus lost
- X11InputMethodService: Remove unused _commitCallback field
- SkiaWebView: Set _isProperlyReparented when reparenting succeeds,
  use _lastMainX/_lastMainY to track main window position,
  add _isEmbedded guard to prevent double embedding

Nullable reference fixes:
- Easing: Reorder BounceOut before BounceIn (static init order)
- GestureManager: Use local command variable instead of re-accessing
- SkiaShell: Handle null Title with ?? operator
- GLibNative: Use null! for closure pattern
- LinuxProgramHost: Default title if null
- SkiaWebView.LoadHtml: Add null/empty check for html
- SystemThemeService: Initialize Colors with default values
- DeviceDisplayService/AppInfoService: Use var for nullable env vars
- EmailService: Add null check for message parameter

Async fixes:
- SkiaImage: Use _ = for fire-and-forget async calls
- SystemTrayService: Convert async method without await to sync Task

Reduces warnings from 156 to 133 (remaining are P/Invoke structs
and obsolete MAUI API usage)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-01 17:20:11 -05:00
parent 7b22d67920
commit c60453ea31
14 changed files with 58 additions and 23 deletions

View File

@@ -41,7 +41,7 @@ public class AppInfoService : IAppInfo
{
try
{
string environmentVariable = Environment.GetEnvironmentVariable("GTK_THEME");
var environmentVariable = Environment.GetEnvironmentVariable("GTK_THEME");
if (!string.IsNullOrEmpty(environmentVariable) && environmentVariable.Contains("dark", StringComparison.OrdinalIgnoreCase))
{
return AppTheme.Dark;

View File

@@ -73,13 +73,13 @@ public class DeviceDisplayService : IDeviceDisplay
private double GetScaleFactor()
{
string gdkScale = Environment.GetEnvironmentVariable("GDK_SCALE");
var gdkScale = Environment.GetEnvironmentVariable("GDK_SCALE");
if (!string.IsNullOrEmpty(gdkScale) && double.TryParse(gdkScale, out var result))
{
return result;
}
string qtScale = Environment.GetEnvironmentVariable("QT_SCALE_FACTOR");
var qtScale = Environment.GetEnvironmentVariable("QT_SCALE_FACTOR");
if (!string.IsNullOrEmpty(qtScale) && double.TryParse(qtScale, out result))
{
return result;

View File

@@ -69,6 +69,7 @@ public class EmailService : IEmail
private static string BuildMailtoUri(EmailMessage? message)
{
var sb = new StringBuilder("mailto:");
if (message == null) return sb.ToString();
// Add recipients
if (message.To?.Count > 0)

View File

@@ -56,7 +56,19 @@ public class SystemThemeService
/// <summary>
/// System colors based on the current theme.
/// </summary>
public SystemColors Colors { get; private set; }
public SystemColors Colors { get; private set; } = new SystemColors
{
Background = SKColors.White,
Surface = new SKColor(0xF5, 0xF5, 0xF5),
Primary = new SKColor(0x21, 0x96, 0xF3),
OnPrimary = SKColors.White,
Text = new SKColor(0x21, 0x21, 0x21),
TextSecondary = new SKColor(0x75, 0x75, 0x75),
Border = new SKColor(0xE0, 0xE0, 0xE0),
Divider = new SKColor(0xE0, 0xE0, 0xE0),
Error = new SKColor(0xF4, 0x43, 0x36),
Success = new SKColor(0x4C, 0xAF, 0x50)
};
private FileSystemWatcher? _settingsWatcher;

View File

@@ -101,7 +101,7 @@ public class SystemTrayService : IDisposable
_ = ShowAsync();
}
private async Task<bool> TryYadTray()
private Task<bool> TryYadTray()
{
try
{
@@ -118,7 +118,7 @@ public class SystemTrayService : IDisposable
};
_trayProcess = Process.Start(startInfo);
if (_trayProcess == null) return false;
if (_trayProcess == null) return Task.FromResult(false);
// Start reading output for menu clicks
_ = Task.Run(async () =>
@@ -137,11 +137,11 @@ public class SystemTrayService : IDisposable
catch { }
});
return true;
return Task.FromResult(true);
}
catch
{
return false;
return Task.FromResult(false);
}
}

View File

@@ -27,7 +27,6 @@ public class X11InputMethodService : IInputMethodService, IDisposable
private XIMProc? _preeditDoneCallback;
private XIMProc? _preeditDrawCallback;
private XIMProc? _preeditCaretCallback;
private XIMProc? _commitCallback;
public bool IsActive => _isActive;
public string PreEditText => _preEditText;