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

@@ -982,6 +982,7 @@ public class SkiaEditor : SkiaView
{
base.OnFocusLost();
SkiaVisualStateManager.GoToState(this, SkiaVisualStateManager.CommonStates.Normal);
Completed?.Invoke(this, EventArgs.Empty);
}
#region Selection and Clipboard

View File

@@ -84,7 +84,7 @@ public class SkiaImage : SkiaView
!_pendingSvgReload)
{
_pendingSvgReload = true;
ReloadSvgDebounced();
_ = ReloadSvgDebounced();
}
}
}
@@ -427,7 +427,7 @@ public class SkiaImage : SkiaView
{
_lastArrangedBounds = bounds;
Console.WriteLine($"[SkiaImage] Arrange detected larger bounds: {width}x{height} vs loaded {_svgLoadedWidth}x{_svgLoadedHeight}");
LoadSvgAtSizeAsync(_currentFilePath, width, height);
_ = LoadSvgAtSizeAsync(_currentFilePath, width, height);
}
}
}

View File

@@ -693,7 +693,7 @@ public class SkiaShell : SkiaLayoutView
}
SetCurrentContent(root.Content);
Title = root.Title;
Title = root.Title ?? string.Empty;
Invalidate();
}

View File

@@ -759,6 +759,11 @@ public class SkiaWebView : SkiaView
public void LoadHtml(string html, string? baseUrl = null)
{
Console.WriteLine($"[WebView] LoadHtml called, html length: {html?.Length ?? 0}");
if (string.IsNullOrEmpty(html))
{
Console.WriteLine("[WebView] Cannot load HTML - html is null or empty");
return;
}
if (!_isInitialized) Initialize();
if (_webView == IntPtr.Zero || _webkitLoadHtml == null)
{
@@ -869,6 +874,7 @@ public class SkiaWebView : SkiaView
public void ShowNativeWindow()
{
if (_isEmbedded) return; // Already embedded
if (!_isInitialized) Initialize();
if (_gtkWindow == IntPtr.Zero) return;
@@ -918,7 +924,15 @@ public class SkiaWebView : SkiaView
if (gdkWindow != IntPtr.Zero)
{
_gtkX11Window = gdk3_x11_window_get_xid(gdkWindow);
Console.WriteLine($"[WebView] GTK X11 window: {_gtkX11Window}");
if (_gtkX11Window != IntPtr.Zero)
{
_isProperlyReparented = true;
Console.WriteLine($"[WebView] GTK X11 window: {_gtkX11Window} (reparented successfully)");
}
else
{
Console.WriteLine($"[WebView] GTK X11 window: failed to get XID");
}
}
PositionUsingGtk();
@@ -1073,13 +1087,20 @@ public class SkiaWebView : SkiaView
}
catch { }
int offsetX = 0, offsetY = 0;
int screenX = destX + (int)Bounds.Left - offsetX;
int screenY = destY + (int)Bounds.Top - offsetY;
// Track main window position changes
bool mainWindowMoved = destX != _lastMainX || destY != _lastMainY;
if (mainWindowMoved)
{
_lastMainX = destX;
_lastMainY = destY;
}
int screenX = destX + (int)Bounds.Left;
int screenY = destY + (int)Bounds.Top;
int width = Math.Max(100, (int)Bounds.Width);
int height = Math.Max(100, (int)Bounds.Height);
if (Math.Abs(screenX - _lastPosX) > 2 || Math.Abs(screenY - _lastPosY) > 2 ||
if (mainWindowMoved || Math.Abs(screenX - _lastPosX) > 2 || Math.Abs(screenY - _lastPosY) > 2 ||
Math.Abs(width - _lastWidth) > 2 || Math.Abs(height - _lastHeight) > 2)
{
Console.WriteLine($"[WebView] Move to ({screenX}, {screenY}), size ({width}x{height}), mainWin=({destX},{destY}), bounds=({Bounds.Left},{Bounds.Top})");