mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
cursor Image on connect.
This commit is contained in:
parent
589628f6ca
commit
a7d4511037
@ -20,6 +20,7 @@ type SystemInit struct {
|
|||||||
ScreenSize ScreenSize `json:"screen_size"`
|
ScreenSize ScreenSize `json:"screen_size"`
|
||||||
Members map[string]MemberData `json:"members"`
|
Members map[string]MemberData `json:"members"`
|
||||||
ImplicitHosting bool `json:"implicit_hosting"`
|
ImplicitHosting bool `json:"implicit_hosting"`
|
||||||
|
CursorImage *CursorImage `json:"cursor_image"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemAdmin struct {
|
type SystemAdmin struct {
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"demodesk/neko/internal/types"
|
"demodesk/neko/internal/types"
|
||||||
"demodesk/neko/internal/types/event"
|
"demodesk/neko/internal/types/event"
|
||||||
"demodesk/neko/internal/types/message"
|
"demodesk/neko/internal/types/message"
|
||||||
|
"demodesk/neko/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
||||||
@ -32,6 +33,20 @@ func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cursorImage *message.CursorImage
|
||||||
|
cur := h.desktop.GetCursorImage()
|
||||||
|
uri, err := utils.GetCursorImageURI(cur)
|
||||||
|
if err == nil {
|
||||||
|
cursorImage = &message.CursorImage{
|
||||||
|
Event: event.CURSOR_IMAGE,
|
||||||
|
Uri: uri,
|
||||||
|
Width: cur.Width,
|
||||||
|
Height: cur.Height,
|
||||||
|
X: cur.Xhot,
|
||||||
|
Y: cur.Yhot,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return session.Send(
|
return session.Send(
|
||||||
message.SystemInit{
|
message.SystemInit{
|
||||||
Event: event.SYSTEM_INIT,
|
Event: event.SYSTEM_INIT,
|
||||||
@ -44,6 +59,7 @@ func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
|||||||
},
|
},
|
||||||
Members: members,
|
Members: members,
|
||||||
ImplicitHosting: h.sessions.ImplicitHosting(),
|
ImplicitHosting: h.sessions.ImplicitHosting(),
|
||||||
|
CursorImage: cursorImage,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user