~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to vnc.c

Tags: upstream-0.9.0+20070816
ImportĀ upstreamĀ versionĀ 0.9.0+20070816

Show diffs side-by-side

added added

removed removed

Lines of Context:
852
852
                                       int x_position, int y_position,
853
853
                                       int w, int h)
854
854
{
 
855
    if (x_position > vs->ds->width)
 
856
        x_position = vs->ds->width;
 
857
    if (y_position > vs->ds->height)
 
858
        y_position = vs->ds->height;
 
859
    if (x_position + w >= vs->ds->width)
 
860
        w = vs->ds->width  - x_position;
 
861
    if (y_position + h >= vs->ds->height)
 
862
        h = vs->ds->height - y_position;
 
863
 
855
864
    int i;
856
865
    vs->need_update = 1;
857
866
    if (!incremental) {
1056
1065
static int protocol_client_init(VncState *vs, char *data, size_t len)
1057
1066
{
1058
1067
    char pad[3] = { 0, 0, 0 };
 
1068
    char buf[1024];
 
1069
    int size;
1059
1070
 
1060
1071
    vs->width = vs->ds->width;
1061
1072
    vs->height = vs->ds->height;
1100
1111
        
1101
1112
    vnc_write(vs, pad, 3);           /* padding */
1102
1113
 
1103
 
    vnc_write_u32(vs, 4);        
1104
 
    vnc_write(vs, "QEMU", 4);
 
1114
    if (qemu_name)
 
1115
        size = snprintf(buf, sizeof(buf), "QEMU (%s)", qemu_name);
 
1116
    else
 
1117
        size = snprintf(buf, sizeof(buf), "QEMU");
 
1118
 
 
1119
    vnc_write_u32(vs, size);
 
1120
    vnc_write(vs, buf, size);
1105
1121
    vnc_flush(vs);
1106
1122
 
1107
1123
    vnc_read_when(vs, protocol_client_msg, 1);