Skip to content

Commit 6d77edb

Browse files
committed
Merge pull request #23 from fcwu/revert-22-scale-and-quality
Revert "Toolbar with scale and quality."
2 parents 5206056 + c8c64cc commit 6d77edb

File tree

10 files changed

+38
-454
lines changed

10 files changed

+38
-454
lines changed

noVNC/custom.css

Lines changed: 0 additions & 116 deletions
This file was deleted.

noVNC/images/not_scale.png

-401 Bytes
Binary file not shown.

noVNC/images/pause.png

-2.76 KB
Binary file not shown.

noVNC/images/pop_less.png

-1.11 KB
Loading

noVNC/images/pop_more.png

-1.1 KB
Loading

noVNC/images/resume.png

-2.89 KB
Binary file not shown.

noVNC/images/scale.png

-1.22 KB
Binary file not shown.

noVNC/include/rfb.js

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ var RFB;
3535
this._rfb_tightvnc = false;
3636
this._rfb_xvp_ver = 0;
3737

38+
// In preference order
39+
this._encodings = [
40+
['COPYRECT', 0x01 ],
41+
['TIGHT', 0x07 ],
42+
['TIGHT_PNG', -260 ],
43+
['HEXTILE', 0x05 ],
44+
['RRE', 0x02 ],
45+
['RAW', 0x00 ],
46+
['DesktopSize', -223 ],
47+
['Cursor', -239 ],
48+
49+
// Psuedo-encoding settings
50+
//['JPEG_quality_lo', -32 ],
51+
['JPEG_quality_med', -26 ],
52+
//['JPEG_quality_hi', -23 ],
53+
//['compress_lo', -255 ],
54+
['compress_hi', -247 ],
55+
['last_rect', -224 ],
56+
['xvp', -309 ],
57+
['ExtendedDesktopSize', -308 ]
58+
];
59+
3860
this._encHandlers = {};
3961
this._encNames = {};
4062
this._encStats = {};
@@ -109,6 +131,7 @@ var RFB;
109131
'wsProtocols': ['binary', 'base64'], // Protocols to use in the WebSocket connection
110132
'repeaterID': '', // [UltraVNC] RepeaterID to connect to
111133
'viewportDrag': false, // Move the viewport on mouse drags
134+
112135
// Callback functions
113136
'onUpdateState': function () { }, // onUpdateState(rfb, state, oldstate, statusMsg): state update/change
114137
'onPasswordRequired': function () { }, // onPasswordRequired(rfb): VNC password is required
@@ -121,53 +144,6 @@ var RFB;
121144
'onXvpInit': function () { }, // onXvpInit(version): XVP extensions active for this connection
122145
});
123146

124-
try{
125-
// Use my custom 'jpeg_quality'.
126-
this._encodings = [
127-
// ['COPYRECT', 0x01 ],
128-
['TIGHT', 0x07 ],
129-
['TIGHT_PNG', -260 ],
130-
['HEXTILE', 0x05 ],
131-
['RRE', 0x02 ],
132-
['RAW', 0x00 ],
133-
['DesktopSize', -223 ],
134-
['Cursor', -239 ],
135-
136-
// Psuedo-encoding settings
137-
['JPEG_quality_lo', -32 + jpeg_quality ],
138-
// ['JPEG_quality_med', -28 ],
139-
// ['JPEG_quality_hi', -23 ],
140-
// ['compress_lo', -255 ],
141-
['compress_hi', -247 ],
142-
['last_rect', -224 ],
143-
['xvp', -309 ],
144-
['ExtendedDesktopSize', -308 ]
145-
];
146-
}
147-
catch(e){
148-
// If my custom 'jpeg_quality' is not defined, just use default setting.
149-
this._encodings = [
150-
['COPYRECT', 0x01 ],
151-
['TIGHT', 0x07 ],
152-
['TIGHT_PNG', -260 ],
153-
['HEXTILE', 0x05 ],
154-
['RRE', 0x02 ],
155-
['RAW', 0x00 ],
156-
['DesktopSize', -223 ],
157-
['Cursor', -239 ],
158-
159-
// Psuedo-encoding settings
160-
//['JPEG_quality_lo', -32 ],
161-
['JPEG_quality_med', -26 ],
162-
//['JPEG_quality_hi', -23 ],
163-
//['compress_lo', -255 ],
164-
['compress_hi', -247 ],
165-
['last_rect', -224 ],
166-
['xvp', -309 ],
167-
['ExtendedDesktopSize', -308 ]
168-
];
169-
}
170-
171147
// main setup
172148
Util.Debug(">> RFB.constructor");
173149

noVNC/include/util.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,7 @@ Util.getEventPosition = function (e, obj, scale) {
468468
var realy = docY - pos.y;
469469
var x = Math.max(Math.min(realx, pos.width - 1), 0);
470470
var y = Math.max(Math.min(realy, pos.height - 1), 0);
471-
472-
try{
473-
// Use my custom 'Scale' rate.
474-
return {'x': x / Scale.x, 'y': y / Scale.y, 'realx': realx / Scale.x, 'realy': realy / Scale.y};
475-
}
476-
catch(e){
477-
// If my custom 'Scale' is not defined, just use default 'scale'.
478-
return {'x': x / scale, 'y': y / scale, 'realx': realx / scale, 'realy': realy / scale};
479-
}
480-
471+
return {'x': x / scale, 'y': y / scale, 'realx': realx / scale, 'realy': realy / scale};
481472
};
482473

483474

0 commit comments

Comments
 (0)