Compare commits

..

1 Commits

Author SHA1 Message Date
Travis McLane 0e0db50dea ensure event listener is activated (hooks)
The OS X delegate listener for an event is only activated if the
`on` call is made for the event id.
This is an optimization to prevent flooding the application with
events that the application does not actually care about.
The `impl.on` call is what activates the response handler for the
event in question.  This logic was missing in the RegisterHooks()
function but is present in the `On()` function.  In the case of using
`On()` first followed by `RegisterHooks()` things work correctly.
2024-04-26 13:47:08 -05:00
2 changed files with 3 additions and 9 deletions
-9
View File
@@ -6,15 +6,6 @@ on:
types: [submitted]
jobs:
debug_context:
name: Debug Context
runs-on: ubuntu-latest
steps:
- name: Print GitHub Context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
check_docs:
name: Check Docs
if: ${{github.repository == 'wailsapp/wails' && contains(github.head_ref,'feature/')}}
+3
View File
@@ -397,6 +397,9 @@ func (a *App) RegisterHook(eventType events.ApplicationEventType, callback func(
callback: callback,
}
a.applicationEventHooks[eventID] = append(a.applicationEventHooks[eventID], thisHook)
if a.impl != nil {
go a.impl.on(eventID)
}
return func() {
a.applicationEventHooksLock.Lock()