Revision 37c34d9d

b/vnc.c
1109 1109
        dcl->idle = 1;
1110 1110
    }
1111 1111

  
1112
    qemu_remove_mouse_mode_change_notifier(&vs->mouse_mode_notifier);
1112 1113
    vnc_remove_timer(vs->vd);
1113 1114
    if (vs->vd->lock_key_sync)
1114 1115
        qemu_remove_led_event_handler(vs->led);
......
1427 1428
{
1428 1429
}
1429 1430

  
1430
static void check_pointer_type_change(VncState *vs, int absolute)
1431
static void check_pointer_type_change(Notifier *notifier)
1431 1432
{
1433
    VncState *vs = container_of(notifier, VncState, mouse_mode_notifier);
1434
    int absolute = kbd_mouse_is_absolute();
1435

  
1432 1436
    if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE) && vs->absolute != absolute) {
1433 1437
        vnc_write_u8(vs, 0);
1434 1438
        vnc_write_u8(vs, 0);
......
1476 1480
        vs->last_x = x;
1477 1481
        vs->last_y = y;
1478 1482
    }
1479

  
1480
    check_pointer_type_change(vs, kbd_mouse_is_absolute());
1481 1483
}
1482 1484

  
1483 1485
static void reset_keys(VncState *vs)
......
1818 1820
            break;
1819 1821
        }
1820 1822
    }
1821

  
1822
    check_pointer_type_change(vs, kbd_mouse_is_absolute());
1823 1823
}
1824 1824

  
1825 1825
static void set_pixel_conversion(VncState *vs)
......
2436 2436
    if (vs->vd->lock_key_sync)
2437 2437
        vs->led = qemu_add_led_event_handler(kbd_leds, vs);
2438 2438

  
2439
    vs->mouse_mode_notifier.notify = check_pointer_type_change;
2440
    qemu_add_mouse_mode_change_notifier(&vs->mouse_mode_notifier);
2441

  
2439 2442
    vnc_init_timer(vd);
2440 2443

  
2441 2444
    /* vs might be free()ed here */
b/vnc.h
168 168
    Buffer zlib_tmp;
169 169
    z_stream zlib_stream[4];
170 170

  
171
    Notifier mouse_mode_notifier;
172

  
171 173
    QTAILQ_ENTRY(VncState) next;
172 174
};
173 175

  

Also available in: Unified diff