console: move set_mouse + cursor_define callbacks

When adding DisplayChangeListeners the set_mouse and cursor_define
callbacks have been left in DisplayState for some reason.  Fix it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2012-09-12 07:56:45 +02:00
parent 35c9e0a5c2
commit bf2fde70fe
9 changed files with 59 additions and 27 deletions

View file

@ -478,8 +478,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
qc = cursor_builtin_left_ptr();
}
if (s->vga.ds->cursor_define)
s->vga.ds->cursor_define(qc);
dpy_cursor_define(s->vga.ds, qc);
cursor_put(qc);
}
#endif
@ -754,9 +753,10 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
caps |= SVGA_CAP_RECT_FILL;
#endif
#ifdef HW_MOUSE_ACCEL
if (s->vga.ds->mouse_set)
if (dpy_cursor_define_supported(s->vga.ds)) {
caps |= SVGA_CAP_CURSOR | SVGA_CAP_CURSOR_BYPASS_2 |
SVGA_CAP_CURSOR_BYPASS;
}
#endif
return caps;
@ -903,8 +903,9 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
s->cursor.on |= (value == SVGA_CURSOR_ON_SHOW);
s->cursor.on &= (value != SVGA_CURSOR_ON_HIDE);
#ifdef HW_MOUSE_ACCEL
if (s->vga.ds->mouse_set && value <= SVGA_CURSOR_ON_SHOW)
s->vga.ds->mouse_set(s->cursor.x, s->cursor.y, s->cursor.on);
if (value <= SVGA_CURSOR_ON_SHOW) {
dpy_mouse_set(s->vga.ds, s->cursor.x, s->cursor.y, s->cursor.on);
}
#endif
break;