To avoid confusion use the more generic "display" instead of "primary". "primary" is used in the code widely to mean the primary surface. In the past (before 3D support) having a primary surface mean both the availability of something to render (that is the device was enabled and ready) and the presence of a canvas to draw on. As RedQxl is just interested in the state and size of the display use "display" as terminology. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/red-qxl.c | 12 ++++++------ server/red-qxl.h | 2 +- server/reds.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/red-qxl.c b/server/red-qxl.c index a003052ca..1c3714565 100644 --- a/server/red-qxl.c +++ b/server/red-qxl.c @@ -51,7 +51,7 @@ struct QXLState { QXLInstance *qxl; Dispatcher *dispatcher; uint32_t pending; - int primary_active; + bool display_active; int x_res; int y_res; int use_hardware_cursor; @@ -320,7 +320,7 @@ static void red_qxl_destroy_primary_surface_complete(QXLState *qxl_state) qxl_state->x_res = 0; qxl_state->y_res = 0; qxl_state->use_hardware_cursor = FALSE; - qxl_state->primary_active = FALSE; + qxl_state->display_active = false; reds_update_client_mouse_allowed(qxl_state->reds); } @@ -373,7 +373,7 @@ static void red_qxl_create_primary_surface_complete(QXLState *qxl_state) qxl_state->x_res = surface->width; qxl_state->y_res = surface->height; qxl_state->use_hardware_cursor = surface->mouse_mode; - qxl_state->primary_active = TRUE; + qxl_state->display_active = true; reds_update_client_mouse_allowed(qxl_state->reds); memset(&qxl_state->surface_create, 0, sizeof(QXLDevSurfaceCreate)); @@ -877,7 +877,7 @@ void spice_qxl_gl_scanout(QXLInstance *qxl, qxl_state->x_res = width; qxl_state->y_res = height; qxl_state->use_hardware_cursor = TRUE; - qxl_state->primary_active = TRUE; + qxl_state->display_active = true; reds_update_client_mouse_allowed(qxl_state->reds); } @@ -1029,9 +1029,9 @@ void red_qxl_clear_pending(QXLState *qxl_state, int pending) clear_bit(pending, &qxl_state->pending); } -gboolean red_qxl_get_primary_active(QXLInstance *qxl) +bool red_qxl_is_display_active(QXLInstance *qxl) { - return qxl->st->primary_active; + return qxl->st->display_active; } gboolean red_qxl_get_allow_client_mouse(QXLInstance *qxl, gint *x_res, gint *y_res) diff --git a/server/red-qxl.h b/server/red-qxl.h index f925f065b..4a0bab83b 100644 --- a/server/red-qxl.h +++ b/server/red-qxl.h @@ -39,7 +39,7 @@ void red_qxl_async_complete(QXLInstance *qxl, AsyncCommand *async_command); struct Dispatcher *red_qxl_get_dispatcher(QXLInstance *qxl); gboolean red_qxl_use_client_monitors_config(QXLInstance *qxl); gboolean red_qxl_client_monitors_config(QXLInstance *qxl, VDAgentMonitorsConfig *monitors_config); -gboolean red_qxl_get_primary_active(QXLInstance *qxl); +bool red_qxl_is_display_active(QXLInstance *qxl); gboolean red_qxl_get_allow_client_mouse(QXLInstance *qxl, gint *x_res, gint *y_res); SpiceMsgDisplayGlScanoutUnix *red_qxl_get_gl_scanout(QXLInstance *qxl); void red_qxl_put_gl_scanout(QXLInstance *qxl, SpiceMsgDisplayGlScanoutUnix *scanout); diff --git a/server/reds.c b/server/reds.c index b6ecc6c69..aff70768e 100644 --- a/server/reds.c +++ b/server/reds.c @@ -4374,7 +4374,7 @@ void reds_update_client_mouse_allowed(RedsState *reds) allow_now = TRUE; FOREACH_QXL_INSTANCE(reds, qxl) { - if (red_qxl_get_primary_active(qxl)) { + if (red_qxl_is_display_active(qxl)) { allow_now = red_qxl_get_allow_client_mouse(qxl, &x_res, &y_res); break; } -- 2.13.5 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel