diff --git a/v2/internal/app/debug.go b/v2/internal/app/debug.go index f6d70105..7bcabc3c 100644 --- a/v2/internal/app/debug.go +++ b/v2/internal/app/debug.go @@ -4,6 +4,9 @@ package app // Init initialises the application for a debug environment func (a *App) Init() error { + // Indicate debug mode a.debug = true + // Enable dev tools + a.options.DevTools = true return nil } diff --git a/v2/internal/app/desktop.go b/v2/internal/app/desktop.go index 3a42a993..79ea71a3 100644 --- a/v2/internal/app/desktop.go +++ b/v2/internal/app/desktop.go @@ -142,7 +142,7 @@ func (a *App) Run() error { return err } - result := a.window.Run(dispatcher, bindingDump) + result := a.window.Run(dispatcher, bindingDump, a.debug) a.logger.Trace("Ffenestri.Run() exited") a.servicebus.Stop() diff --git a/v2/internal/app/hybrid.go b/v2/internal/app/hybrid.go index f39e7d64..d273e261 100644 --- a/v2/internal/app/hybrid.go +++ b/v2/internal/app/hybrid.go @@ -64,9 +64,7 @@ func CreateApp(options *Options) *App { MaxWidth: options.MaxWidth, MaxHeight: options.MaxHeight, StartHidden: options.StartHidden, - - // This should be controlled by the compile time flags... - DevTools: true, + DevTools: options.DevTools, Resizable: !options.DisableResize, Fullscreen: options.Fullscreen, diff --git a/v2/internal/ffenestri/ffenestri.go b/v2/internal/ffenestri/ffenestri.go index 0a0cfef9..86f56bc0 100644 --- a/v2/internal/ffenestri/ffenestri.go +++ b/v2/internal/ffenestri/ffenestri.go @@ -25,10 +25,6 @@ import ( */ import "C" -// DEBUG is the global Ffenestri debug flag. -// TODO: move to compile time. -var DEBUG bool = true - // Application is our main application object type Application struct { config *options.App @@ -108,7 +104,7 @@ func intToColour(colour int) (C.int, C.int, C.int, C.int) { } // Run the application -func (a *Application) Run(incomingDispatcher Dispatcher, bindings string) error { +func (a *Application) Run(incomingDispatcher Dispatcher, bindings string, debug bool) error { title := a.string2CString(a.config.Title) width := C.int(a.config.Width) height := C.int(a.config.Height) @@ -117,6 +113,8 @@ func (a *Application) Run(incomingDispatcher Dispatcher, bindings string) error fullscreen := a.bool2Cint(a.config.Fullscreen) startHidden := a.bool2Cint(a.config.StartHidden) logLevel := C.int(a.config.LogLevel) + println("debug = ", debug) + println("devtools = ", a.config.DevTools) app := C.NewApplication(title, width, height, resizable, devtools, fullscreen, startHidden, logLevel) // Save app reference @@ -133,7 +131,7 @@ func (a *Application) Run(incomingDispatcher Dispatcher, bindings string) error C.SetMaxWindowSize(a.app, maxWidth, maxHeight) // Set debug if needed - C.SetDebug(app, a.bool2Cint(DEBUG)) + C.SetDebug(app, a.bool2Cint(debug)) // TODO: Move frameless to Linux options // if a.config.Frameless { diff --git a/v2/pkg/options/default.go b/v2/pkg/options/default.go index 90f11ce0..46341685 100644 --- a/v2/pkg/options/default.go +++ b/v2/pkg/options/default.go @@ -10,7 +10,7 @@ var Default = &App{ Title: "My Wails App", Width: 1024, Height: 768, - DevTools: true, + DevTools: false, RGBA: 0xFFFFFFFF, Mac: &mac.Options{ TitleBar: mac.TitleBarDefault(), diff --git a/v2/test/kitchensink/icon.png b/v2/test/kitchensink/icon.png new file mode 100644 index 00000000..a2b30415 Binary files /dev/null and b/v2/test/kitchensink/icon.png differ