Ticket #33: Fixed handling of cursor.

This commit is contained in:
James Muehlner 2013-08-26 23:15:20 -07:00
parent 775668ad37
commit 5516fc395b
2 changed files with 21 additions and 13 deletions

View File

@ -153,19 +153,21 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/* Do not handle clipboard and local cursor if read-only */
if (read_only == 0) {
/* Enable client-side cursor */
rfb_client->GotCursorShape = guac_vnc_cursor;
rfb_client->appData.useRemoteCursor = TRUE;
/* Clipboard */
rfb_client->GotXCutText = guac_vnc_cut_text;
}
/* Set remote cursor */
if(remote_cursor) {
rfb_client->appData.useRemoteCursor = TRUE;
rfb_client->appData.useRemoteCursor = FALSE;
guac_vnc_set_default_pointer(client);
}
else {
/* Enable client-side cursor */
rfb_client->appData.useRemoteCursor = TRUE;
rfb_client->GotCursorShape = guac_vnc_cursor;
}
}
/* Password */
rfb_client->GetPassword = guac_vnc_get_password;

View File

@ -41,20 +41,26 @@
#include <guacamole/socket.h>
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_vnc_default_pointer_width = 1;
const int guac_vnc_default_pointer_height = 1;
const int guac_vnc_default_pointer_width = 5;
const int guac_vnc_default_pointer_height = 5;
/* Format */
const cairo_format_t guac_vnc_default_pointer_format = CAIRO_FORMAT_ARGB32;
const int guac_vnc_default_pointer_stride = 44;
const int guac_vnc_default_pointer_stride = 20;
/* Embedded pointer graphic */
unsigned char guac_vnc_default_pointer[] = {
O
_,O,O,O,_,
O,X,X,X,O,
O,X,X,X,O,
O,X,X,X,O,
_,O,O,O,_
};
@ -77,7 +83,7 @@ void guac_vnc_set_default_pointer(guac_client* client) {
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 0, 0, cursor,
guac_protocol_send_cursor(socket, 2, 2, cursor,
0, 0,
guac_vnc_default_pointer_width,
guac_vnc_default_pointer_height);