aboutsummaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@gmail.com>2022-03-26 01:12:16 +0900
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2022-03-29 00:41:50 +0200
commit1699d00e5b6f78bf2df8346189e847dfa575c622 (patch)
treed119aefcabe56ebd4685ba98ff10a7f3a51617b9 /ui/console.c
parentd6b6dea77e1e27b4644e71e0b9cc6009d56198d0 (diff)
downloadqemu-1699d00e5b6f78bf2df8346189e847dfa575c622.zip
qemu-1699d00e5b6f78bf2df8346189e847dfa575c622.tar.gz
qemu-1699d00e5b6f78bf2df8346189e847dfa575c622.tar.bz2
ui/console: Check console before emitting GL event
Without this change, The GL output of a console overwrites the other consoles and makes them unusable. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220325161216.74582-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c
index da434ce..1752f2e 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1886,6 +1886,9 @@ void dpy_gl_scanout_disable(QemuConsole *con)
con->scanout.kind = SCANOUT_NONE;
}
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_scanout_disable) {
dcl->ops->dpy_gl_scanout_disable(dcl);
}
@@ -1909,6 +1912,9 @@ void dpy_gl_scanout_texture(QemuConsole *con,
x, y, width, height
};
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_scanout_texture) {
dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
backing_y_0_top,
@@ -1927,6 +1933,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con,
con->scanout.kind = SCANOUT_DMABUF;
con->scanout.dmabuf = dmabuf;
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_scanout_dmabuf) {
dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
}
@@ -1940,6 +1949,9 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_cursor_dmabuf) {
dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf,
have_hot, hot_x, hot_y);
@@ -1954,6 +1966,9 @@ void dpy_gl_cursor_position(QemuConsole *con,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_cursor_position) {
dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y);
}
@@ -1967,6 +1982,9 @@ void dpy_gl_release_dmabuf(QemuConsole *con,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_release_dmabuf) {
dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
}
@@ -1983,6 +2001,9 @@ void dpy_gl_update(QemuConsole *con,
graphic_hw_gl_block(con, true);
QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
if (dcl->ops->dpy_gl_update) {
dcl->ops->dpy_gl_update(dcl, x, y, w, h);
}