Address CodeRabbit review and fix CI on embedded-vnc

This commit is contained in:
Viktor Liu
2026-05-23 19:44:21 +02:00
parent 7cb6388349
commit fa57eedaf5
13 changed files with 108 additions and 67 deletions
+9 -3
View File
@@ -545,6 +545,9 @@ func (s *session) handleFBUpdateRequest() error {
// in sync with the active session (e.g. username changes after login on
// a virtual session).
func (s *session) SendDesktopName(name string) error {
if s.viewOnly {
name = ViewOnlyDesktopNamePrefix + name
}
s.encMu.RLock()
supported := s.clientSupportsDesktopName
s.encMu.RUnlock()
@@ -629,13 +632,13 @@ func (s *session) handlePointerEvent() error {
mask = (mask & 0x7f) | uint16(hi[0])<<7
}
if s.viewOnly {
return nil
}
s.pointerMu.Lock()
s.lastPointerX = x
s.lastPointerY = y
s.pointerMu.Unlock()
if s.viewOnly {
return nil
}
s.injector.InjectPointer(mask, x, y, s.serverW, s.serverH)
return nil
}
@@ -661,6 +664,9 @@ var stickyModifierKeysyms = [...]uint32{
// when the client disconnects mid-press. Mouse coordinates are reused
// from the last PointerEvent so we don't warp the cursor.
func (s *session) releaseStickyInput() {
if s.viewOnly {
return
}
for _, ks := range stickyModifierKeysyms {
s.injector.InjectKey(ks, false)
}