fix(macos): fix print dialog not opening and add Window.Print() to runtime (#4290)
The print dialog was not opening on macOS because the CGO windowPrint function was passing the wrong pointer type to NSPrintOperation's runOperationModalForWindow method. It was passing the raw void* window instead of the properly cast WebviewWindow* nsWindow.
This also adds a Window.Print() method to the JavaScript runtime, allowing frontend code to trigger the print dialog directly without needing a Go binding.
Changes:
- Fix webview_window_darwin.go to use nsWindow instead of window
- Add WindowPrint constant (51) and handler to messageprocessor_window.go
- Add Print() method to window.ts in the runtime
- Rebuild bundled runtime (runtime.js and runtime.debug.js)
- Add print example in v3/examples/print to demonstrate both Go API and JS runtime methods
- Update API documentation for Window.Print() in both Go and JavaScript references
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Remove the setup.Action that runs the wizard when calling `wails setup`.
The signing and entitlements subcommands are retained.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* All changes are complete. Here's a summary of what was implemented for issue #3896:
## Summary
Added four new WebKit2 load-change events for Linux to match WebKitGTK's documented load-change signals:
### New Events
| Event | ID | WebKit Signal | Description |
|-------|-----|---------------|-------------|
| `WindowLoadStarted` | 1059 | `WEBKIT_LOAD_STARTED` | Fired when page load begins |
| `WindowLoadRedirected` | 1060 | `WEBKIT_LOAD_REDIRECTED` | Fired when a redirect occurs |
| `WindowLoadCommitted` | 1061 | `WEBKIT_LOAD_COMMITTED` | Fired when load is committed |
| `WindowLoadFinished` | 1062 | `WEBKIT_LOAD_FINISHED` | Fired when load completes |
### Files Modified
1. **`v3/pkg/events/events.go`** - Added new event types to `linuxEvents` struct and updated all platform event IDs (Mac, Windows, iOS shifted by +4 to accommodate new Linux events)
2. **`v3/pkg/events/events_linux.h`** - Added C defines for new events
3. **`v3/pkg/application/linux_cgo.go`** - Updated `handleLoadChanged()` to dispatch all four load events
4. **`v3/UNRELEASED_CHANGELOG.md`** - Documented the new feature
### Backward Compatibility
- The existing `WindowLoadChanged` event (1058) continues to fire on `WEBKIT_LOAD_FINISHED` for backward compatibility
- `WindowLoadFinished` also fires on `WEBKIT_LOAD_FINISHED` for consistent naming with the new events
Would you like me to commit these changes?
* These are the remaining changes that need to be committed - the generator properly updated:
1. `events.txt` - source of truth for events
2. `event_types.ts` - TypeScript runtime types for JS/TS clients
3. `events_darwin.h` - Mac C header with updated event IDs
4. `events_ios.h` - iOS C header with updated event IDs
These are the final changes needed on top of the previous commit. Would you like me to commit these changes?
* chore: add new Linux WebKit2 load events to known_events.go
Add WindowLoadStarted, WindowLoadRedirected, WindowLoadCommitted,
and WindowLoadFinished to the known events registry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add Linux WebKit2 load events to events-reference guide
Document the new WindowLoadStarted, WindowLoadRedirected,
WindowLoadCommitted, and WindowLoadFinished events in the
Linux Events section of the events reference guide.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update UNRELEASED_CHANGELOG
* refactor(linux): remove deprecated WindowLoadChanged event
Remove the legacy WindowLoadChanged event and replace all internal
references with WindowLoadFinished. This simplifies the event system
by having granular events (LoadStarted, LoadRedirected, LoadCommitted,
LoadFinished) rather than a generic LoadChanged that fired on any state.
- Remove WindowLoadChanged from events.go and event_types.ts
- Update linux_cgo.go to only fire WindowLoadFinished
- Update webview_window_linux.go hooks to use WindowLoadFinished
- Regenerate runtime bundles and known_events
- Update events documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add breaking change note for WindowLoadChanged removal
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* ## Summary
I've implemented the fix for issue #4575. Here's what was changed:
### Changes Made
**File: `v3/internal/commands/build_assets/linux/Taskfile.yml`**
1. Added `generate:dotdesktop` as a dependency to `build:native` task (line 45)
2. Added `generate:dotdesktop` as a dependency to `build:docker` task (line 63)
This ensures that the `.desktop` file is generated during every Linux build (both native and Docker-based), not just during packaging operations.
### How it works
- When running `wails build` or `wails dev` on Linux, the build process now automatically generates a `.desktop` file at `build/linux/<app-name>.desktop`
- The `.desktop` file contains:
- Application name
- Executable path
- Icon reference
- Categories (defaulting to "Development")
- This allows Linux desktop environments to properly display the application icon and metadata even during development
### Testing
To test the changes:
1. Create a new Wails v3 project: `wails3 init -n testapp`
2. Build it: `cd testapp && wails3 build`
3. Verify the `.desktop` file exists: `cat build/linux/testapp.desktop`
Would you like me to run a test or make any additional changes?
* feat(linux): generate .desktop file during build (#4575)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Add documentation for:
- Runtime dependencies table for different Linux distributions
- WebKit2GTK ABI version differences (4.0 vs 4.1)
- Build tags for targeting different ABI versions
- nfpm configuration examples for packaging
Based on community contribution in #4339.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for:
- Runtime dependencies table for different Linux distributions
- WebKit2GTK ABI version differences (4.0 vs 4.1)
- Build tags for targeting different ABI versions
- nfpm configuration examples for packaging
Based on community contribution in #4339.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The pathToURI function was using url.PathEscape which incorrectly
escapes forward slashes (/ -> %2F). This caused file URIs like:
/home/angaz -> file://%2Fhome%2Fangaz (broken)
File managers couldn't parse these malformed URIs correctly, causing
them to open the wrong directory (often a parent directory).
Fixed by using url.URL struct to properly construct file URIs:
/home/angaz -> file:///home/angaz (correct)
Spaces and other special characters are still properly escaped.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+) compile
libraries with .relr.dyn ELF sections. The bundled strip binary in
linuxdeploy cannot process these sections, causing AppImage builds to fail.
This commit:
- Adds hasRelrDynSections() to proactively detect modern toolchains
- Automatically disables stripping (NO_STRIP=1) when detected
- Fixes error output to properly display as string
- Adds documentation explaining the issue and workaround
Fixes#4642🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+) compile
libraries with .relr.dyn ELF sections. The bundled strip binary in
linuxdeploy cannot process these sections, causing AppImage builds to fail.
This commit:
- Adds hasRelrDynSections() to proactively detect modern toolchains
- Automatically disables stripping (NO_STRIP=1) when detected
- Fixes error output to properly display as string
- Adds documentation explaining the issue and workaround
Fixes#4642🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix not enough memory error when initialising drag and drop on windows
Co-authored-by: Andraz Vrhovec <andraz@koofr.net>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* fix: prevent window menu crash on Wayland by realizing window before showing
On Wayland with GTK3, the appmenu-gtk-module tries to set DBus properties
for global menu integration before the window is fully realized, causing
a crash with the error "GDK_IS_WAYLAND_WINDOW (window) assertion failed".
The fix calls gtk_widget_realize() before gtk_widget_show_all() to ensure
the window has a valid GdkWindow when the menu system accesses it.
This fix is applied to both the CGO and purego implementations.
Fixeswailsapp/wails#4769🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add Wayland detection to wails3 doctor and test for #4769
- Add Wayland session detection row to `wails3 doctor` output on Linux
- Create test project v3/test/4769-menu to manually verify the menu fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: sanitize GTK application name to prevent crashes with invalid characters
Application names containing spaces, parentheses, hash symbols, or other
invalid characters would cause GTK to fail with an assertion error.
Added sanitizeAppName() function that:
- Replaces invalid characters with underscores
- Handles leading digits
- Removes consecutive underscores
- Defaults to "wailsapp" if empty
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use structured logging for debug/info methods
The debug() and info() methods were using fmt.Sprintf() which expects
printf-style format directives, but callers were using slog-style
key-value pairs. Changed to pass args directly to Logger.Debug/Info
which properly handles structured logging.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add changelog entries for build fixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: remove temporary debug print statements from mobile merge
Remove emoji debug logs (🔴, 🟢, 🟠, 🔵, 🔥) that were accidentally left in
from the iOS/Android mobile platform support merge. These were development
debugging statements that should not have been included in the final code.
Files cleaned:
- application.go
- application_debug.go
- init_android.go
- init_ios.go
- mainthread_android.go
- mainthread_ios.go
- webview_window.go
- webview_window_ios.go
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add changelog entries for debug cleanup and breaking change
- Add breaking change note: production builds are now default
- Add entry for debug print statement removal
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: convert remaining printf-style debug calls to slog-style
Convert three debug() calls that were still using printf-style format
strings to slog-style structured logging (key-value pairs):
- systemtray_windows.go: ShellNotifyIcon show/hide failures
- application_darwin.go: window lookup failure
This addresses CodeRabbit review feedback and ensures consistency
with the refactored debug() method.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: convert all printf-style info() calls to slog-style
Convert remaining info() calls that were using printf-style format
strings to slog-style structured logging (key-value pairs):
- application_ios.go: iOS log messages and HandleJSMessage calls
- webview_window_windows.go: WM_SYSKEYDOWN logging
- application.go: handleWindowMessage and handleWebViewRequest logging
Also removed debug fmt.Printf statements from handleWebViewRequest.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add build tag to main.m to prevent Go from compiling it on non-iOS platforms
Go's toolchain tries to process .m (Objective-C) files when they're in a
directory with Go files. Adding a //go:build ios tag tells Go to only
process this file when building for iOS, matching how darwin .m files
handle this (e.g., //go:build darwin && !ios).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: remove orphaned wails-mimetype-migration submodule reference
The iOS merge added a submodule reference without a corresponding
.gitmodules file, causing Cloudflare and other CI systems to fail
with "No url found for submodule path" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: auto-disable DMA-BUF renderer on Wayland with NVIDIA to prevent crashes
WebKitGTK has a known issue with the DMA-BUF renderer on NVIDIA proprietary
drivers running Wayland, causing "Error 71 (Protocol error)" crashes.
This fix automatically detects NVIDIA GPUs (via /sys/module/nvidia) and sets
WEBKIT_DISABLE_DMABUF_RENDERER=1 when running on Wayland.
Also removes leftover debug print statements from mobile platform merge.
See: https://bugs.webkit.org/show_bug.cgi?id=262607🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add NVIDIA driver info to wails3 doctor on Linux
Shows NVIDIA driver version and srcversion in doctor output to help
diagnose Wayland/NVIDIA compatibility issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
The iOS service stubs were importing a non-existent package
`github.com/wailsapp/wails/v3/pkg/services` and using an incompatible
interface pattern.
This fix rewrites both files to follow the same pattern as other platforms
(Linux, Windows, Darwin):
- Implement the internal platformDock/platformNotifier interfaces
- Provide New() functions returning *DockService/*NotificationService
- Stub all required interface methods
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove local database files that shouldn't be tracked in version control.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
⚠️ EXPERIMENTAL: This feature is under active development and may change.
This merge adds initial support for building Wails applications for iOS
and Android platforms. Desktop builds are completely unaffected as mobile
code uses platform-specific build tags.
## What's Included
### iOS Support
- Native iOS app structure with WKWebView
- iOS-specific runtime methods (haptics, device info, scroll settings, etc.)
- Xcode project generation (`wails3 ios xcode:gen`)
- iOS Simulator deployment via Taskfile
- Native UITabBar support
- iOS application lifecycle events
### Android Support
- Android app structure with WebView
- Android-specific runtime methods (haptics, device info, toast)
- Gradle-based build system
- APK generation and emulator deployment
- Android NDK cross-compilation support
### Transport Layer
- iOS and Android message processors adapted to new RuntimeRequest pattern
- Mobile-specific error types (InvalidIOSCallError, InvalidAndroidCallError)
- Platform stubs for non-mobile builds
### Build System
- New Taskfile includes for ios: and android: tasks
- Lazy SDK_PATH evaluation (iOS builds don't break Android on Linux)
- Project templates include mobile build configurations
## Requirements
- iOS: macOS with Xcode 15+
- Android: Android Studio with NDK r26d
## Known Limitations
- Some mobile APIs are stubbed pending full implementation
- Mobile builds require platform-specific toolchains
- Not yet tested in production environments
Report issues: https://github.com/wailsapp/wails/issues🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The iOS branch modified events.go with debug println statements and
changed the EventProcessor.Emit signature from returning error to void.
This broke compatibility with event_manager.go and messageprocessor_events.go.
Restored the v3-alpha version which:
- Uses atomic.Bool for cancelled flags (thread-safe)
- Has EventProcessor.Emit return error for validation
- Includes decodeEventData and validateCustomEvent functions
- Removes debug println statements
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate iOS subcommand registration in main.go (merge artifact)
- Make SDK_PATH a task-level variable in iOS Taskfile to avoid eager
evaluation that fails on non-macOS systems when running Android builds
This fixes Android builds failing with "xcrun: command not found" on
Linux systems where Xcode tools are unavailable.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix merge conflict marker in application_options.go
- Add AGENTS.md with beads workflow documentation for AI agents
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit integrates Android platform support for Wails v3.
Key changes:
- Add Android-specific application, webview, and runtime files
- Add Android event types
- Add Android examples and build system (Gradle)
- Add JNI bridge for Go <-> Java communication
- Update application options for Android configuration
- Add Android include to common Taskfile template
Note: The Android branch was more recent than the iOS branch
and had fewer conflicts with the transport layer refactor.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit integrates iOS platform support for Wails v3, adapting the
iOS-specific code to work with the new transport layer architecture.
Key changes:
- Add iOS-specific application, webview, and runtime files
- Add iOS event types and processing
- Add iOS examples and templates
- Update messageprocessor to handle iOS requests
- Move badge_ios.go to dock package
Note: The iOS branch was based on an older v3-alpha and required
significant conflict resolution due to the transport layer refactor
(PR #4702). Some iOS-specific code may need further adaptation:
- processIOSMethod needs to be implemented with new RuntimeRequest signature
- iOS event generation in tasks/events/generate.go needs updating
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add aria-label to elements in the helloworld app templates so they can be directly tested by Appium based E2E test clients
* changelog updated
* fix: restore UNRELEASED_CHANGELOG.md to correct state
Remove accidentally merged changelog entries from other PRs and
restore the base entries from v3-alpha with only this PR's changelog entry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix(v3): fixed update plist, close https://github.com/wailsapp/wails/issues/4636
* chore: update changelog
* feat: add recursive merge support for nested plist dictionaries
Previously, the plist merge was shallow - nested dictionaries were
completely replaced rather than recursively merged. This caused custom
nested configurations to be lost during build asset updates.
Now nested dictionaries are recursively merged, preserving custom keys
at all levels while still allowing new keys to be added and existing
keys to be updated.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: replace temp directory with backup-based plist merge
Instead of extracting to a temp directory and copying files over,
we now:
1. Rename existing plists to .plist.bak
2. Extract new assets directly to target
3. Merge backup content into newly extracted plists
4. Clean up backup files
This is simpler, more crash-safe (backups remain if process crashes),
and avoids the overhead of a temp directory and file copying.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add window name header when making webview requests
* Add changelog item
* Update PR no in changelog entry
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Replace <Aside type="caution"> JSX with :::caution markdown syntax
to fix the docs build error.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update `RawMessageHandler` to include `originInfo` parameter in documentation
- Expanded examples and handler signature to reflect the additional `originInfo` parameter.
- Detailed `OriginInfo` structure and its platform-specific behaviors added.
* Expand `raw-messages` documentation to include origin validation guidance
* Add support for origin tracking in raw message handling
- Implemented origin and top origin tracking for web messages from JavaScript.
- Updated `RawMessageHandler` to include `originInfo`.
- Added cross-platform support for retrieving the origin of messages in macOS, Windows, and Linux.
* fix build
* fix build
* fix build
* fix build
* fix build
* Fix nil checks and string handling for message origins across platforms
- Ensure proper fallback to empty strings for `origin` and `topOrigin` when errors or nil values are encountered.
- Normalize handling of `message.body` to account for non-NSString values in macOS.
* add docs
* Remove unused doc
* update changelog
* fix build
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* Rename `HandleCustomProtocol` to `HandleOpenURL` and add universal link support on macOS.
* Update changelog.
* add docs
* add docs
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
- Add RawMessageHandler section to Application API reference
- Add System.invoke() to Frontend Runtime reference
- Create comprehensive Raw Messages guide
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update tests to match the new wrapTask behavior introduced in the
cross-platform build system:
- Task names are now prefixed with platform (e.g., linux:build)
- ARCH argument is automatically added based on GOARCH
- GOOS/GOARCH args are filtered from remaining args
- Environment variables are respected with arg overrides
Also adds test for the new SignWrapper command.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use NullLogger instead of DefaultPtermLogger during tests to prevent
console output. Warnings are still written to warnings.log for
comparison. This prevents GitHub Actions Go problem matcher from
treating any warning-like output as errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test to prefix warnings with [warn] when writing to warnings.log,
and update all fixture files accordingly. This prevents the Go problem
matcher from treating diff output as errors during CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>