Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions v3/UNRELEASED_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file

## Fixed
<!-- Bug fixes -->
- Fix GTK4 Linux host dropping custom-protocol and file-association launch arguments in [PR](https://github.com/wailsapp/wails/pull/6000) by @midagedev
- Correctly handle deleted lines and same-source corrections in changelog validation in [PR](https://github.com/wailsapp/wails/pull/5993) by @taliesin-ai

## Deprecated
Expand Down
23 changes: 23 additions & 0 deletions v3/pkg/application/application_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"os"
"path/filepath"
"regexp"
"slices"
"strings"
"sync"

Expand Down Expand Up @@ -87,6 +88,28 @@ func (a *linuxApp) name() string {
}

func (a *linuxApp) run() error {
if len(os.Args) == 2 {
arg1 := os.Args[1]
if strings.Contains(arg1, "://") {
eventContext := newApplicationEventContext()
eventContext.setURL(arg1)
applicationEvents <- &ApplicationEvent{
Id: uint(events.Common.ApplicationLaunchedWithUrl),
ctx: eventContext,
}
} else if a.parent.options.FileAssociations != nil {
ext := filepath.Ext(arg1)
if slices.Contains(a.parent.options.FileAssociations, ext) {
eventContext := newApplicationEventContext()
eventContext.setOpenedWithFile(arg1)
applicationEvents <- &ApplicationEvent{
Id: uint(events.Common.ApplicationOpenedWithFile),
ctx: eventContext,
}
}
}
}

a.parent.Event.OnApplicationEvent(events.Linux.ApplicationStartup, func(evt *ApplicationEvent) {
if err := a.processAndCacheScreens(); err != nil {
a.parent.handleError(err)
Expand Down
Loading