mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Fix context menu issues.
Fix WindowID for requests on windows. Add `Windows.ApplicationStarted` event
This commit is contained in:
@@ -17,22 +17,22 @@ The main goal is to get most of the examples working on all platforms.
|
||||
- P - Partially working
|
||||
- N - Not working
|
||||
|
||||
| Example | Mac | Windows | Linux |
|
||||
|--------------|-----|---------|-------|
|
||||
| binding | | W | |
|
||||
| build | | W | |
|
||||
| clipboard | | W | |
|
||||
| contextmenus | | N | |
|
||||
| dialog | | W | |
|
||||
| events | | N | |
|
||||
| frameless | | W | |
|
||||
| keybindings | | W | |
|
||||
| menu | | W | |
|
||||
| plain | | W | |
|
||||
| screen | | W | |
|
||||
| systray | | W | |
|
||||
| window | | W | |
|
||||
| wml | | W | |
|
||||
| Example | Mac | Windows | Linux |
|
||||
|---------------|-----|---------|-------|
|
||||
| binding | | W | |
|
||||
| build | | W | |
|
||||
| clipboard | | W | |
|
||||
| context menus | | W | |
|
||||
| dialog | | W | |
|
||||
| events | | W | |
|
||||
| frameless | | W | |
|
||||
| keybindings | | W | |
|
||||
| menu | | W | |
|
||||
| plain | | W | |
|
||||
| screen | | W | |
|
||||
| systray | | W | |
|
||||
| window | | W | |
|
||||
| wml | | W | |
|
||||
|
||||
|
||||
### Alpha 2
|
||||
|
||||
@@ -35,7 +35,7 @@ require (
|
||||
github.com/samber/lo v1.38.1 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.7 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
|
||||
@@ -105,6 +105,7 @@ github.com/tmclane/purego v0.0.0-20230601213035-1f25e70d7b01 h1:oQwu3iNDywGp1Hry
|
||||
github.com/tmclane/purego v0.0.0-20230601213035-1f25e70d7b01/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
|
||||
@@ -1,14 +1,32 @@
|
||||
# contextmenus
|
||||
|
||||
This example shows how to create a context menu for your application.
|
||||
It demonstrates window level and global context menus.
|
||||
|
||||
A simple menu is registered with the window and the application with the id "test".
|
||||
In our frontend html, we then use the `--custom-contextmenu` style to attach the menu to an element.
|
||||
We also use the `--custom-contextmenu-data` style to pass data to the menu callback which can be read in Go.
|
||||
This is really useful when using components to distinguish between different elements.
|
||||
|
||||
```go
|
||||
|
||||
```html
|
||||
|
||||
<div class="region" id="123abc" style="--custom-contextmenu: test; --custom-contextmenu-data: 1">
|
||||
<h1>1</h1>
|
||||
</div>
|
||||
<div class="region" id="234abc" style="--custom-contextmenu: test; --custom-contextmenu-data: 2">
|
||||
<h1>2</h1>
|
||||
</div>
|
||||
```
|
||||
|
||||
# Status
|
||||
|
||||
| Platform | Status |
|
||||
|----------|-------------|
|
||||
| Mac | |
|
||||
| Windows | Not Working |
|
||||
| Linux | |
|
||||
| Platform | Status |
|
||||
|----------|---------|
|
||||
| Mac | |
|
||||
| Windows | Working |
|
||||
| Linux | |
|
||||
|
||||
# TODO
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
@@ -38,12 +37,12 @@ func main() {
|
||||
|
||||
contextMenu := app.NewMenu()
|
||||
contextMenu.Add("Click Me").OnClick(func(data *application.Context) {
|
||||
fmt.Printf("Context menu data: %+v\n", data.ContextMenuData())
|
||||
app.Logger.Info("Context menu", "context data", data.ContextMenuData())
|
||||
})
|
||||
|
||||
globalContextMenu := app.NewMenu()
|
||||
globalContextMenu.Add("Default context menu item").OnClick(func(data *application.Context) {
|
||||
fmt.Printf("Context menu data: %+v\n", data.ContextMenuData())
|
||||
app.Logger.Info("Context menu", "context data", data.ContextMenuData())
|
||||
})
|
||||
|
||||
// Registering the menu with a window will make it available to that window only
|
||||
|
||||
@@ -33,7 +33,7 @@ require (
|
||||
github.com/samber/lo v1.38.1 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.7 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
|
||||
@@ -105,6 +105,7 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
# Events Example
|
||||
|
||||
This example is not ready for testing yet.
|
||||
This example is a demonstration of using the new events API.
|
||||
It has 2 windows that can emit events from the frontend and the backend emits an event every 10 seconds.
|
||||
All events emitted are logged either to the console or the window.
|
||||
|
||||
It also demonstrates the use of `RegisterHook` to register a function to be called when an event is emitted.
|
||||
For one window, it captures the `WindowClosing` event and prevents the window from closing twice.
|
||||
The other window uses both hooks and events to show the window is gaining focus.
|
||||
|
||||
## Running the example
|
||||
|
||||
To run the example, simply run the following command:
|
||||
|
||||
```bash
|
||||
go run main.go
|
||||
```
|
||||
|
||||
# Status
|
||||
|
||||
| Platform | Status |
|
||||
|----------|---------|
|
||||
| Mac | |
|
||||
| Windows | Working |
|
||||
| Linux | |
|
||||
@@ -28,13 +28,12 @@ func main() {
|
||||
|
||||
// Custom event handling
|
||||
app.Events.On("myevent", func(e *application.WailsEvent) {
|
||||
app.Logger.Info("[Go] WailsEvent received: %+v\n", e)
|
||||
app.Logger.Info("[Go] WailsEvent received", "name", e.Name, "data", e.Data, "sender", e.Sender, "cancelled", e.Cancelled)
|
||||
})
|
||||
|
||||
// OS specific application events
|
||||
app.On(events.Common.ApplicationStarted, func(event *application.Event) {
|
||||
for {
|
||||
app.Logger.Info("Sending event from Go!")
|
||||
app.Events.Emit(&application.WailsEvent{
|
||||
Name: "myevent",
|
||||
Data: "hello",
|
||||
|
||||
@@ -32,7 +32,7 @@ require (
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/samber/lo v1.38.1 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.7 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
|
||||
@@ -99,6 +99,7 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
|
||||
@@ -40,7 +40,7 @@ require (
|
||||
github.com/samber/lo v1.38.1 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.7 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
|
||||
@@ -118,6 +118,7 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
|
||||
@@ -35,7 +35,7 @@ require (
|
||||
github.com/samber/lo v1.38.1 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.7 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
|
||||
@@ -105,6 +105,7 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8-0.20231010092311-42cbb98eb53b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
|
||||
@@ -29,7 +29,7 @@ require (
|
||||
github.com/pterm/pterm v0.12.51
|
||||
github.com/samber/lo v1.38.1
|
||||
github.com/tc-hib/winres v0.1.6
|
||||
github.com/wailsapp/go-webview2 v1.0.7
|
||||
github.com/wailsapp/go-webview2 v1.0.8
|
||||
github.com/wailsapp/mimetype v1.4.1
|
||||
golang.org/x/net v0.10.0
|
||||
golang.org/x/sys v0.13.0
|
||||
|
||||
@@ -111,8 +111,6 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/go-task/task/v3 v3.30.1 h1:HdfCTAJDHoWL3+3RyY+o+0IK1O5xQaSBrZIq2SKOQ84=
|
||||
github.com/go-task/task/v3 v3.30.1/go.mod h1:QPFn/f18HEmOhbuBYhlQOXX6ZogqzjQz31GA45uZ0mI=
|
||||
github.com/go-task/task/v3 v3.31.0 h1:o6iyj9gPJXxvxPi/u/l8e025PmM2BqKgtLNPS2i7hV4=
|
||||
github.com/go-task/task/v3 v3.31.0/go.mod h1:/CPDAu9nS3+soqY/e1tTrSo/zxk76lnljEV9aBTeKrg=
|
||||
github.com/goccy/go-json v0.9.6/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
@@ -338,8 +336,8 @@ github.com/tc-hib/winres v0.1.6 h1:qgsYHze+BxQPEYilxIz/KCQGaClvI2+yLBAZs+3+0B8=
|
||||
github.com/tc-hib/winres v0.1.6/go.mod h1:pe6dOR40VOrGz8PkzreVKNvEKnlE8t4yR8A8naL+t7A=
|
||||
github.com/tmclane/purego v0.0.0-20230818202843-0b72c8c9140f h1:/HXk9aFXP97CJRzOIphm4pzySmJLqIMhKu1kD5usz1E=
|
||||
github.com/tmclane/purego v0.0.0-20230818202843-0b72c8c9140f/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.8 h1:hyoFPlMSfb/NM64wuVbgBaq1MASJjqsSUYhN+Rbcr9Y=
|
||||
github.com/wailsapp/go-webview2 v1.0.8/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
@@ -461,8 +459,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
|
||||
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -509,16 +505,12 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -7,6 +7,7 @@ export const EventTypes = {
|
||||
APMResumeAutomatic: "windows:APMResumeAutomatic",
|
||||
APMResumeSuspend: "windows:APMResumeSuspend",
|
||||
APMPowerSettingChange: "windows:APMPowerSettingChange",
|
||||
ApplicationStarted: "windows:ApplicationStarted",
|
||||
WebViewNavigationCompleted: "windows:WebViewNavigationCompleted",
|
||||
WindowInactive: "windows:WindowInactive",
|
||||
WindowActive: "windows:WindowActive",
|
||||
|
||||
@@ -180,7 +180,11 @@ func (m *windowsApp) run() error {
|
||||
for eventID := range m.parent.applicationEventListeners {
|
||||
m.on(eventID)
|
||||
}
|
||||
|
||||
// Emit application started event
|
||||
applicationEvents <- &Event{
|
||||
Id: uint(events.Windows.ApplicationStarted),
|
||||
ctx: blankApplicationEventContext,
|
||||
}
|
||||
_ = m.runMainLoop()
|
||||
|
||||
return nil
|
||||
|
||||
@@ -6,6 +6,7 @@ import "github.com/wailsapp/wails/v3/pkg/events"
|
||||
|
||||
var commonApplicationEventMap = map[events.ApplicationEventType]events.ApplicationEventType{
|
||||
events.Windows.SystemThemeChanged: events.Common.ThemeChanged,
|
||||
events.Windows.ApplicationStarted: events.Common.ApplicationStarted,
|
||||
}
|
||||
|
||||
func (m *windowsApp) setupCommonEvents() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user