Skip to content

Commit

Permalink
add WaylandWindowContext
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed May 31, 2024
1 parent e25be3e commit 944722a
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions driver/native.go
Original file line number Diff line number Diff line change
@@ -50,3 +50,15 @@ type X11WindowContext struct {
// WindowHandle is the window handle for the native X11 window.
WindowHandle string
}

// WaylandWindowContext is passed to the NativeWindow.RunNative callback
// when it is executed on a device with the Wayland windowing system.
//
// Since: 2.5
type WaylandWindowContext struct {
// WaylandSurface is the handle to the native Wayland surface.
WaylandSurface uintptr

// EGLSurface is the handle to the native EGL surface.
EGLSurface uintptr
}
6 changes: 4 additions & 2 deletions internal/driver/glfw/window_wayland.go
Original file line number Diff line number Diff line change
@@ -18,8 +18,10 @@ func (w *window) RunNative(f func(any) error) error {
var err error
done := make(chan struct{})
runOnMain(func() {
// TODO: define driver.WaylandWindowContext and pass window handle
err = f(driver.UnknownContext{})
err = f(driver.WaylandWindowContext{
WaylandSurface: uintptr(w.view().GetWaylandWindow()),

Check failure on line 22 in internal/driver/glfw/window_wayland.go

GitHub Actions / platform_tests (1.19.x, ubuntu-latest)

cannot convert w.view().GetWaylandWindow() (value of type *"github.com/go-gl/glfw/v3.3/glfw"._Ctype_struct_wl_surface) to type uintptr

Check failure on line 22 in internal/driver/glfw/window_wayland.go

GitHub Actions / platform_tests (1.21.x, ubuntu-latest)

cannot convert w.view().GetWaylandWindow() (value of type *"github.com/go-gl/glfw/v3.3/glfw"._Ctype_struct_wl_surface) to type uintptr
EGLSurface: uintptr(w.view().GetEGLSurface()),
})
close(done)
})
<-done

0 comments on commit 944722a

Please sign in to comment.