mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
use types.Cursor.
This commit is contained in:
@ -201,16 +201,11 @@ func (manager *SessionManagerCtx) ClearHost() {
|
||||
// cursors
|
||||
// ---
|
||||
|
||||
func (manager *SessionManagerCtx) SetCursor(x, y int, session types.Session) {
|
||||
func (manager *SessionManagerCtx) SetCursor(cursor types.Cursor, session types.Session) {
|
||||
manager.cursorsMu.Lock()
|
||||
defer manager.cursorsMu.Unlock()
|
||||
|
||||
pos, ok := manager.cursors[session]
|
||||
if ok {
|
||||
pos.X, pos.Y = x, y
|
||||
} else {
|
||||
manager.cursors[session] = types.Cursor{X: x, Y: y}
|
||||
}
|
||||
manager.cursors[session] = cursor
|
||||
}
|
||||
|
||||
func (manager *SessionManagerCtx) PopCursors() map[types.Session]types.Cursor {
|
||||
|
@ -53,8 +53,8 @@ func (session *SessionCtx) IsHost() bool {
|
||||
return session.manager.GetHost() == session
|
||||
}
|
||||
|
||||
func (session *SessionCtx) SetCursor(x, y int) {
|
||||
session.manager.SetCursor(x, y, session)
|
||||
func (session *SessionCtx) SetCursor(cursor types.Cursor) {
|
||||
session.manager.SetCursor(cursor, session)
|
||||
}
|
||||
|
||||
// ---
|
||||
|
Reference in New Issue
Block a user