aboutsummaryrefslogtreecommitdiff
path: root/ui/sdl2.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-12-21 08:00:26 -0800
committerRichard Henderson <richard.henderson@linaro.org>2021-12-21 08:00:26 -0800
commit5316e12bb2b4408a1597b283ef4bb4794dd7b4f7 (patch)
tree7433951bf002780d937f18539156d97af13d5bc7 /ui/sdl2.c
parent2bf40d0841b942e7ba12953d515e62a436f0af84 (diff)
parent89f4df9595e162ce4cc65f31a994a31e3e45ff3a (diff)
downloadqemu-5316e12bb2b4408a1597b283ef4bb4794dd7b4f7.zip
qemu-5316e12bb2b4408a1597b283ef4bb4794dd7b4f7.tar.gz
qemu-5316e12bb2b4408a1597b283ef4bb4794dd7b4f7.tar.bz2
Merge tag 'dbus-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging
Add D-Bus display backend # gpg: Signature made Mon 20 Dec 2021 10:57:18 PM PST # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [unknown] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * tag 'dbus-pull-request' of https://gitlab.com/marcandre.lureau/qemu: (36 commits) MAINTAINERS: update D-Bus section ui/dbus: register D-Bus VC handler ui/dbus: add chardev backend & interface option: add g_auto for QemuOpts chardev: make socket derivable chardev: teach socket to accept no addresses ui/dbus: add clipboard interface audio: add "dbus" audio backend tests: start dbus-display-test tests/qtests: add qtest_qmp_add_client() ui/dbus: add p2p=on/off option ui: add a D-Bus display backend build-sys: set glib dependency version docs: add dbus-display documentation docs: move D-Bus VMState documentation to source XML backends: move dbus-vmstate1.xml to backends/ docs/sphinx: add sphinx modules to include D-Bus documentation scripts: teach modinfo to skip non-C sources console: save current scanout details ui: move qemu_spice_fill_device_address to ui/util.c ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r--ui/sdl2.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 17c0ec3..0bd3050 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -561,7 +561,7 @@ static void handle_windowevent(SDL_Event *ev)
memset(&info, 0, sizeof(info));
info.width = ev->window.data1;
info.height = ev->window.data2;
- dpy_set_ui_info(scon->dcl.con, &info);
+ dpy_set_ui_info(scon->dcl.con, &info, true);
}
sdl2_redraw(scon);
break;
@@ -778,13 +778,17 @@ static const DisplayChangeListenerOps dcl_gl_ops = {
.dpy_mouse_set = sdl_mouse_warp,
.dpy_cursor_define = sdl_mouse_define,
- .dpy_gl_ctx_create = sdl2_gl_create_context,
- .dpy_gl_ctx_destroy = sdl2_gl_destroy_context,
- .dpy_gl_ctx_make_current = sdl2_gl_make_context_current,
.dpy_gl_scanout_disable = sdl2_gl_scanout_disable,
.dpy_gl_scanout_texture = sdl2_gl_scanout_texture,
.dpy_gl_update = sdl2_gl_scanout_flush,
};
+
+static const DisplayGLCtxOps gl_ctx_ops = {
+ .compatible_dcl = &dcl_gl_ops,
+ .dpy_gl_ctx_create = sdl2_gl_create_context,
+ .dpy_gl_ctx_destroy = sdl2_gl_destroy_context,
+ .dpy_gl_ctx_make_current = sdl2_gl_make_context_current,
+};
#endif
static void sdl2_display_early_init(DisplayOptions *o)
@@ -860,12 +864,16 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
#ifdef CONFIG_OPENGL
sdl2_console[i].opengl = display_opengl;
sdl2_console[i].dcl.ops = display_opengl ? &dcl_gl_ops : &dcl_2d_ops;
+ sdl2_console[i].dgc.ops = display_opengl ? &gl_ctx_ops : NULL;
#else
sdl2_console[i].opengl = 0;
sdl2_console[i].dcl.ops = &dcl_2d_ops;
#endif
sdl2_console[i].dcl.con = con;
sdl2_console[i].kbd = qkbd_state_init(con);
+ if (display_opengl) {
+ qemu_console_set_display_gl_ctx(con, &sdl2_console[i].dgc);
+ }
register_displaychangelistener(&sdl2_console[i].dcl);
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11)