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:
Akihiko Odaki
2024-07-15 14:25:43 +09:00
committed by Philippe Mathieu-Daudé
parent 3f5ef05fe0
commit a418e7aeea
10 changed files with 19 additions and 18 deletions
+3 -2
View File
@@ -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;
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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);
+6 -5
View File
@@ -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);
}
+1 -1
View File
@@ -981,7 +981,7 @@ int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
}
static void vnc_mouse_set(DisplayChangeListener *dcl,
int x, int y, int visible)
int x, int y, bool visible)
{
/* can we ask the client(s) to move the pointer ??? */
}