mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 19:50:15 +08:00
Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" (#1811)
* Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" * GDK_BACKEND should only be set if XDG_SESSION_TYPE is unset, "unspecified" or "x11"
This commit is contained in:
parent
ffb4a1360b
commit
27f36a8edd
@ -58,8 +58,10 @@ func init() {
|
||||
|
||||
func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) *Frontend {
|
||||
|
||||
// Set GDK_BACKEND=x11 to prevent warnings
|
||||
_ = os.Setenv("GDK_BACKEND", "x11")
|
||||
// Set GDK_BACKEND=x11 if currently unset and XDG_SESSION_TYPE is unset, unspecified or x11 to prevent warnings
|
||||
if os.Getenv("GDK_BACKEND") == "" && (os.Getenv("XDG_SESSION_TYPE") == "" || os.Getenv("XDG_SESSION_TYPE") == "unspecified" || os.Getenv("XDG_SESSION_TYPE") == "x11") {
|
||||
_ = os.Setenv("GDK_BACKEND", "x11")
|
||||
}
|
||||
|
||||
result := &Frontend{
|
||||
frontendOptions: appoptions,
|
||||
|
Loading…
Reference in New Issue
Block a user