mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
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:
committed by
Elias Naur
parent
ec672ca06a
commit
547ff2e484
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user