app/internal/window: x11 driver

This driver still lacks fling support and dp/sp configuration.

By default, linux builds will try to use the Wayland driver then
fallback to X11 if it fails. Drivers can be disabled by using either the
nowayland or nox11 build tags.

Signed-off-by: Denis Bernard <db047h@gmail.com>
This commit is contained in:
Denis Bernard
2019-10-27 13:48:42 +01:00
committed by Elias Naur
parent ec672ca06a
commit 547ff2e484
11 changed files with 670 additions and 19 deletions
+7 -8
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android
// +build linux,!android,!nowayland
package window
@@ -35,9 +35,9 @@ import (
//go:generate wayland-scanner client-header /usr/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wayland_xdg_decoration.h
//go:generate wayland-scanner private-code /usr/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android\\n\\n;" wayland_xdg_shell.c
//go:generate sed -i "1s;^;// +build linux,!android\\n\\n;" wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android\\n\\n;" wayland_text_input.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_xdg_shell.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_text_input.c
/*
#cgo LDFLAGS: -lwayland-client -lwayland-cursor
@@ -145,7 +145,6 @@ type wlOutput struct {
var connMu sync.Mutex
var conn *wlConn
var mainDone = make(chan struct{})
var (
winMap = make(map[interface{}]*window)
@@ -153,11 +152,11 @@ var (
outputConfig = make(map[*C.struct_wl_output]*wlOutput)
)
func Main() {
<-mainDone
func init() {
wlDriver = newWLWindow
}
func NewWindow(window Callbacks, opts *Options) error {
func newWLWindow(window Callbacks, opts *Options) error {
connMu.Lock()
defer connMu.Unlock()
if len(winMap) > 0 {