mirror of
https://github.com/qemu/qemu.git
synced 2025-08-17 16:03:30 +00:00
ui: make gl_block use a counter
Track multiple callers blocking requests. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
ac32b2fff1
commit
a4ddc31417
17
ui/console.c
17
ui/console.c
@ -79,7 +79,7 @@ struct QemuConsole {
|
|||||||
DisplaySurface *surface;
|
DisplaySurface *surface;
|
||||||
int dcls;
|
int dcls;
|
||||||
DisplayChangeListener *gl;
|
DisplayChangeListener *gl;
|
||||||
bool gl_block;
|
int gl_block;
|
||||||
int window_id;
|
int window_id;
|
||||||
|
|
||||||
/* Graphic console state. */
|
/* Graphic console state. */
|
||||||
@ -237,10 +237,19 @@ void graphic_hw_gl_block(QemuConsole *con, bool block)
|
|||||||
{
|
{
|
||||||
assert(con != NULL);
|
assert(con != NULL);
|
||||||
|
|
||||||
con->gl_block = block;
|
if (block) {
|
||||||
if (con->hw_ops->gl_block) {
|
con->gl_block++;
|
||||||
con->hw_ops->gl_block(con->hw, block);
|
} else {
|
||||||
|
con->gl_block--;
|
||||||
}
|
}
|
||||||
|
assert(con->gl_block >= 0);
|
||||||
|
if (!con->hw_ops->gl_block) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((block && con->gl_block != 1) || (!block && con->gl_block != 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
con->hw_ops->gl_block(con->hw, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
void graphic_hw_gl_flushed(QemuConsole *con)
|
void graphic_hw_gl_flushed(QemuConsole *con)
|
||||||
|
Loading…
Reference in New Issue
Block a user