1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

wlcontext: use poll with wake pipe instead of read deadlines

This commit is contained in:
bbedward
2025-12-13 00:46:30 -05:00
parent ce4aca9a72
commit 830a715b6d
4 changed files with 94 additions and 36 deletions

View File

@@ -58,6 +58,18 @@ func (ctx *Context) SetReadDeadline(t time.Time) error {
return ctx.conn.SetReadDeadline(t)
}
func (ctx *Context) Fd() int {
rawConn, err := ctx.conn.SyscallConn()
if err != nil {
return -1
}
var fd int
rawConn.Control(func(f uintptr) {
fd = int(f)
})
return fd
}
// Dispatch reads and processes incoming messages and calls [client.Dispatcher.Dispatch] on the
// respective wayland protocol.
// Dispatch must be called on the same goroutine as other interactions with the Context.