Skip to content

Commit

Permalink
Quietly begin wayland testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Nov 23, 2020
1 parent b66d550 commit c9aa6fd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 5 additions & 2 deletions internal/driver/glfw/driver.go
Expand Up @@ -15,8 +15,11 @@ import (

const mainGoroutineID = 1

var canvasMutex sync.RWMutex
var canvases = make(map[fyne.CanvasObject]fyne.Canvas)
var (
canvasMutex sync.RWMutex
canvases = make(map[fyne.CanvasObject]fyne.Canvas)
isWayland = false
)

// Declare conformity with Driver
var _ fyne.Driver = (*gLDriver)(nil)
Expand Down
7 changes: 7 additions & 0 deletions internal/driver/glfw/driver_wayland.go
@@ -0,0 +1,7 @@
// +build wayland

package glfw

func init() {
isWayland = true
}
10 changes: 8 additions & 2 deletions internal/driver/glfw/window.go
Expand Up @@ -160,6 +160,10 @@ func (w *window) screenSize(canvasSize fyne.Size) (int, int) {
}

func (w *window) RequestFocus() {
if isWayland {
return
}

w.runOnMainWhenCreated(w.viewport.Focus)
}

Expand Down Expand Up @@ -1185,8 +1189,10 @@ func (d *gLDriver) createWindow(title string, decorate bool) fyne.Window {

func (w *window) create() {
runOnMain(func() {
// make the window hidden, we will set it up and then show it later
glfw.WindowHint(glfw.Visible, 0)
if !isWayland {
// make the window hidden, we will set it up and then show it later
glfw.WindowHint(glfw.Visible, 0)
}
if w.decorate {
glfw.WindowHint(glfw.Decorated, 1)
} else {
Expand Down

0 comments on commit c9aa6fd

Please sign in to comment.