aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ui/console.h1
-rw-r--r--ui/console.c15
2 files changed, 12 insertions, 4 deletions
diff --git a/include/ui/console.h b/include/ui/console.h
index d9c13d20b1..e2589e2134 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -387,6 +387,7 @@ QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
bool qemu_console_is_visible(QemuConsole *con);
bool qemu_console_is_graphic(QemuConsole *con);
bool qemu_console_is_fixedsize(QemuConsole *con);
+bool qemu_console_is_gl_blocked(QemuConsole *con);
char *qemu_console_get_label(QemuConsole *con);
int qemu_console_get_index(QemuConsole *con);
uint32_t qemu_console_get_head(QemuConsole *con);
diff --git a/ui/console.c b/ui/console.c
index 394786b3c7..fa3e658edd 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -123,6 +123,7 @@ struct QemuConsole {
DisplaySurface *surface;
int dcls;
DisplayChangeListener *gl;
+ bool gl_block;
/* Graphic console state. */
Object *device;
@@ -264,10 +265,10 @@ void graphic_hw_update(QemuConsole *con)
void graphic_hw_gl_block(QemuConsole *con, bool block)
{
- if (!con) {
- con = active_console;
- }
- if (con && con->hw_ops->gl_block) {
+ assert(con != NULL);
+
+ con->gl_block = block;
+ if (con->hw_ops->gl_block) {
con->hw_ops->gl_block(con->hw, block);
}
}
@@ -1879,6 +1880,12 @@ bool qemu_console_is_fixedsize(QemuConsole *con)
return con && (con->console_type != TEXT_CONSOLE);
}
+bool qemu_console_is_gl_blocked(QemuConsole *con)
+{
+ assert(con != NULL);
+ return con->gl_block;
+}
+
char *qemu_console_get_label(QemuConsole *con)
{
if (con->console_type == GRAPHIC_CONSOLE) {