forked from joejulian/gio
app/internal/wm: implement ViewEvent for X11
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -7,9 +7,15 @@ package wm
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"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() {
|
func Main() {
|
||||||
select {}
|
select {}
|
||||||
|
|||||||
@@ -690,8 +690,10 @@ func newX11Window(gioWin Callbacks, opts *Options) error {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
w.w.SetDriver(w)
|
w.w.SetDriver(w)
|
||||||
|
w.w.Event(ViewEvent{Display: unsafe.Pointer(dpy), Window: uintptr(win)})
|
||||||
w.setStage(system.StageRunning)
|
w.setStage(system.StageRunning)
|
||||||
w.loop()
|
w.loop()
|
||||||
|
w.w.Event(ViewEvent{})
|
||||||
w.destroy()
|
w.destroy()
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user