From 5481f3a6847b28e49b49a8e4d5cf8692fbb40806 Mon Sep 17 00:00:00 2001 From: Gabriel Lima <39922116+TheGB0077@users.noreply.github.com> Date: Sun, 8 Sep 2024 07:22:42 -0300 Subject: [PATCH] [linux] fix: update for new events syntax (#3734) Changed uses of deprecated `.On` to the current standard. --- v3/pkg/application/application_linux.go | 2 +- v3/pkg/application/events_common_linux.go | 2 +- v3/pkg/application/webview_window_linux.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/v3/pkg/application/application_linux.go b/v3/pkg/application/application_linux.go index 2ddc207f3..19f789c05 100644 --- a/v3/pkg/application/application_linux.go +++ b/v3/pkg/application/application_linux.go @@ -94,7 +94,7 @@ func (a *linuxApp) setApplicationMenu(menu *Menu) { func (a *linuxApp) run() error { - a.parent.On(events.Linux.ApplicationStartup, func(evt *ApplicationEvent) { + a.parent.OnApplicationEvent(events.Linux.ApplicationStartup, func(evt *ApplicationEvent) { // TODO: What should happen here? }) a.setupCommonEvents() diff --git a/v3/pkg/application/events_common_linux.go b/v3/pkg/application/events_common_linux.go index d515dea15..812befea8 100644 --- a/v3/pkg/application/events_common_linux.go +++ b/v3/pkg/application/events_common_linux.go @@ -13,7 +13,7 @@ func (a *linuxApp) setupCommonEvents() { for sourceEvent, targetEvent := range commonApplicationEventMap { sourceEvent := sourceEvent targetEvent := targetEvent - a.parent.On(sourceEvent, func(event *ApplicationEvent) { + a.parent.OnApplicationEvent(sourceEvent, func(event *ApplicationEvent) { event.Id = uint(targetEvent) applicationEvents <- event }) diff --git a/v3/pkg/application/webview_window_linux.go b/v3/pkg/application/webview_window_linux.go index 22ede4696..aff492c35 100644 --- a/v3/pkg/application/webview_window_linux.go +++ b/v3/pkg/application/webview_window_linux.go @@ -289,7 +289,7 @@ func (w *linuxWebviewWindow) run() { } w.setURL(startURL) - w.parent.On(events.Linux.WindowLoadChanged, func(_ *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowLoadChanged, func(_ *WindowEvent) { if w.parent.options.JS != "" { w.execJS(w.parent.options.JS) } @@ -298,19 +298,19 @@ func (w *linuxWebviewWindow) run() { w.execJS(js) } }) - w.parent.On(events.Linux.WindowFocusIn, func(e *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowFocusIn, func(e *WindowEvent) { w.parent.emit(events.Common.WindowFocus) }) - w.parent.On(events.Linux.WindowFocusOut, func(e *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowFocusOut, func(e *WindowEvent) { w.parent.emit(events.Common.WindowLostFocus) }) - w.parent.On(events.Linux.WindowDeleteEvent, func(e *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowDeleteEvent, func(e *WindowEvent) { w.parent.emit(events.Common.WindowClosing) }) - w.parent.On(events.Linux.WindowDidMove, func(e *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowDidMove, func(e *WindowEvent) { w.parent.emit(events.Common.WindowDidMove) }) - w.parent.On(events.Linux.WindowDidResize, func(e *WindowEvent) { + w.parent.OnWindowEvent(events.Linux.WindowDidResize, func(e *WindowEvent) { w.parent.emit(events.Common.WindowDidResize) })