mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-28 00:17:23 +02:00
cursor image as WS event.
This commit is contained in:
parent
9782b8391d
commit
589628f6ca
3 changed files with 24 additions and 8 deletions
|
@ -118,15 +118,14 @@ func (ws *WebSocketManagerCtx) Start() {
|
|||
if cursor != cur.Serial || cur.Serial == 0 {
|
||||
cursor = cur.Serial
|
||||
|
||||
// TODO: Refactor.
|
||||
uri, _ := utils.GetCursorImageURI(cur)
|
||||
ws.sessions.Broadcast(message.Message{
|
||||
Event: "cursor/image",
|
||||
Payload: struct{
|
||||
Xhot uint16
|
||||
Yhot uint16
|
||||
Uri string
|
||||
}{ cur.Xhot, cur.Yhot, uri },
|
||||
ws.sessions.Broadcast(message.CursorImage{
|
||||
Event: event.CURSOR_IMAGE,
|
||||
Uri: uri,
|
||||
Width: cur.Width,
|
||||
Height: cur.Height,
|
||||
X: cur.Xhot,
|
||||
Y: cur.Yhot,
|
||||
}, nil)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue