ui/console: Convert mouse visibility parameter into bool
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Phil Dennis-Jordan <phil@philjordan.eu> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240715-cursor-v3-2-afa5b9492dbf@daynix.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
3f5ef05fe0
commit
a418e7aeea
@ -742,7 +742,7 @@ static void ati_mm_write(void *opaque, hwaddr addr,
|
||||
if (!s->cursor_guest_mode &&
|
||||
(s->regs.crtc_gen_cntl & CRTC2_CUR_EN) && !(t & BIT(31))) {
|
||||
dpy_mouse_set(s->vga.con, s->regs.cur_hv_pos >> 16,
|
||||
s->regs.cur_hv_pos & 0xffff, 1);
|
||||
s->regs.cur_hv_pos & 0xffff, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -109,8 +109,7 @@ static void update_cursor(VirtIOGPU *g, struct virtio_gpu_update_cursor *cursor)
|
||||
s->cursor.pos.x = cursor->pos.x;
|
||||
s->cursor.pos.y = cursor->pos.y;
|
||||
}
|
||||
dpy_mouse_set(s->con, cursor->pos.x, cursor->pos.y,
|
||||
cursor->resource_id ? 1 : 0);
|
||||
dpy_mouse_set(s->con, cursor->pos.x, cursor->pos.y, cursor->resource_id);
|
||||
}
|
||||
|
||||
struct virtio_gpu_simple_resource *
|
||||
|
@ -1167,7 +1167,7 @@ static void vmsvga_reset(DeviceState *dev)
|
||||
s->enable = 0;
|
||||
s->config = 0;
|
||||
s->svgaid = SVGA_ID;
|
||||
s->cursor.on = 0;
|
||||
s->cursor.on = false;
|
||||
s->redraw_fifo_last = 0;
|
||||
s->syncing = 0;
|
||||
|
||||
|
@ -233,7 +233,7 @@ typedef struct DisplayChangeListenerOps {
|
||||
|
||||
/* optional */
|
||||
void (*dpy_mouse_set)(DisplayChangeListener *dcl,
|
||||
int x, int y, int on);
|
||||
int x, int y, bool on);
|
||||
/* optional */
|
||||
void (*dpy_cursor_define)(DisplayChangeListener *dcl,
|
||||
QEMUCursor *cursor);
|
||||
@ -322,7 +322,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
|
||||
void dpy_text_cursor(QemuConsole *con, int x, int y);
|
||||
void dpy_text_update(QemuConsole *con, int x, int y, int w, int h);
|
||||
void dpy_text_resize(QemuConsole *con, int w, int h);
|
||||
void dpy_mouse_set(QemuConsole *con, int x, int y, int on);
|
||||
void dpy_mouse_set(QemuConsole *con, int x, int y, bool on);
|
||||
void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor);
|
||||
bool dpy_cursor_define_supported(QemuConsole *con);
|
||||
bool dpy_gfx_check_format(QemuConsole *con,
|
||||
|
@ -49,7 +49,8 @@ typedef struct QemuGraphicConsole {
|
||||
uint32_t head;
|
||||
|
||||
QEMUCursor *cursor;
|
||||
int cursor_x, cursor_y, cursor_on;
|
||||
int cursor_x, cursor_y;
|
||||
bool cursor_on;
|
||||
} QemuGraphicConsole;
|
||||
|
||||
typedef QemuConsoleClass QemuGraphicConsoleClass;
|
||||
@ -957,7 +958,7 @@ void dpy_text_resize(QemuConsole *con, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
void dpy_mouse_set(QemuConsole *c, int x, int y, int on)
|
||||
void dpy_mouse_set(QemuConsole *c, int x, int y, bool on)
|
||||
{
|
||||
QemuGraphicConsole *con = QEMU_GRAPHIC_CONSOLE(c);
|
||||
DisplayState *s = c->ds;
|
||||
|
@ -726,7 +726,7 @@ static void dbus_gfx_switch(DisplayChangeListener *dcl,
|
||||
}
|
||||
|
||||
static void dbus_mouse_set(DisplayChangeListener *dcl,
|
||||
int x, int y, int on)
|
||||
int x, int y, bool on)
|
||||
{
|
||||
DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl);
|
||||
|
||||
|
2
ui/gtk.c
2
ui/gtk.c
@ -446,7 +446,7 @@ static GdkDevice *gd_get_pointer(GdkDisplay *dpy)
|
||||
}
|
||||
|
||||
static void gd_mouse_set(DisplayChangeListener *dcl,
|
||||
int x, int y, int visible)
|
||||
int x, int y, bool visible)
|
||||
{
|
||||
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
|
||||
GdkDisplay *dpy;
|
||||
|
@ -49,7 +49,7 @@ static int gui_grab_code = KMOD_LALT | KMOD_LCTRL;
|
||||
static SDL_Cursor *sdl_cursor_normal;
|
||||
static SDL_Cursor *sdl_cursor_hidden;
|
||||
static int absolute_enabled;
|
||||
static int guest_cursor;
|
||||
static bool guest_cursor;
|
||||
static int guest_x, guest_y;
|
||||
static SDL_Cursor *guest_sprite;
|
||||
static Notifier mouse_mode_notifier;
|
||||
@ -729,7 +729,7 @@ void sdl2_poll_events(struct sdl2_console *scon)
|
||||
}
|
||||
|
||||
static void sdl_mouse_warp(DisplayChangeListener *dcl,
|
||||
int x, int y, int on)
|
||||
int x, int y, bool on)
|
||||
{
|
||||
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
|
||||
|
||||
|
@ -254,7 +254,7 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
|
||||
static SimpleSpiceCursor*
|
||||
qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd,
|
||||
QEMUCursor *c,
|
||||
int on)
|
||||
bool on)
|
||||
{
|
||||
size_t size = c ? c->width * c->height * 4 : 0;
|
||||
SimpleSpiceCursor *update;
|
||||
@ -448,7 +448,8 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
|
||||
qemu_mutex_lock(&ssd->lock);
|
||||
if (ssd->cursor) {
|
||||
g_free(ssd->ptr_define);
|
||||
ssd->ptr_define = qemu_spice_create_cursor_update(ssd, ssd->cursor, 0);
|
||||
ssd->ptr_define =
|
||||
qemu_spice_create_cursor_update(ssd, ssd->cursor, false);
|
||||
}
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
}
|
||||
@ -476,7 +477,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque)
|
||||
ssd->mouse_x = -1;
|
||||
ssd->mouse_y = -1;
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
dpy_mouse_set(ssd->dcl.con, x, y, 1);
|
||||
dpy_mouse_set(ssd->dcl.con, x, y, true);
|
||||
} else {
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
}
|
||||
@ -747,7 +748,7 @@ static void display_refresh(DisplayChangeListener *dcl)
|
||||
}
|
||||
|
||||
static void display_mouse_set(DisplayChangeListener *dcl,
|
||||
int x, int y, int on)
|
||||
int x, int y, bool on)
|
||||
{
|
||||
SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
|
||||
|
||||
@ -774,7 +775,7 @@ static void display_mouse_define(DisplayChangeListener *dcl,
|
||||
g_free(ssd->ptr_move);
|
||||
ssd->ptr_move = NULL;
|
||||
g_free(ssd->ptr_define);
|
||||
ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, 0);
|
||||
ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, false);
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
qemu_spice_wakeup(ssd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user