diff --git a/app/internal/wm/os_unix.go b/app/internal/wm/os_unix.go index c41dc9a5..7f92d026 100644 --- a/app/internal/wm/os_unix.go +++ b/app/internal/wm/os_unix.go @@ -7,9 +7,15 @@ package wm import ( "errors" + "unsafe" ) -type ViewEvent struct{} +type ViewEvent struct { + // Display is a pointer to the X11 Display created by XOpenDisplay. + Display unsafe.Pointer + // Window is the X11 window ID as returned by XCreateWindow. + Window uintptr +} func Main() { select {} diff --git a/app/internal/wm/os_x11.go b/app/internal/wm/os_x11.go index b5d0ebd7..f521d6ba 100644 --- a/app/internal/wm/os_x11.go +++ b/app/internal/wm/os_x11.go @@ -690,8 +690,10 @@ func newX11Window(gioWin Callbacks, opts *Options) error { go func() { w.w.SetDriver(w) + w.w.Event(ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)}) w.setStage(system.StageRunning) w.loop() + w.w.Event(ViewEvent{}) w.destroy() }() return nil