github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/fixes/zenity.go (about)

     1  //go:build linux
     2  // +build linux
     3  
     4  package fixes
     5  
     6  import (
     7  	"os"
     8  )
     9  
    10  func init() {
    11  	// Fix Zenity on Wayland when running in Flatpak
    12  	if os.Getenv("XDG_SESSION_TYPE") == "wayland" {
    13  		// Errors are ignored as there is no way to sanely handle errors and there would be no way to recover visually
    14  		_ = os.Setenv("GDK_BACKEND", "wayland")
    15  	}
    16  }