mirror of https://github.com/jetkvm/kvm.git
Compare commits
9 Commits
a916a1629f
...
cbc3f2016f
Author | SHA1 | Date |
---|---|---|
|
cbc3f2016f | |
|
580b3397bf | |
|
ce95be8af9 | |
|
c28f3b4cd0 | |
|
ad59ecea09 | |
|
681b9c0b6e | |
|
efb7539537 | |
|
f26862d2e3 | |
|
23e74bfff8 |
|
@ -284,6 +284,10 @@ function KeyboardWrapper() {
|
|||
preventMouseUpDefault={true}
|
||||
stopMouseDownPropagation={true}
|
||||
stopMouseUpPropagation={true}
|
||||
physicalKeyboardHighlight={true}
|
||||
physicalKeyboardHighlightPreventDefault={true}
|
||||
physicalKeyboardHighlightTextColor="black"
|
||||
physicalKeyboardHighlightBgColor="lightblue"
|
||||
/>
|
||||
|
||||
<div className="controlArrows">
|
||||
|
@ -301,6 +305,10 @@ function KeyboardWrapper() {
|
|||
preventMouseUpDefault={true}
|
||||
stopMouseDownPropagation={true}
|
||||
stopMouseUpPropagation={true}
|
||||
physicalKeyboardHighlight={true}
|
||||
physicalKeyboardHighlightPreventDefault={true}
|
||||
physicalKeyboardHighlightTextColor="black"
|
||||
physicalKeyboardHighlightBgColor="lightblue"
|
||||
/>
|
||||
<Keyboard
|
||||
baseClass="simple-keyboard-arrows"
|
||||
|
@ -315,6 +323,10 @@ function KeyboardWrapper() {
|
|||
preventMouseUpDefault={true}
|
||||
stopMouseDownPropagation={true}
|
||||
stopMouseUpPropagation={true}
|
||||
physicalKeyboardHighlight={true}
|
||||
physicalKeyboardHighlightPreventDefault={true}
|
||||
physicalKeyboardHighlightTextColor="black"
|
||||
physicalKeyboardHighlightBgColor="lightblue"
|
||||
/>
|
||||
</div>
|
||||
{ /* TODO add optional number pad */ }
|
||||
|
|
15
webrtc.go
15
webrtc.go
|
@ -23,7 +23,6 @@ type Session struct {
|
|||
HidChannel *webrtc.DataChannel
|
||||
DiskChannel *webrtc.DataChannel
|
||||
shouldUmountVirtualMedia bool
|
||||
rpcQueue chan webrtc.DataChannelMessage
|
||||
}
|
||||
|
||||
type SessionConfig struct {
|
||||
|
@ -107,12 +106,6 @@ func newSession(config SessionConfig) (*Session, error) {
|
|||
return nil, err
|
||||
}
|
||||
session := &Session{peerConnection: peerConnection}
|
||||
session.rpcQueue = make(chan webrtc.DataChannelMessage, 256)
|
||||
go func() {
|
||||
for msg := range session.rpcQueue {
|
||||
onRPCMessage(msg, session)
|
||||
}
|
||||
}()
|
||||
|
||||
peerConnection.OnDataChannel(func(d *webrtc.DataChannel) {
|
||||
scopedLogger.Info().Str("label", d.Label()).Uint16("id", *d.ID()).Msg("New DataChannel")
|
||||
|
@ -120,8 +113,7 @@ func newSession(config SessionConfig) (*Session, error) {
|
|||
case "rpc":
|
||||
session.RPCChannel = d
|
||||
d.OnMessage(func(msg webrtc.DataChannelMessage) {
|
||||
// Enqueue to ensure ordered processing
|
||||
session.rpcQueue <- msg
|
||||
go onRPCMessage(msg, session)
|
||||
})
|
||||
triggerOTAStateUpdate()
|
||||
triggerVideoStateUpdate()
|
||||
|
@ -197,11 +189,6 @@ func newSession(config SessionConfig) (*Session, error) {
|
|||
if session == currentSession {
|
||||
currentSession = nil
|
||||
}
|
||||
// Stop RPC processor
|
||||
if session.rpcQueue != nil {
|
||||
close(session.rpcQueue)
|
||||
session.rpcQueue = nil
|
||||
}
|
||||
if session.shouldUmountVirtualMedia {
|
||||
if err := rpcUnmountImage(); err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("unmount image failed on connection close")
|
||||
|
|
Loading…
Reference in New Issue