diff --git a/CLAUDE.md b/CLAUDE.md index 16661c8..31f9b89 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,64 +1,251 @@ -# CLAUDE.md - CRITICAL INSTRUCTIONS +# CLAUDE.md - OpenMaui Linux Recovery Instructions -## CRITICAL: SOURCE OF TRUTH +## READ THIS FIRST -**DECOMPILED CODE = PRODUCTION VERSION (with all fixes/changes)** -**MAIN BRANCH = OUTDATED VERSION** +This file contains critical instructions for restoring lost production code. **Read this entire file before doing ANY work.** -The decompiled code in `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/` represents the PRODUCTION version that was actually running. It contains all fixes and changes that were made during development. We don't know exactly what was fixed or changed - that work was LOST. +--- -The main branch is OUTDATED and missing those production fixes. +## Background -DO NOT assume main is correct. DO NOT skip files because "they already exist in main". Compare EVERYTHING and apply the differences from decompiled to bring main up to the production state. +Production code was lost. The only surviving copy was recovered by decompiling production DLLs. The decompiled code has ugly syntax but represents the **actual working production code**. -## Merge Process +--- -1. **For EVERY file in decompiled**: Compare with main and APPLY THE FIXES -2. **Embedded classes**: Files like `LayoutHandler.cs` contain multiple classes (GridHandler, StackLayoutHandler, etc.) - these ALL need to be compared and updated with decompiled fixes -3. **Do not skip**: Even if a class "exists" in main, it's likely BROKEN and needs the decompiled version +## The Core Rule + +**DECOMPILED CODE = SOURCE OF TRUTH** + +The decompiled code in the `recovered` folder is what was actually running in production. Your job is to: + +1. Read the decompiled file +2. Understand the LOGIC (ignore ugly syntax) +3. Write that same logic in clean, maintainable C# +4. Save it to the `final` branch + +**Do NOT:** +- Skip files because "main looks fine" +- Assume main is correct +- Change the logic from decompiled +- Stub out code with comments + +--- + +## File Locations + +| What | Path | +|------|------| +| **Target (write here)** | `/Users/nible/Documents/GitHub/maui-linux-main/` | +| **Decompiled Views** | `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform/` | +| **Decompiled Handlers** | `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Handlers/` | +| **Decompiled Services** | `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Services/` | +| **Decompiled Hosting** | `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Hosting/` | + +--- ## Branch -- Work on `final` branch only -- User will review and merge to main +**Work on `final` branch ONLY.** -## Decompiled Code Location +The user will review all changes before merging to main. Always verify you're on `final`: +```bash +git branch # Should show * final +``` -- `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform/` - Views, Types -- `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Handlers/` - Handlers -- `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Hosting/` - Hosting -- `/Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Services/` - Services +--- -## Tracking +## How to Process Each File -Update `/Users/nible/Documents/GitHub/maui-linux-main/MERGE_TRACKING.md` after EVERY change. +### Step 1: Read the decompiled version +``` +Read /Users/nible/Documents/GitHub/recovered/source/OpenMaui/[path]/[FileName].cs +``` -## What Was INCORRECTLY Skipped (Must Be Fixed) +### Step 2: Read the current main version +``` +Read /Users/nible/Documents/GitHub/maui-linux-main/[path]/[FileName].cs +``` -These were skipped because I wrongly assumed main was correct: +### Step 3: Compare the LOGIC +- Ignore syntax differences (decompiler artifacts) +- Look for: missing methods, different behavior, missing properties, different logic flow -### Type files deleted (need to compare and update inline versions): -- All event args in SkiaView.cs, SkiaCheckBox.cs, etc. -- GridLength, GridPosition, AbsoluteLayoutBounds in SkiaLayoutView.cs -- MenuItem, MenuBarItem in SkiaMenuBar.cs -- ShellSection, ShellContent in SkiaShell.cs -- Many more... +### Step 4: If logic differs, update main with clean version +Write the decompiled logic using clean C# syntax. -### Handler files not compared: -- GridHandler (in LayoutHandler.cs) - NEEDS FIXES FROM DECOMPILED -- StackLayoutHandler (in LayoutHandler.cs) - NEEDS FIXES FROM DECOMPILED -- ContentPageHandler (in PageHandler.cs) - NEEDS FIXES FROM DECOMPILED +### Step 5: Build and verify +```bash +dotnet build +``` -### View files not compared: -- SkiaGrid (in SkiaLayoutView.cs) - NEEDS FIXES FROM DECOMPILED -- SkiaStackLayout (in SkiaLayoutView.cs) - NEEDS FIXES FROM DECOMPILED -- SkiaAbsoluteLayout (in SkiaLayoutView.cs) - NEEDS FIXES FROM DECOMPILED -- SkiaContentPage (in SkiaPage.cs) - NEEDS FIXES FROM DECOMPILED -- SkiaFrame (in SkiaBorder.cs) - NEEDS FIXES FROM DECOMPILED +### Step 6: Report what changed +Tell the user specifically what was different, not just "looks equivalent." -## Clean Code Rule +--- -When copying from decompiled, clean up decompiler artifacts: -- `_002Ector` → constructor -- `((Type)(ref var))` patterns → clean casting -- IL comments → remove +## Cleaning Decompiled Code + +### Decompiler artifacts to fix: + +| Ugly (decompiled) | Clean (what you write) | +|-------------------|------------------------| +| `((ViewHandler)(object)handler).PlatformView` | `handler.PlatformView` | +| `((BindableObject)this).GetValue(X)` | `GetValue(X)` | +| `(Type)(object)((x is Type) ? x : null)` | `x as Type` or `x is Type t ? t : null` | +| `//IL_xxxx: Unknown result type` | Delete these comments | +| `_002Ector` | Constructor call | +| `(BindingMode)2` | `BindingMode.TwoWay` | +| `(WebNavigationEvent)3` | `WebNavigationEvent.NewPage` | +| `((Thickness)(ref padding)).Left` | `padding.Left` | +| `((SKRect)(ref bounds)).Width` | `bounds.Width` | + +--- + +## Using Agents (Task Tool) + +Agents work fine IF you give them the right instructions. Previous failures happened because the agent prompts didn't include the critical rules. + +### Required Agent Prompt Template + +When spawning an agent, ALWAYS include this in the prompt: + +``` +## CRITICAL RULES - READ FIRST + +1. DECOMPILED CODE = PRODUCTION (source of truth) +2. MAIN BRANCH = OUTDATED (needs to be updated) +3. Do NOT skip files +4. Do NOT assume main is correct +5. Do NOT say "equivalent" or "no changes needed" without listing every method/property you compared + +## Your Task + +Compare these two files: +- DECOMPILED (truth): [full path to decompiled file] +- MAIN (to update): [full path to main file] + +For each method/property in decompiled: +1. Check if it exists in main +2. Check if the LOGIC is the same (ignore syntax differences) +3. Report: "METHOD X: [exists/missing] [logic same/different]" + +If ANY logic differs or methods are missing, write the clean version to main. + +## Decompiler Syntax to Clean Up +- `((ViewHandler)(object)handler).PlatformView` → `handler.PlatformView` +- `//IL_xxxx:` comments → delete +- `(BindingMode)2` → `BindingMode.TwoWay` +- `((Thickness)(ref x)).Left` → `x.Left` +``` + +### Example Agent Call + +``` +Task tool prompt: +"Compare ButtonHandler files. + +CRITICAL RULES: +1. DECOMPILED = PRODUCTION (truth) +2. MAIN = OUTDATED +3. Do NOT skip or say 'equivalent' without proof + +DECOMPILED: /Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Handlers/ButtonHandler.cs +MAIN: /Users/nible/Documents/GitHub/maui-linux-main/Handlers/ButtonHandler.cs + +List every method in decompiled. For each one, confirm it exists in main with same logic. If different, write the fix." +``` + +### Why Previous Agents Failed + +The prompts said things like "compare these files" without: +- Stating which file is the source of truth +- Requiring method-by-method comparison +- Forbidding "no changes needed" shortcuts + +Agents took shortcuts because the prompts allowed it. + +--- + +## Event Args - Use MAUI's Directly + +**Do NOT create custom event args that duplicate MAUI's types.** + +The codebase currently has custom `WebNavigatingEventArgs` and `WebNavigatedEventArgs` at the bottom of `Views/SkiaWebView.cs`. These are unnecessary and should be removed. Use MAUI's versions directly: + +```csharp +// WRONG - custom event args (remove these) +public class WebNavigatingEventArgs : EventArgs { ... } // in SkiaWebView.cs + +// RIGHT - use MAUI's directly +Microsoft.Maui.Controls.WebNavigatingEventArgs +Microsoft.Maui.Controls.WebNavigatedEventArgs +``` + +### TODO: Cleanup needed + +1. Remove custom event args from `Views/SkiaWebView.cs` (lines 699-726) +2. Update `SkiaWebView` to fire MAUI's event args +3. Update handlers to use MAUI's event args directly (no translation layer) + +### Types that exist in both namespaces + +These MAUI types also exist in our `Microsoft.Maui.Platform` namespace - use MAUI's: + +| Use This (MAUI) | Not This (ours) | +|-----------------|-----------------| +| `Microsoft.Maui.Controls.WebNavigatingEventArgs` | `Microsoft.Maui.Platform.WebNavigatingEventArgs` | +| `Microsoft.Maui.Controls.WebNavigatedEventArgs` | `Microsoft.Maui.Platform.WebNavigatedEventArgs` | +| `Microsoft.Maui.TextAlignment` | `Microsoft.Maui.Platform.TextAlignment` | +| `Microsoft.Maui.LineBreakMode` | `Microsoft.Maui.Platform.LineBreakMode` | + +--- + +## Build Command + +```bash +cd /Users/nible/Documents/GitHub/maui-linux-main +dotnet build +``` + +Build after completing a batch of related changes, not after every single file. + +--- + +## What Was Already Done (This Session) + +Files modified in this session: +- `Handlers/GtkWebViewHandler.cs` - Added (new file from decompiled) +- `Handlers/GtkWebViewProxy.cs` - Added (new file from decompiled) +- `Handlers/WebViewHandler.cs` - Fixed navigation event handling +- `Handlers/PageHandler.cs` - Added MapBackgroundColor +- `Views/SkiaView.cs` - Made Arrange() virtual + +Build status: **SUCCEEDS** as of last check. + +--- + +## Files Still To Process + +The following decompiled files need to be compared with main: +- All files in `Microsoft.Maui.Platform/` (Views) +- All files in `Microsoft.Maui.Platform.Linux.Handlers/` (Handlers) +- All files in `Microsoft.Maui.Platform.Linux.Services/` (Services) +- All files in `Microsoft.Maui.Platform.Linux.Hosting/` (Hosting) + +Use this to list decompiled files: +```bash +ls /Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform/*.cs +ls /Users/nible/Documents/GitHub/recovered/source/OpenMaui/Microsoft.Maui.Platform.Linux.Handlers/*.cs +``` + +--- + +## Summary for New Session + +1. You're restoring production code from decompiled DLLs +2. Decompiled = truth, main = outdated +3. Clean up syntax, preserve logic +4. Work on `final` branch +5. Build after every change +6. Agents work - but MUST include the critical rules in every prompt (see "Using Agents" section) +7. Don't skip files or say "equivalent" without listing every method compared diff --git a/Handlers/GtkWebViewHandler.cs b/Handlers/GtkWebViewHandler.cs new file mode 100644 index 0000000..3e3a16a --- /dev/null +++ b/Handlers/GtkWebViewHandler.cs @@ -0,0 +1,233 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.Maui.Controls; +using Microsoft.Maui.Handlers; +using Microsoft.Maui.Platform.Linux.Native; +using Microsoft.Maui.Platform.Linux.Services; +using SkiaSharp; + +namespace Microsoft.Maui.Platform.Linux.Handlers; + +/// +/// Handler for WebView using native GTK WebKitGTK widget. +/// +public class GtkWebViewHandler : ViewHandler +{ + private GtkWebViewPlatformView? _platformWebView; + private bool _isRegisteredWithHost; + private SKRect _lastBounds; + + public static IPropertyMapper Mapper = new PropertyMapper(ViewHandler.ViewMapper) + { + [nameof(IWebView.Source)] = MapSource, + }; + + public static CommandMapper CommandMapper = new(ViewHandler.ViewCommandMapper) + { + [nameof(IWebView.GoBack)] = MapGoBack, + [nameof(IWebView.GoForward)] = MapGoForward, + [nameof(IWebView.Reload)] = MapReload, + }; + + public GtkWebViewHandler() : base(Mapper, CommandMapper) + { + } + + public GtkWebViewHandler(IPropertyMapper? mapper = null, CommandMapper? commandMapper = null) + : base(mapper ?? Mapper, commandMapper ?? CommandMapper) + { + } + + protected override GtkWebViewProxy CreatePlatformView() + { + _platformWebView = new GtkWebViewPlatformView(); + return new GtkWebViewProxy(this, _platformWebView); + } + + protected override void ConnectHandler(GtkWebViewProxy platformView) + { + base.ConnectHandler(platformView); + if (_platformWebView != null) + { + _platformWebView.NavigationStarted += OnNavigationStarted; + _platformWebView.NavigationCompleted += OnNavigationCompleted; + } + Console.WriteLine("[GtkWebViewHandler] ConnectHandler - WebView ready"); + } + + protected override void DisconnectHandler(GtkWebViewProxy platformView) + { + if (_platformWebView != null) + { + _platformWebView.NavigationStarted -= OnNavigationStarted; + _platformWebView.NavigationCompleted -= OnNavigationCompleted; + UnregisterFromHost(); + _platformWebView.Dispose(); + _platformWebView = null; + } + base.DisconnectHandler(platformView); + } + + private void OnNavigationStarted(object? sender, string uri) + { + Console.WriteLine($"[GtkWebViewHandler] Navigation started: {uri}"); + try + { + GLibNative.IdleAdd(() => + { + try + { + if (VirtualView is IWebViewController controller) + { + var args = new Microsoft.Maui.Controls.WebNavigatingEventArgs( + WebNavigationEvent.NewPage, null, uri); + controller.SendNavigating(args); + Console.WriteLine("[GtkWebViewHandler] Sent Navigating event to VirtualView"); + } + } + catch (Exception ex) + { + Console.WriteLine($"[GtkWebViewHandler] Error in SendNavigating: {ex.Message}"); + } + return false; + }); + } + catch (Exception ex) + { + Console.WriteLine($"[GtkWebViewHandler] Error dispatching navigation started: {ex.Message}"); + } + } + + private void OnNavigationCompleted(object? sender, (string Url, bool Success) e) + { + Console.WriteLine($"[GtkWebViewHandler] Navigation completed: {e.Url} (Success: {e.Success})"); + try + { + GLibNative.IdleAdd(() => + { + try + { + if (VirtualView is IWebViewController controller) + { + var result = e.Success ? WebNavigationResult.Success : WebNavigationResult.Failure; + var args = new Microsoft.Maui.Controls.WebNavigatedEventArgs( + WebNavigationEvent.NewPage, null, e.Url, result); + controller.SendNavigated(args); + + bool canGoBack = _platformWebView?.CanGoBack() ?? false; + bool canGoForward = _platformWebView?.CanGoForward() ?? false; + controller.CanGoBack = canGoBack; + controller.CanGoForward = canGoForward; + Console.WriteLine($"[GtkWebViewHandler] Sent Navigated, CanGoBack={canGoBack}, CanGoForward={canGoForward}"); + } + } + catch (Exception ex) + { + Console.WriteLine($"[GtkWebViewHandler] Error in SendNavigated: {ex.Message}"); + } + return false; + }); + } + catch (Exception ex) + { + Console.WriteLine($"[GtkWebViewHandler] Error dispatching navigation completed: {ex.Message}"); + } + } + + internal void RegisterWithHost(SKRect bounds) + { + if (_platformWebView == null) + return; + + var hostService = GtkHostService.Instance; + if (hostService.HostWindow == null || hostService.WebViewManager == null) + { + Console.WriteLine("[GtkWebViewHandler] Warning: GTK host not initialized, cannot register WebView"); + return; + } + + int x = (int)bounds.Left; + int y = (int)bounds.Top; + int width = (int)bounds.Width; + int height = (int)bounds.Height; + + if (width <= 0 || height <= 0) + { + Console.WriteLine($"[GtkWebViewHandler] Skipping invalid bounds: {bounds}"); + return; + } + + if (!_isRegisteredWithHost) + { + hostService.HostWindow.AddWebView(_platformWebView.Widget, x, y, width, height); + _isRegisteredWithHost = true; + Console.WriteLine($"[GtkWebViewHandler] Registered WebView at ({x}, {y}) size {width}x{height}"); + } + else if (bounds != _lastBounds) + { + hostService.HostWindow.MoveResizeWebView(_platformWebView.Widget, x, y, width, height); + Console.WriteLine($"[GtkWebViewHandler] Updated WebView to ({x}, {y}) size {width}x{height}"); + } + + _lastBounds = bounds; + } + + private void UnregisterFromHost() + { + if (_isRegisteredWithHost && _platformWebView != null) + { + var hostService = GtkHostService.Instance; + if (hostService.HostWindow != null) + { + hostService.HostWindow.RemoveWebView(_platformWebView.Widget); + Console.WriteLine("[GtkWebViewHandler] Unregistered WebView from host"); + } + _isRegisteredWithHost = false; + } + } + + public static void MapSource(GtkWebViewHandler handler, IWebView webView) + { + if (handler._platformWebView == null) + return; + + var source = webView.Source; + Console.WriteLine($"[GtkWebViewHandler] MapSource: {source?.GetType().Name ?? "null"}"); + + if (source is UrlWebViewSource urlSource) + { + var url = urlSource.Url; + if (!string.IsNullOrEmpty(url)) + { + handler._platformWebView.Navigate(url); + } + } + else if (source is HtmlWebViewSource htmlSource) + { + var html = htmlSource.Html; + if (!string.IsNullOrEmpty(html)) + { + handler._platformWebView.LoadHtml(html, htmlSource.BaseUrl); + } + } + } + + public static void MapGoBack(GtkWebViewHandler handler, IWebView webView, object? args) + { + Console.WriteLine($"[GtkWebViewHandler] MapGoBack called, CanGoBack={handler._platformWebView?.CanGoBack()}"); + handler._platformWebView?.GoBack(); + } + + public static void MapGoForward(GtkWebViewHandler handler, IWebView webView, object? args) + { + Console.WriteLine($"[GtkWebViewHandler] MapGoForward called, CanGoForward={handler._platformWebView?.CanGoForward()}"); + handler._platformWebView?.GoForward(); + } + + public static void MapReload(GtkWebViewHandler handler, IWebView webView, object? args) + { + Console.WriteLine("[GtkWebViewHandler] MapReload called"); + handler._platformWebView?.Reload(); + } +} diff --git a/Handlers/GtkWebViewProxy.cs b/Handlers/GtkWebViewProxy.cs new file mode 100644 index 0000000..8a9dcf6 --- /dev/null +++ b/Handlers/GtkWebViewProxy.cs @@ -0,0 +1,83 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.Maui.Platform; +using SkiaSharp; + +namespace Microsoft.Maui.Platform.Linux.Handlers; + +/// +/// Proxy view that bridges SkiaView layout to GTK WebView positioning. +/// +public class GtkWebViewProxy : SkiaView +{ + private readonly GtkWebViewHandler _handler; + private readonly GtkWebViewPlatformView _platformView; + + public GtkWebViewPlatformView PlatformView => _platformView; + public bool CanGoBack => _platformView.CanGoBack(); + public bool CanGoForward => _platformView.CanGoForward(); + + public GtkWebViewProxy(GtkWebViewHandler handler, GtkWebViewPlatformView platformView) + { + _handler = handler; + _platformView = platformView; + } + + public override void Arrange(SKRect bounds) + { + base.Arrange(bounds); + var windowBounds = TransformToWindow(bounds); + _handler.RegisterWithHost(windowBounds); + } + + private SKRect TransformToWindow(SKRect localBounds) + { + float x = localBounds.Left; + float y = localBounds.Top; + + for (var parent = Parent; parent != null; parent = parent.Parent) + { + x += parent.Bounds.Left; + y += parent.Bounds.Top; + } + + return new SKRect(x, y, x + localBounds.Width, y + localBounds.Height); + } + + public override void Draw(SKCanvas canvas) + { + // Draw transparent placeholder - actual WebView is rendered by GTK + using var paint = new SKPaint + { + Color = new SKColor(0, 0, 0, 0), + Style = SKPaintStyle.Fill + }; + canvas.DrawRect(Bounds, paint); + } + + public void Navigate(string url) + { + _platformView.Navigate(url); + } + + public void LoadHtml(string html, string? baseUrl = null) + { + _platformView.LoadHtml(html, baseUrl); + } + + public void GoBack() + { + _platformView.GoBack(); + } + + public void GoForward() + { + _platformView.GoForward(); + } + + public void Reload() + { + _platformView.Reload(); + } +} diff --git a/Handlers/PageHandler.cs b/Handlers/PageHandler.cs index 5e37e73..4b33d64 100644 --- a/Handlers/PageHandler.cs +++ b/Handlers/PageHandler.cs @@ -22,6 +22,7 @@ public partial class PageHandler : ViewHandler [nameof(Page.BackgroundImageSource)] = MapBackgroundImageSource, [nameof(Page.Padding)] = MapPadding, [nameof(IView.Background)] = MapBackground, + [nameof(VisualElement.BackgroundColor)] = MapBackgroundColor, }; public static CommandMapper CommandMapper = @@ -101,6 +102,18 @@ public partial class PageHandler : ViewHandler handler.PlatformView.BackgroundColor = solidBrush.Color.ToSKColor(); } } + + public static void MapBackgroundColor(PageHandler handler, Page page) + { + if (handler.PlatformView is null) return; + + var backgroundColor = page.BackgroundColor; + if (backgroundColor != null && backgroundColor != Colors.Transparent) + { + handler.PlatformView.BackgroundColor = backgroundColor.ToSKColor(); + Console.WriteLine($"[PageHandler] MapBackgroundColor: {backgroundColor}"); + } + } } /// diff --git a/Handlers/WebViewHandler.cs b/Handlers/WebViewHandler.cs index d4e5e79..a2300ec 100644 --- a/Handlers/WebViewHandler.cs +++ b/Handlers/WebViewHandler.cs @@ -54,29 +54,63 @@ public partial class WebViewHandler : ViewHandler base.DisconnectHandler(platformView); } - private void OnNavigating(object? sender, WebNavigatingEventArgs e) + private void OnNavigating(object? sender, Microsoft.Maui.Platform.WebNavigatingEventArgs e) { - // Forward to virtual view if needed + IWebView virtualView = VirtualView; + IWebViewController? controller = virtualView as IWebViewController; + if (controller != null) + { + var args = new Microsoft.Maui.Controls.WebNavigatingEventArgs( + WebNavigationEvent.NewPage, + null, + e.Url); + controller.SendNavigating(args); + } } - private void OnNavigated(object? sender, WebNavigatedEventArgs e) + private void OnNavigated(object? sender, Microsoft.Maui.Platform.WebNavigatedEventArgs e) { - // Forward to virtual view if needed + IWebView virtualView = VirtualView; + IWebViewController? controller = virtualView as IWebViewController; + if (controller != null) + { + WebNavigationResult result = e.Success ? WebNavigationResult.Success : WebNavigationResult.Failure; + var args = new Microsoft.Maui.Controls.WebNavigatedEventArgs( + WebNavigationEvent.NewPage, + null, + e.Url, + result); + controller.SendNavigated(args); + } } public static void MapSource(WebViewHandler handler, IWebView webView) { - if (handler.PlatformView == null) return; + Console.WriteLine("[WebViewHandler] MapSource called"); + if (handler.PlatformView == null) + { + Console.WriteLine("[WebViewHandler] PlatformView is null!"); + return; + } var source = webView.Source; + Console.WriteLine($"[WebViewHandler] Source type: {source?.GetType().Name ?? "null"}"); + if (source is UrlWebViewSource urlSource) { + Console.WriteLine($"[WebViewHandler] Loading URL: {urlSource.Url}"); handler.PlatformView.Source = urlSource.Url ?? ""; } else if (source is HtmlWebViewSource htmlSource) { + Console.WriteLine($"[WebViewHandler] Loading HTML ({htmlSource.Html?.Length ?? 0} chars)"); + Console.WriteLine($"[WebViewHandler] HTML preview: {htmlSource.Html?.Substring(0, Math.Min(100, htmlSource.Html?.Length ?? 0))}..."); handler.PlatformView.Html = htmlSource.Html ?? ""; } + else + { + Console.WriteLine("[WebViewHandler] Unknown source type or null"); + } } public static void MapGoBack(WebViewHandler handler, IWebView webView, object? args) diff --git a/MERGE_TRACKING.md b/MERGE_TRACKING.md index d12ccf3..ecc7030 100644 --- a/MERGE_TRACKING.md +++ b/MERGE_TRACKING.md @@ -1,426 +1,206 @@ # OpenMaui Linux - Recovery Merge Tracking -## Executive Summary - -| Category | In Main | In Decompiled | New to Add | To Compare | Completed | -|----------|---------|---------------|------------|------------|-----------| -| Handlers | 44 | 48 | 13 | 35 | 23 | -| Views/Types | 41 | 118 | 77 | 41 | 10 | -| Services | 33 | 103 | 70 | 33 | 7 | -| Hosting | 5 | 12 | 7 | 5 | 2 | -| Dispatching | 0 | 3 | 3 | 0 | 3 | -| Native | 0 | 5 | 5 | 0 | 5 | -| Window | 2 | 3 | 1 | 2 | 3 | -| Rendering | 1 | 2 | 1 | 1 | 1 | -| **TOTAL** | **123** | **289** | **175** | **114** | **54** | - -**Branch:** `main` -**Base:** Clean main (builds with 0 errors) -**Status:** In progress - BUILD SUCCEEDS +**Branch:** `final` **Last Updated:** 2026-01-01 +**Build Status:** SUCCEEDS --- ## HANDLERS -### New Handlers (13 files) - TO ADD - -- [ ] ContentPageHandler.cs - EXISTS IN PageHandler.cs, needs comparison -- [x] FlexLayoutHandler.cs - ADDED -- [x] GestureManager.cs - ADDED (tap, pan, swipe, pointer gesture processing) -- [ ] GridHandler.cs - EXISTS IN LayoutHandler.cs, needs comparison -- [ ] GtkWebViewHandler.cs -- [x] GtkWebViewManager.cs - ADDED -- [x] GtkWebViewPlatformView.cs - ADDED -- [ ] GtkWebViewProxy.cs -- [ ] LayoutHandlerUpdate.cs - EXISTS IN LayoutHandler.cs -- [ ] LinuxApplicationContext.cs -- [ ] RelayCommand.cs - EXISTS IN NavigationPageHandler.cs -- [ ] SizeChangedEventArgs.cs -- [ ] SkiaWindow.cs -- [ ] StackLayoutHandler.cs - EXISTS IN LayoutHandler.cs, needs comparison -- [ ] TextButtonHandler.cs - EXISTS IN ButtonHandler.cs - -### Existing Handlers (35 files) - TO COMPARE - -- [ ] ActivityIndicatorHandler.cs -- [ ] ActivityIndicatorHandler.Linux.cs -- [ ] ApplicationHandler.cs -- [x] BorderHandler.cs - Updated to use ToViewHandler -- [ ] BoxViewHandler.cs -- [ ] ButtonHandler.cs -- [ ] ButtonHandler.Linux.cs -- [x] CheckBoxHandler.cs - Updated with missing mappers -- [ ] CheckBoxHandler.Linux.cs -- [x] CollectionViewHandler.cs - Updated to use ToViewHandler -- [x] DatePickerHandler.cs - Updated with missing mappers -- [ ] EditorHandler.cs -- [x] EntryHandler.cs - Updated with missing mappers -- [ ] EntryHandler.Linux.cs -- [ ] FlyoutPageHandler.cs -- [x] FrameHandler.cs - Updated to use ToViewHandler -- [ ] GraphicsViewHandler.cs -- [ ] ImageButtonHandler.cs -- [x] ImageHandler.cs - Updated with LoadFromBitmap support -- [ ] ItemsViewHandler.cs -- [x] LabelHandler.cs - Added ConnectHandler, DisconnectHandler, OnPlatformViewTapped, MapFormattedText -- [ ] LabelHandler.Linux.cs -- [x] LayoutHandler.cs - Updated to use ToViewHandler -- [x] LayoutHandler.Linux.cs - Updated to use ToViewHandler -- [x] NavigationPageHandler.cs - Updated to use ToViewHandler -- [x] PageHandler.cs - Updated to use ToViewHandler -- [x] PickerHandler.cs - Updated with missing mappers -- [x] ProgressBarHandler.cs - Updated with missing mappers -- [ ] ProgressBarHandler.Linux.cs -- [ ] RadioButtonHandler.cs -- [x] ScrollViewHandler.cs - Updated to use ToViewHandler -- [ ] SearchBarHandler.cs -- [ ] SearchBarHandler.Linux.cs -- [ ] ShellHandler.cs -- [ ] SliderHandler.cs -- [ ] SliderHandler.Linux.cs -- [ ] StepperHandler.cs -- [x] SwitchHandler.cs - Updated with missing mappers -- [ ] SwitchHandler.Linux.cs -- [ ] TabbedPageHandler.cs -- [ ] TimePickerHandler.cs -- [ ] WebViewHandler.cs -- [ ] WebViewHandler.Linux.cs -- [ ] WindowHandler.cs +| File | Status | Notes | +|------|--------|-------| +| ActivityIndicatorHandler.cs | [ ] | | +| ApplicationHandler.cs | [ ] | | +| BorderHandler.cs | [ ] | | +| BoxViewHandler.cs | [ ] | | +| ButtonHandler.cs | [ ] | Contains TextButtonHandler | +| CheckBoxHandler.cs | [ ] | | +| CollectionViewHandler.cs | [ ] | | +| DatePickerHandler.cs | [ ] | | +| EditorHandler.cs | [ ] | | +| EntryHandler.cs | [ ] | | +| FlexLayoutHandler.cs | [ ] | | +| FlyoutPageHandler.cs | [ ] | | +| FrameHandler.cs | [ ] | | +| GestureManager.cs | [ ] | | +| GraphicsViewHandler.cs | [ ] | | +| GtkWebViewHandler.cs | [x] | Added new file from decompiled | +| GtkWebViewManager.cs | [ ] | | +| GtkWebViewPlatformView.cs | [ ] | | +| GtkWebViewProxy.cs | [x] | Added new file from decompiled | +| ImageButtonHandler.cs | [ ] | | +| ImageHandler.cs | [ ] | | +| ItemsViewHandler.cs | [ ] | | +| LabelHandler.cs | [ ] | | +| LayoutHandler.cs | [ ] | Contains GridHandler, StackLayoutHandler, LayoutHandlerUpdate | +| NavigationPageHandler.cs | [ ] | Contains RelayCommand | +| PageHandler.cs | [x] | Added MapBackgroundColor | +| PickerHandler.cs | [ ] | | +| ProgressBarHandler.cs | [ ] | | +| RadioButtonHandler.cs | [ ] | | +| ScrollViewHandler.cs | [ ] | | +| SearchBarHandler.cs | [ ] | | +| ShellHandler.cs | [ ] | | +| SliderHandler.cs | [ ] | | +| StepperHandler.cs | [ ] | | +| SwitchHandler.cs | [ ] | | +| TabbedPageHandler.cs | [ ] | | +| TimePickerHandler.cs | [ ] | | +| WebViewHandler.cs | [x] | Fixed namespace-qualified event args | +| WindowHandler.cs | [ ] | Contains SkiaWindow, SizeChangedEventArgs, LinuxApplicationContext | --- -## VIEWS & TYPES +## VIEWS -### New Types (77 files) - TO ADD - -- [ ] AbsoluteLayoutBounds.cs - EXISTS IN SkiaLayoutView.cs -- [ ] AbsoluteLayoutFlags.cs - EXISTS IN SkiaLayoutView.cs -- [ ] CheckedChangedEventArgs.cs -- [ ] CollectionSelectionChangedEventArgs.cs -- [ ] ColorExtensions.cs -- [ ] ContextMenuItem.cs - EXISTS IN Types/ -- [ ] FlexAlignContent.cs - EXISTS IN Types/ -- [ ] FlexAlignItems.cs - EXISTS IN Types/ -- [ ] FlexAlignSelf.cs - EXISTS IN Types/ -- [ ] FlexBasis.cs - EXISTS IN Types/ -- [ ] FlexDirection.cs - EXISTS IN Types/ -- [ ] FlexJustify.cs - EXISTS IN Types/ -- [ ] FlexWrap.cs - EXISTS IN Types/ -- [ ] FlyoutLayoutBehavior.cs -- [ ] FontExtensions.cs -- [ ] GridLength.cs - EXISTS IN SkiaLayoutView.cs -- [ ] GridPosition.cs - EXISTS IN SkiaLayoutView.cs -- [ ] GridUnitType.cs - EXISTS IN SkiaLayoutView.cs -- [ ] ImageLoadingErrorEventArgs.cs -- [ ] IndicatorShape.cs -- [ ] ISkiaQueryAttributable.cs - EXISTS IN Types/ -- [ ] ItemsLayoutOrientation.cs -- [ ] ItemsScrolledEventArgs.cs -- [ ] ItemsViewItemTappedEventArgs.cs -- [ ] Key.cs - EXISTS IN SkiaView.cs -- [ ] KeyEventArgs.cs - EXISTS IN SkiaView.cs -- [ ] KeyModifiers.cs - EXISTS IN SkiaView.cs -- [ ] LayoutAlignment.cs -- [ ] LineBreakMode.cs -- [ ] LinuxDialogService.cs -- [ ] MenuBarItem.cs - EXISTS IN SkiaMenuBar.cs -- [ ] MenuItem.cs - EXISTS IN SkiaMenuBar.cs -- [ ] MenuItemClickedEventArgs.cs - EXISTS IN SkiaMenuBar.cs -- [ ] NavigationEventArgs.cs - EXISTS IN SkiaNavigationPage.cs -- [ ] PointerButton.cs - EXISTS IN SkiaView.cs -- [ ] PointerEventArgs.cs - EXISTS IN SkiaView.cs -- [ ] PositionChangedEventArgs.cs -- [ ] ProgressChangedEventArgs.cs -- [ ] ScrollBarVisibility.cs - EXISTS IN SkiaScrollView.cs -- [ ] ScrolledEventArgs.cs - EXISTS IN SkiaScrollView.cs -- [ ] ScrollEventArgs.cs - EXISTS IN SkiaView.cs -- [ ] ScrollOrientation.cs - EXISTS IN SkiaScrollView.cs -- [ ] ShellContent.cs - EXISTS IN SkiaShell.cs -- [ ] ShellFlyoutBehavior.cs - EXISTS IN SkiaShell.cs -- [ ] ShellNavigationEventArgs.cs - EXISTS IN SkiaShell.cs -- [ ] ShellSection.cs - EXISTS IN SkiaShell.cs -- [ ] SkiaAbsoluteLayout.cs - EXISTS IN SkiaLayoutView.cs -- [ ] SkiaContentPage.cs - EXISTS IN SkiaPage.cs -- [ ] SkiaContextMenu.cs -- [x] SkiaFlexLayout.cs - ADDED -- [ ] SkiaFrame.cs - EXISTS IN SkiaBorder.cs -- [ ] SkiaGrid.cs - EXISTS IN SkiaLayoutView.cs -- [ ] SkiaMenuFlyout.cs -- [ ] SkiaSelectionMode.cs -- [ ] SkiaStackLayout.cs - EXISTS IN SkiaLayoutView.cs -- [ ] SkiaTextAlignment.cs -- [ ] SkiaTextSpan.cs - EXISTS IN Types/ -- [ ] SkiaToolbarItem.cs - EXISTS IN SkiaPage.cs -- [ ] SkiaToolbarItemOrder.cs - EXISTS IN SkiaPage.cs -- [ ] SkiaVerticalAlignment.cs -- [ ] SkiaVisualState.cs -- [ ] SkiaVisualStateGroup.cs -- [ ] SkiaVisualStateGroupList.cs -- [ ] SkiaVisualStateSetter.cs -- [ ] SliderValueChangedEventArgs.cs -- [ ] StackOrientation.cs - EXISTS IN SkiaLayoutView.cs -- [ ] SwipeDirection.cs -- [ ] SwipeEndedEventArgs.cs -- [ ] SwipeItem.cs -- [ ] SwipeMode.cs -- [ ] SwipeStartedEventArgs.cs -- [ ] SystemClipboard.cs -- [ ] TabItem.cs -- [ ] TextAlignment.cs -- [ ] TextChangedEventArgs.cs -- [ ] TextInputEventArgs.cs - EXISTS IN SkiaView.cs -- [ ] ThicknessExtensions.cs -- [ ] ToggledEventArgs.cs -- [ ] WebNavigatedEventArgs.cs -- [ ] WebNavigatingEventArgs.cs - -### Existing Views (41 files) - TO COMPARE - -- [ ] LinuxWebView.cs -- [ ] SkiaActivityIndicator.cs -- [ ] SkiaAlertDialog.cs -- [ ] SkiaBorder.cs -- [ ] SkiaBoxView.cs -- [ ] SkiaButton.cs -- [ ] SkiaCarouselView.cs -- [ ] SkiaCheckBox.cs -- [ ] SkiaCollectionView.cs -- [ ] SkiaContentPresenter.cs -- [ ] SkiaDatePicker.cs -- [ ] SkiaEditor.cs -- [x] SkiaEntry.cs - Added context menu support -- [ ] SkiaFlyoutPage.cs -- [ ] SkiaGraphicsView.cs -- [x] SkiaImage.cs - Added LoadFromBitmap method -- [ ] SkiaImageButton.cs -- [ ] SkiaIndicatorView.cs -- [ ] SkiaItemsView.cs -- [x] SkiaLabel.cs - Added FormattedSpans, Tapped event, formatted text rendering -- [ ] SkiaLayoutView.cs -- [ ] SkiaMenuBar.cs -- [ ] SkiaNavigationPage.cs -- [ ] SkiaPage.cs -- [ ] SkiaPicker.cs -- [ ] SkiaProgressBar.cs -- [ ] SkiaRadioButton.cs -- [ ] SkiaRefreshView.cs -- [ ] SkiaScrollView.cs -- [ ] SkiaSearchBar.cs -- [x] SkiaShell.cs - Added MauiShell, ContentRenderer, ColorRefresher, RefreshTheme() -- [ ] SkiaSlider.cs -- [ ] SkiaStepper.cs -- [ ] SkiaSwipeView.cs -- [ ] SkiaSwitch.cs -- [ ] SkiaTabbedPage.cs -- [ ] SkiaTemplatedView.cs -- [ ] SkiaTimePicker.cs -- [x] SkiaView.cs - Added MauiView, CursorType, transforms (Scale/Rotation/Translation/Anchor), GestureManager integration, enhanced Invalidate/Draw -- [ ] SkiaVisualStateManager.cs -- [x] SkiaWebView.cs - Added SetMainWindow, ProcessGtkEvents static methods - -### New Views Added This Session - -- [x] SkiaContextMenu.cs - ADDED (context menu with hover, keyboard, dark theme support) -- [x] LinuxDialogService.cs - ADDED (dialog and context menu management) +| File | Status | Notes | +|------|--------|-------| +| SkiaActivityIndicator.cs | [ ] | | +| SkiaAlertDialog.cs | [ ] | | +| SkiaBorder.cs | [ ] | Contains SkiaFrame | +| SkiaBoxView.cs | [ ] | | +| SkiaButton.cs | [ ] | | +| SkiaCarouselView.cs | [ ] | | +| SkiaCheckBox.cs | [ ] | | +| SkiaCollectionView.cs | [ ] | | +| SkiaContentPresenter.cs | [ ] | | +| SkiaContextMenu.cs | [ ] | | +| SkiaDatePicker.cs | [ ] | | +| SkiaEditor.cs | [ ] | | +| SkiaEntry.cs | [ ] | | +| SkiaFlexLayout.cs | [ ] | | +| SkiaFlyoutPage.cs | [ ] | | +| SkiaGraphicsView.cs | [ ] | | +| SkiaImage.cs | [ ] | | +| SkiaImageButton.cs | [ ] | | +| SkiaIndicatorView.cs | [ ] | | +| SkiaItemsView.cs | [ ] | | +| SkiaLabel.cs | [ ] | | +| SkiaLayoutView.cs | [ ] | Contains SkiaGrid, SkiaStackLayout, SkiaAbsoluteLayout, GridLength, GridPosition | +| SkiaMenuBar.cs | [ ] | Contains MenuItem, MenuBarItem | +| SkiaNavigationPage.cs | [ ] | | +| SkiaPage.cs | [ ] | Contains SkiaContentPage, SkiaToolbarItem | +| SkiaPicker.cs | [ ] | | +| SkiaProgressBar.cs | [ ] | | +| SkiaRadioButton.cs | [ ] | | +| SkiaRefreshView.cs | [ ] | | +| SkiaScrollView.cs | [ ] | | +| SkiaSearchBar.cs | [ ] | | +| SkiaShell.cs | [ ] | Contains ShellSection, ShellContent | +| SkiaSlider.cs | [ ] | | +| SkiaStepper.cs | [ ] | | +| SkiaSwipeView.cs | [ ] | | +| SkiaSwitch.cs | [ ] | | +| SkiaTabbedPage.cs | [ ] | | +| SkiaTemplatedView.cs | [ ] | | +| SkiaTimePicker.cs | [ ] | | +| SkiaView.cs | [x] | Made Arrange() virtual | +| SkiaVisualStateManager.cs | [ ] | | +| SkiaWebView.cs | [ ] | Contains WebNavigatingEventArgs, WebNavigatedEventArgs (TO REMOVE - use MAUI's) | --- ## SERVICES -### New Services (70 files) - TO ADD - -- [ ] AccessibilityServiceFactory.cs -- [ ] AccessibleAction.cs -- [ ] AccessibleProperty.cs -- [ ] AccessibleRect.cs -- [ ] AccessibleRole.cs -- [ ] AccessibleState.cs -- [ ] AccessibleStates.cs -- [ ] AnnouncementPriority.cs -- [x] AppInfoService.cs - ADDED -- [ ] ColorDialogResult.cs -- [x] ConnectivityService.cs - ADDED -- [ ] DesktopEnvironment.cs - EXISTS IN SystemThemeService.cs -- [x] DeviceDisplayService.cs - ADDED -- [x] DeviceInfoService.cs - ADDED -- [ ] DisplayServerType.cs - EXISTS IN LinuxApplication.cs -- [ ] DragAction.cs -- [ ] DragData.cs -- [ ] DragEventArgs.cs -- [ ] DropEventArgs.cs -- [ ] FileDialogResult.cs -- [ ] FolderPickerOptions.cs -- [ ] FolderPickerResult.cs -- [ ] FolderResult.cs -- [ ] GtkButtonsType.cs -- [ ] GtkContextMenuService.cs -- [ ] GtkFileChooserAction.cs -- [x] GtkHostService.cs - ADDED -- [ ] GtkMenuItem.cs -- [ ] GtkMessageType.cs -- [ ] GtkResponseType.cs -- [ ] HighContrastChangedEventArgs.cs -- [ ] HighContrastColors.cs -- [ ] HighContrastTheme.cs -- [ ] HotkeyEventArgs.cs -- [ ] HotkeyKey.cs -- [ ] HotkeyModifiers.cs -- [ ] IAccessible.cs -- [ ] IAccessibleEditableText.cs -- [ ] IAccessibleText.cs -- [ ] IDisplayWindow.cs -- [ ] IInputContext.cs -- [ ] KeyModifiers.cs -- [ ] LinuxFileResult.cs -- [x] MauiIconGenerator.cs - ADDED (PNG icon generator, no Svg.Skia dependency) -- [ ] NotificationAction.cs -- [ ] NotificationActionEventArgs.cs -- [ ] NotificationClosedEventArgs.cs -- [ ] NotificationCloseReason.cs -- [ ] NotificationContext.cs -- [ ] NotificationOptions.cs -- [ ] NotificationUrgency.cs -- [ ] NullAccessibilityService.cs -- [ ] NullInputMethodService.cs -- [ ] PortalFolderPickerService.cs -- [ ] PreEditAttribute.cs -- [ ] PreEditAttributeType.cs -- [ ] PreEditChangedEventArgs.cs -- [ ] ScaleChangedEventArgs.cs -- [ ] SystemColors.cs -- [ ] SystemTheme.cs -- [ ] TextCommittedEventArgs.cs -- [ ] TextRun.cs -- [ ] ThemeChangedEventArgs.cs -- [ ] TrayMenuItem.cs -- [ ] VideoAccelerationApi.cs -- [ ] VideoFrame.cs -- [ ] VideoProfile.cs -- [ ] VirtualizationExtensions.cs -- [ ] WaylandDisplayWindow.cs -- [ ] X11DisplayWindow.cs - -### Existing Services (33 files) - TO COMPARE - -- [ ] AppActionsService.cs -- [ ] AtSpi2AccessibilityService.cs -- [ ] BrowserService.cs -- [ ] ClipboardService.cs -- [ ] DisplayServerFactory.cs -- [ ] DragDropService.cs -- [ ] EmailService.cs -- [ ] Fcitx5InputMethodService.cs -- [ ] FilePickerService.cs -- [ ] FolderPickerService.cs -- [ ] FontFallbackManager.cs -- [ ] GlobalHotkeyService.cs -- [ ] Gtk4InteropService.cs -- [ ] HardwareVideoService.cs -- [ ] HiDpiService.cs -- [ ] HighContrastService.cs -- [ ] IAccessibilityService.cs -- [ ] IBusInputMethodService.cs -- [ ] IInputMethodService.cs -- [ ] InputMethodServiceFactory.cs -- [ ] LauncherService.cs -- [ ] LinuxResourcesProvider.cs -- [ ] NotificationService.cs -- [ ] PortalFilePickerService.cs -- [ ] PreferencesService.cs -- [ ] SecureStorageService.cs -- [ ] ShareService.cs -- [ ] SystemClipboard.cs -- [ ] SystemThemeService.cs -- [ ] SystemTrayService.cs -- [ ] VersionTrackingService.cs -- [ ] VirtualizationManager.cs -- [ ] X11InputMethodService.cs +| File | Status | Notes | +|------|--------|-------| +| AppActionsService.cs | [ ] | | +| AppInfoService.cs | [ ] | | +| AtSpi2AccessibilityService.cs | [ ] | | +| BrowserService.cs | [ ] | | +| ClipboardService.cs | [ ] | | +| ConnectivityService.cs | [ ] | | +| DeviceDisplayService.cs | [ ] | | +| DeviceInfoService.cs | [ ] | | +| DisplayServerFactory.cs | [ ] | | +| DragDropService.cs | [ ] | | +| EmailService.cs | [ ] | | +| Fcitx5InputMethodService.cs | [ ] | | +| FilePickerService.cs | [ ] | | +| FolderPickerService.cs | [ ] | | +| FontFallbackManager.cs | [ ] | | +| GlobalHotkeyService.cs | [ ] | | +| Gtk4InteropService.cs | [ ] | | +| GtkHostService.cs | [ ] | | +| HardwareVideoService.cs | [ ] | | +| HiDpiService.cs | [ ] | | +| HighContrastService.cs | [ ] | | +| IAccessibilityService.cs | [ ] | | +| IBusInputMethodService.cs | [ ] | | +| IInputMethodService.cs | [ ] | | +| InputMethodServiceFactory.cs | [ ] | | +| LauncherService.cs | [ ] | | +| LinuxResourcesProvider.cs | [ ] | | +| NotificationService.cs | [ ] | | +| PortalFilePickerService.cs | [ ] | | +| PreferencesService.cs | [ ] | | +| SecureStorageService.cs | [ ] | | +| ShareService.cs | [ ] | | +| SystemThemeService.cs | [ ] | | +| SystemTrayService.cs | [ ] | | +| VersionTrackingService.cs | [ ] | | +| VirtualizationManager.cs | [ ] | | +| X11InputMethodService.cs | [ ] | | --- ## HOSTING -### New Hosting (7 files) - TO ADD - -- [ ] GtkMauiContext.cs -- [ ] HandlerMappingExtensions.cs -- [ ] LinuxAnimationManager.cs - EXISTS IN LinuxMauiContext.cs -- [ ] LinuxDispatcher.cs - EXISTS IN LinuxMauiContext.cs -- [ ] LinuxDispatcherTimer.cs - EXISTS IN LinuxMauiContext.cs -- [ ] LinuxTicker.cs - EXISTS IN LinuxMauiContext.cs -- [x] MauiHandlerExtensions.cs - ADDED (critical ToViewHandler fix) -- [ ] ScopedLinuxMauiContext.cs - EXISTS IN LinuxMauiContext.cs - -### Existing Hosting (5 files) - TO COMPARE - -- [ ] LinuxMauiAppBuilderExtensions.cs -- [ ] LinuxMauiContext.cs -- [ ] LinuxProgramHost.cs -- [ ] LinuxViewRenderer.cs -- [ ] MauiAppBuilderExtensions.cs +| File | Status | Notes | +|------|--------|-------| +| LinuxMauiAppBuilderExtensions.cs | [ ] | | +| LinuxMauiContext.cs | [ ] | | +| LinuxProgramHost.cs | [ ] | | +| LinuxViewRenderer.cs | [ ] | | +| MauiAppBuilderExtensions.cs | [ ] | | +| MauiHandlerExtensions.cs | [ ] | | --- -## NEW FOLDERS +## DISPATCHING -### Dispatching (3 files) - TO ADD +| File | Status | Notes | +|------|--------|-------| +| LinuxDispatcher.cs | [ ] | | +| LinuxDispatcherProvider.cs | [ ] | | +| LinuxDispatcherTimer.cs | [ ] | | -- [ ] LinuxDispatcher.cs -- [ ] LinuxDispatcherProvider.cs -- [ ] LinuxDispatcherTimer.cs +--- -### Native (5 files) - TO ADD +## NATIVE -- [ ] CairoNative.cs -- [ ] GdkNative.cs -- [ ] GLibNative.cs -- [ ] GtkNative.cs -- [ ] WebKitNative.cs +| File | Status | Notes | +|------|--------|-------| +| CairoNative.cs | [ ] | | +| GdkNative.cs | [ ] | | +| GLibNative.cs | [ ] | | +| GtkNative.cs | [ ] | | +| WebKitNative.cs | [ ] | | --- ## WINDOW -### Window Files - TO COMPARE/ADD - -- [x] CursorType.cs - ADDED (Arrow, Hand, Text cursor types) -- [x] X11Window.cs - Added SetIcon, SetCursor methods, cursor initialization -- [x] GtkHostWindow.cs - ADDED (GTK-based host window with overlay support) +| File | Status | Notes | +|------|--------|-------| +| CursorType.cs | [ ] | | +| GtkHostWindow.cs | [ ] | | +| X11Window.cs | [ ] | | --- ## RENDERING -### Rendering Files - TO COMPARE/ADD - -- [x] GtkSkiaSurfaceWidget.cs - ADDED (GTK drawing area for Skia) +| File | Status | Notes | +|------|--------|-------| +| GtkSkiaSurfaceWidget.cs | [ ] | | --- -## CORE FILES +## CORE -### Core (2 files) - TO COMPARE - -- [x] LinuxApplication.cs - Massive update: GTK mode, Dispatcher init, theme handling, icon support, GTK events -- [ ] LinuxApplicationOptions.cs - ---- - -## HOSTING - -### Hosting Files - TO COMPARE/ADD - -- [x] LinuxMauiContext.cs - Fixed duplicate LinuxDispatcher, uses Dispatching namespace -- [x] MauiHandlerExtensions.cs - ADDED (ToViewHandler extension) - ---- - -## Process - -1. **DECOMPILED = PRODUCTION (source of truth)** -2. **MAIN = OUTDATED (needs updates)** -3. **For EVERY file in decompiled**: Compare with main and apply differences -4. **Even "existing" files**: Must be compared - they likely have production fixes missing -5. **Update this document** after each file -6. **Build frequently** to catch errors early +| File | Status | Notes | +|------|--------|-------| +| LinuxApplication.cs | [ ] | | +| LinuxApplicationOptions.cs | [ ] | | diff --git a/Views/SkiaView.cs b/Views/SkiaView.cs index f38d57c..d74d4c2 100644 --- a/Views/SkiaView.cs +++ b/Views/SkiaView.cs @@ -926,7 +926,7 @@ public abstract class SkiaView : BindableObject, IDisposable /// /// Arranges this view within the given bounds. /// - public void Arrange(SKRect bounds) + public virtual void Arrange(SKRect bounds) { Bounds = ArrangeOverride(bounds); }