Major production merge: GTK support, context menus, and dispatcher fixes
Core Infrastructure:
- Add Dispatching folder with LinuxDispatcher, LinuxDispatcherProvider, LinuxDispatcherTimer
- Add Native folder with P/Invoke wrappers (GTK, GLib, GDK, Cairo, WebKit)
- Add GTK host window system with GtkHostWindow and GtkSkiaSurfaceWidget
- Update LinuxApplication with GTK mode, theme handling, and icon support
- Fix duplicate LinuxDispatcher in LinuxMauiContext
Handlers:
- Add GtkWebViewManager and GtkWebViewPlatformView for GTK WebView
- Add FlexLayoutHandler and GestureManager
- Update multiple handlers with ToViewHandler fix and missing mappers
- Add MauiHandlerExtensions with ToViewHandler extension method
Views:
- Add SkiaContextMenu with hover, keyboard, and dark theme support
- Add LinuxDialogService with context menu management
- Add SkiaFlexLayout for flex container support
- Update SkiaShell with RefreshTheme, MauiShell, ContentRenderer
- Update SkiaWebView with SetMainWindow, ProcessGtkEvents
- Update SkiaImage with LoadFromBitmap method
Services:
- Add AppInfoService, ConnectivityService, DeviceDisplayService, DeviceInfoService
- Add GtkHostService, GtkContextMenuService, MauiIconGenerator
Window:
- Add CursorType enum and GtkHostWindow
- Update X11Window with SetIcon, SetCursor methods
Build: SUCCESS (0 errors)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:19:58 -05:00
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Microsoft.Maui.ApplicationModel;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.Maui.Platform.Linux.Services;
|
|
|
|
|
|
|
|
|
|
public class AppInfoService : IAppInfo
|
|
|
|
|
{
|
|
|
|
|
private static readonly Lazy<AppInfoService> _instance = new Lazy<AppInfoService>(() => new AppInfoService());
|
|
|
|
|
|
|
|
|
|
private readonly Assembly _entryAssembly;
|
|
|
|
|
|
|
|
|
|
private readonly string _packageName;
|
|
|
|
|
|
|
|
|
|
private readonly string _name;
|
|
|
|
|
|
|
|
|
|
private readonly string _versionString;
|
|
|
|
|
|
|
|
|
|
private readonly Version _version;
|
|
|
|
|
|
|
|
|
|
private readonly string _buildString;
|
|
|
|
|
|
|
|
|
|
public static AppInfoService Instance => _instance.Value;
|
|
|
|
|
|
|
|
|
|
public string PackageName => _packageName;
|
|
|
|
|
|
|
|
|
|
public string Name => _name;
|
|
|
|
|
|
|
|
|
|
public string VersionString => _versionString;
|
|
|
|
|
|
|
|
|
|
public Version Version => _version;
|
|
|
|
|
|
|
|
|
|
public string BuildString => _buildString;
|
|
|
|
|
|
|
|
|
|
public LayoutDirection RequestedLayoutDirection => LayoutDirection.LeftToRight;
|
|
|
|
|
|
|
|
|
|
public AppTheme RequestedTheme
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2026-01-17 02:23:05 +00:00
|
|
|
// Use SystemThemeService for consistent theme detection across the platform
|
|
|
|
|
return SystemThemeService.Instance.CurrentTheme switch
|
Major production merge: GTK support, context menus, and dispatcher fixes
Core Infrastructure:
- Add Dispatching folder with LinuxDispatcher, LinuxDispatcherProvider, LinuxDispatcherTimer
- Add Native folder with P/Invoke wrappers (GTK, GLib, GDK, Cairo, WebKit)
- Add GTK host window system with GtkHostWindow and GtkSkiaSurfaceWidget
- Update LinuxApplication with GTK mode, theme handling, and icon support
- Fix duplicate LinuxDispatcher in LinuxMauiContext
Handlers:
- Add GtkWebViewManager and GtkWebViewPlatformView for GTK WebView
- Add FlexLayoutHandler and GestureManager
- Update multiple handlers with ToViewHandler fix and missing mappers
- Add MauiHandlerExtensions with ToViewHandler extension method
Views:
- Add SkiaContextMenu with hover, keyboard, and dark theme support
- Add LinuxDialogService with context menu management
- Add SkiaFlexLayout for flex container support
- Update SkiaShell with RefreshTheme, MauiShell, ContentRenderer
- Update SkiaWebView with SetMainWindow, ProcessGtkEvents
- Update SkiaImage with LoadFromBitmap method
Services:
- Add AppInfoService, ConnectivityService, DeviceDisplayService, DeviceInfoService
- Add GtkHostService, GtkContextMenuService, MauiIconGenerator
Window:
- Add CursorType enum and GtkHostWindow
- Update X11Window with SetIcon, SetCursor methods
Build: SUCCESS (0 errors)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:19:58 -05:00
|
|
|
{
|
2026-01-17 02:23:05 +00:00
|
|
|
SystemTheme.Dark => AppTheme.Dark,
|
|
|
|
|
SystemTheme.Light => AppTheme.Light,
|
|
|
|
|
_ => AppTheme.Unspecified
|
|
|
|
|
};
|
Major production merge: GTK support, context menus, and dispatcher fixes
Core Infrastructure:
- Add Dispatching folder with LinuxDispatcher, LinuxDispatcherProvider, LinuxDispatcherTimer
- Add Native folder with P/Invoke wrappers (GTK, GLib, GDK, Cairo, WebKit)
- Add GTK host window system with GtkHostWindow and GtkSkiaSurfaceWidget
- Update LinuxApplication with GTK mode, theme handling, and icon support
- Fix duplicate LinuxDispatcher in LinuxMauiContext
Handlers:
- Add GtkWebViewManager and GtkWebViewPlatformView for GTK WebView
- Add FlexLayoutHandler and GestureManager
- Update multiple handlers with ToViewHandler fix and missing mappers
- Add MauiHandlerExtensions with ToViewHandler extension method
Views:
- Add SkiaContextMenu with hover, keyboard, and dark theme support
- Add LinuxDialogService with context menu management
- Add SkiaFlexLayout for flex container support
- Update SkiaShell with RefreshTheme, MauiShell, ContentRenderer
- Update SkiaWebView with SetMainWindow, ProcessGtkEvents
- Update SkiaImage with LoadFromBitmap method
Services:
- Add AppInfoService, ConnectivityService, DeviceDisplayService, DeviceInfoService
- Add GtkHostService, GtkContextMenuService, MauiIconGenerator
Window:
- Add CursorType enum and GtkHostWindow
- Update X11Window with SetIcon, SetCursor methods
Build: SUCCESS (0 errors)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:19:58 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AppPackagingModel PackagingModel
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Environment.GetEnvironmentVariable("FLATPAK_ID") != null)
|
|
|
|
|
{
|
|
|
|
|
return AppPackagingModel.Packaged;
|
|
|
|
|
}
|
|
|
|
|
if (Environment.GetEnvironmentVariable("SNAP") != null)
|
|
|
|
|
{
|
|
|
|
|
return AppPackagingModel.Packaged;
|
|
|
|
|
}
|
|
|
|
|
if (Environment.GetEnvironmentVariable("APPIMAGE") != null)
|
|
|
|
|
{
|
|
|
|
|
return AppPackagingModel.Packaged;
|
|
|
|
|
}
|
|
|
|
|
return AppPackagingModel.Unpackaged;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AppInfoService()
|
|
|
|
|
{
|
|
|
|
|
_entryAssembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly();
|
|
|
|
|
_packageName = _entryAssembly.GetName().Name ?? "Unknown";
|
|
|
|
|
_name = _entryAssembly.GetCustomAttribute<AssemblyTitleAttribute>()?.Title ?? _packageName;
|
|
|
|
|
_versionString = (_version = _entryAssembly.GetName().Version ?? new Version(1, 0)).ToString();
|
|
|
|
|
_buildString = _entryAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? _versionString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ShowSettingsUI()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Process.Start(new ProcessStartInfo
|
|
|
|
|
{
|
|
|
|
|
FileName = "gnome-control-center",
|
|
|
|
|
UseShellExecute = true
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Process.Start(new ProcessStartInfo
|
|
|
|
|
{
|
|
|
|
|
FileName = "xdg-open",
|
|
|
|
|
Arguments = "x-settings:",
|
|
|
|
|
UseShellExecute = true
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|