app/internal/window: default to X11 on unix systems

Wayland doesn't guarantee the presence of server-side window decorations
(border, close/maximize/minimize buttons), and Gio doesn't have client-side
decorations either (issue #29). The issue is more than a year old, so it's time
to default to X11 to have a good out-of-the-box experience on unix systems.

Updates gio#29

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-09-27 14:29:31 +02:00
parent ef7b3e75f4
commit 679a34b116
+10 -10
View File
@@ -12,20 +12,20 @@ func Main() {
select {}
}
// instead of creating files with build tags for each combination of wayland +/- x11
type windowDriver func(Callbacks, *Options) error
// Instead of creating files with build tags for each combination of wayland +/- x11
// let each driver initialize these variables with their own version of createWindow.
var wlDriver, x11Driver func(Callbacks, *Options) error
var wlDriver, x11Driver windowDriver
func NewWindow(window Callbacks, opts *Options) error {
var errFirst, err error
if wlDriver != nil {
if err = wlDriver(window, opts); err == nil {
return nil
var errFirst error
for _, d := range []windowDriver{x11Driver, wlDriver} {
if d == nil {
continue
}
errFirst = err
}
if x11Driver != nil {
if err = x11Driver(window, opts); err == nil {
err := d(window, opts)
if err == nil {
return nil
}
if errFirst == nil {