Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
7e5f81f2
Commit
7e5f81f2
authored
Sep 13, 2011
by
Joel Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into mobile
parents
b70ce077
832c7445
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
rfb.js
include/rfb.js
+33
-13
No files found.
include/rfb.js
View file @
7e5f81f2
...
@@ -20,7 +20,7 @@ var that = {}, // Public API methods
...
@@ -20,7 +20,7 @@ var that = {}, // Public API methods
init_vars
,
updateState
,
fail
,
handle_message
,
init_vars
,
updateState
,
fail
,
handle_message
,
init_msg
,
normal_msg
,
framebufferUpdate
,
print_stats
,
init_msg
,
normal_msg
,
framebufferUpdate
,
print_stats
,
pixelFormat
,
clientEncodings
,
fbUpdateRequest
,
pixelFormat
,
clientEncodings
,
fbUpdateRequest
,
fbUpdateRequests
,
keyEvent
,
pointerEvent
,
clientCutText
,
keyEvent
,
pointerEvent
,
clientCutText
,
extract_data_uri
,
scan_tight_imgQ
,
extract_data_uri
,
scan_tight_imgQ
,
...
@@ -531,10 +531,10 @@ function genDES(password, challenge) {
...
@@ -531,10 +531,10 @@ function genDES(password, challenge) {
function
flushClient
()
{
function
flushClient
()
{
if
(
mouse_arr
.
length
>
0
)
{
if
(
mouse_arr
.
length
>
0
)
{
//send(mouse_arr.concat(fbUpdateRequest
(1
)));
//send(mouse_arr.concat(fbUpdateRequest
s(
)));
ws
.
send
(
mouse_arr
);
ws
.
send
(
mouse_arr
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
ws
.
send
(
fbUpdateRequest
(
1
));
ws
.
send
(
fbUpdateRequest
s
(
));
},
50
);
},
50
);
mouse_arr
=
[];
mouse_arr
=
[];
...
@@ -552,7 +552,7 @@ checkEvents = function() {
...
@@ -552,7 +552,7 @@ checkEvents = function() {
now
=
new
Date
().
getTime
();
now
=
new
Date
().
getTime
();
if
(
now
>
last_req_time
+
conf
.
fbu_req_rate
)
{
if
(
now
>
last_req_time
+
conf
.
fbu_req_rate
)
{
last_req_time
=
now
;
last_req_time
=
now
;
ws
.
send
(
fbUpdateRequest
(
1
));
ws
.
send
(
fbUpdateRequest
s
(
));
}
}
}
}
}
}
...
@@ -562,7 +562,7 @@ checkEvents = function() {
...
@@ -562,7 +562,7 @@ checkEvents = function() {
keyPress
=
function
(
keysym
,
down
)
{
keyPress
=
function
(
keysym
,
down
)
{
var
arr
;
var
arr
;
arr
=
keyEvent
(
keysym
,
down
);
arr
=
keyEvent
(
keysym
,
down
);
arr
=
arr
.
concat
(
fbUpdateRequest
(
1
));
arr
=
arr
.
concat
(
fbUpdateRequest
s
(
));
ws
.
send
(
arr
);
ws
.
send
(
arr
);
};
};
...
@@ -792,7 +792,7 @@ init_msg = function() {
...
@@ -792,7 +792,7 @@ init_msg = function() {
response
=
pixelFormat
();
response
=
pixelFormat
();
response
=
response
.
concat
(
clientEncodings
());
response
=
response
.
concat
(
clientEncodings
());
response
=
response
.
concat
(
fbUpdateRequest
(
0
));
response
=
response
.
concat
(
fbUpdateRequest
s
(
));
timing
.
fbu_rt_start
=
(
new
Date
()).
getTime
();
timing
.
fbu_rt_start
=
(
new
Date
()).
getTime
();
ws
.
send
(
response
);
ws
.
send
(
response
);
...
@@ -1312,7 +1312,7 @@ encHandlers.DesktopSize = function set_desktopsize() {
...
@@ -1312,7 +1312,7 @@ encHandlers.DesktopSize = function set_desktopsize() {
display
.
viewportChange
(
0
,
0
,
fb_width
,
fb_height
);
display
.
viewportChange
(
0
,
0
,
fb_width
,
fb_height
);
timing
.
fbu_rt_start
=
(
new
Date
()).
getTime
();
timing
.
fbu_rt_start
=
(
new
Date
()).
getTime
();
// Send a new non-incremental request
// Send a new non-incremental request
ws
.
send
(
fbUpdateRequest
(
0
));
ws
.
send
(
fbUpdateRequest
s
(
));
FBU
.
bytes
=
0
;
FBU
.
bytes
=
0
;
FBU
.
rects
-=
1
;
FBU
.
rects
-=
1
;
...
@@ -1414,10 +1414,10 @@ clientEncodings = function() {
...
@@ -1414,10 +1414,10 @@ clientEncodings = function() {
fbUpdateRequest
=
function
(
incremental
,
x
,
y
,
xw
,
yw
)
{
fbUpdateRequest
=
function
(
incremental
,
x
,
y
,
xw
,
yw
)
{
//Util.Debug(">> fbUpdateRequest");
//Util.Debug(">> fbUpdateRequest");
if
(
!
x
)
{
x
=
0
;
}
if
(
typeof
(
x
)
!==
"undefined"
)
{
x
=
0
;
}
if
(
!
y
)
{
y
=
0
;
}
if
(
typeof
(
y
)
!==
"undefined"
)
{
y
=
0
;
}
if
(
!
xw
)
{
xw
=
fb_width
;
}
if
(
typeof
(
xw
)
!==
"undefined"
)
{
xw
=
fb_width
;
}
if
(
!
yw
)
{
yw
=
fb_height
;
}
if
(
typeof
(
yw
)
!==
"undefined"
)
{
yw
=
fb_height
;
}
var
arr
;
var
arr
;
arr
=
[
3
];
// msg-type
arr
=
[
3
];
// msg-type
arr
.
push8
(
incremental
);
arr
.
push8
(
incremental
);
...
@@ -1429,6 +1429,26 @@ fbUpdateRequest = function(incremental, x, y, xw, yw) {
...
@@ -1429,6 +1429,26 @@ fbUpdateRequest = function(incremental, x, y, xw, yw) {
return
arr
;
return
arr
;
};
};
// Based on clean/dirty areas, generate requests to send
fbUpdateRequests
=
function
()
{
var
cleanDirty
=
display
.
getCleanDirtyReset
(),
arr
=
[],
i
,
cb
,
db
;
cb
=
cleanDirty
.
cleanBox
;
if
(
cb
.
w
>
0
&&
cb
.
h
>
0
)
{
// Request incremental for clean box
arr
=
arr
.
concat
(
fbUpdateRequest
(
1
,
cb
.
x
,
cb
.
y
,
cb
.
w
,
cb
.
h
));
}
for
(
i
=
0
;
i
<
cleanDirty
.
dirtyBoxes
.
length
;
i
++
)
{
db
=
cleanDirty
.
dirtyBoxes
[
i
];
// Force all (non-incremental for dirty box
arr
=
arr
.
concat
(
fbUpdateRequest
(
0
,
db
.
x
,
db
.
y
,
db
.
w
,
db
.
h
));
}
return
arr
;
};
keyEvent
=
function
(
keysym
,
down
)
{
keyEvent
=
function
(
keysym
,
down
)
{
//Util.Debug(">> keyEvent, keysym: " + keysym + ", down: " + down);
//Util.Debug(">> keyEvent, keysym: " + keysym + ", down: " + down);
var
arr
;
var
arr
;
...
@@ -1513,7 +1533,7 @@ that.sendCtrlAltDel = function() {
...
@@ -1513,7 +1533,7 @@ that.sendCtrlAltDel = function() {
arr
=
arr
.
concat
(
keyEvent
(
0xFFFF
,
0
));
// Delete
arr
=
arr
.
concat
(
keyEvent
(
0xFFFF
,
0
));
// Delete
arr
=
arr
.
concat
(
keyEvent
(
0xFFE9
,
0
));
// Alt
arr
=
arr
.
concat
(
keyEvent
(
0xFFE9
,
0
));
// Alt
arr
=
arr
.
concat
(
keyEvent
(
0xFFE3
,
0
));
// Control
arr
=
arr
.
concat
(
keyEvent
(
0xFFE3
,
0
));
// Control
arr
=
arr
.
concat
(
fbUpdateRequest
(
1
));
arr
=
arr
.
concat
(
fbUpdateRequest
s
(
));
ws
.
send
(
arr
);
ws
.
send
(
arr
);
};
};
...
@@ -1530,7 +1550,7 @@ that.sendKey = function(code, down) {
...
@@ -1530,7 +1550,7 @@ that.sendKey = function(code, down) {
arr
=
arr
.
concat
(
keyEvent
(
code
,
1
));
arr
=
arr
.
concat
(
keyEvent
(
code
,
1
));
arr
=
arr
.
concat
(
keyEvent
(
code
,
0
));
arr
=
arr
.
concat
(
keyEvent
(
code
,
0
));
}
}
arr
=
arr
.
concat
(
fbUpdateRequest
(
1
));
arr
=
arr
.
concat
(
fbUpdateRequest
s
(
));
ws
.
send
(
arr
);
ws
.
send
(
arr
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment