diff --git a/v3/internal/assetserver/webview/responsewriter_linux.go b/v3/internal/assetserver/webview/responsewriter_linux.go index 9b3f53a78..9b4c54472 100644 --- a/v3/internal/assetserver/webview/responsewriter_linux.go +++ b/v3/internal/assetserver/webview/responsewriter_linux.go @@ -28,11 +28,16 @@ type responseWriter struct { header http.Header wroteHeader bool finished bool + code int w io.WriteCloser wErr error } +func (rw *responseWriter) Code() int { + return rw.code +} + func (rw *responseWriter) Header() http.Header { if rw.header == nil { rw.header = http.Header{} @@ -53,6 +58,7 @@ func (rw *responseWriter) Write(buf []byte) (int, error) { } func (rw *responseWriter) WriteHeader(code int) { + rw.code = code if rw.wroteHeader || rw.finished { return } diff --git a/v3/internal/assetserver/webview/responsewriter_linux_purego.go b/v3/internal/assetserver/webview/responsewriter_linux_purego.go index c62f54a55..6742d1bda 100644 --- a/v3/internal/assetserver/webview/responsewriter_linux_purego.go +++ b/v3/internal/assetserver/webview/responsewriter_linux_purego.go @@ -52,9 +52,13 @@ type responseWriter struct { header http.Header wroteHeader bool finished bool + code int + w io.WriteCloser + wErr error +} - w io.WriteCloser - wErr error +func (rw *responseWriter) Code() int { + return rw.code } func (rw *responseWriter) Header() http.Header { @@ -77,6 +81,8 @@ func (rw *responseWriter) Write(buf []byte) (int, error) { } func (rw *responseWriter) WriteHeader(code int) { + rw.code = code + // TODO? Is this ever called? I don't think so! if rw.wroteHeader || rw.finished { return diff --git a/v3/pkg/application/application_linux.go b/v3/pkg/application/application_linux.go index cfb2505da..5c82c3a9c 100644 --- a/v3/pkg/application/application_linux.go +++ b/v3/pkg/application/application_linux.go @@ -83,7 +83,7 @@ func (m *linuxApp) run() error { // Add a hook to the ApplicationDidFinishLaunching event // FIXME: add Wails specific events - i.e. Shouldn't platform specific ones be translated to Wails events? - m.parent.On(events.Mac.ApplicationDidFinishLaunching, func() { + m.parent.On(events.Mac.ApplicationDidFinishLaunching, func(evt *Event) { // Do we need to do anything now? fmt.Println("events.Mac.ApplicationDidFinishLaunching received!") }) @@ -107,6 +107,12 @@ func (m *linuxApp) registerWindow(window pointer, id uint) { m.windowsLock.Unlock() } +func (m *linuxApp) isDarkMode() bool { + // FIXME: How do we detect this? + // Maybe this helps: https://askubuntu.com/questions/1469869/how-does-firefox-detect-light-dark-theme-change-on-kde-systems + return false +} + func newPlatformApp(parent *App) *linuxApp { name := strings.ToLower(strings.Replace(parent.options.Name, " ", "", -1)) if name == "" { diff --git a/v3/pkg/application/systemtray_linux.go b/v3/pkg/application/systemtray_linux.go index a2df18f17..f553bc812 100644 --- a/v3/pkg/application/systemtray_linux.go +++ b/v3/pkg/application/systemtray_linux.go @@ -20,7 +20,7 @@ func (s *linuxSystemTray) setMenu(menu *Menu) { s.menu = menu } -func (s *linuxSystemTray) positionWindow(window *WebviewWindow) error { +func (s *linuxSystemTray) positionWindow(window *WebviewWindow, offset int) error { panic("not implemented") } diff --git a/v3/pkg/application/webview_window_linux.go b/v3/pkg/application/webview_window_linux.go index 182e758a8..cb7ce0ded 100644 --- a/v3/pkg/application/webview_window_linux.go +++ b/v3/pkg/application/webview_window_linux.go @@ -448,7 +448,7 @@ func (w *linuxWebviewWindow) run() { } // We need to wait for the HTML to load before we can execute the javascript // FIXME: What event is this? DomReady? - w.parent.On(events.Mac.WebViewDidFinishNavigation, func(_ *WindowEventContext) { + w.parent.On(events.Mac.WebViewDidFinishNavigation, func(_ *WindowEvent) { if w.parent.options.JS != "" { w.execJS(w.parent.options.JS) }