aboutsummaryrefslogtreecommitdiff
path: root/include/ui/sdl2.h
AgeCommit message (Collapse)Author
2018-01-12sdl2: Ignore UI hotkeys after a focus change when GUI modifier is heldJindrich Makovicka
When SDL2 windows change focus while a key is held, the window that receives the focus also receives a new KeyDown event, without an autorepeat flag. This means that if a WM places the qemu console over the main window after Ctrl-Alt-2, the console closes immediately after opening. Then, the main window receives the KeyDown event again and the whole process repeats. This patch makes the SDL2 UI ignore the KeyDown events on a window that just received the focus, if the GUI modifier was held. The ignore flag is reset on a first KeyUp event. This effectively works around the issue above. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Message-Id: <20171117112258.5888-4-makovick@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-10-17opengl: move shader init from console-gl.c to shader.cGerd Hoffmann
With the upcoming dmabuf support in qemu there will be more users of the shaders than just console-gl.c. So rename ConsoleGLState to QemuGLShader, rename some functions too, move code from console-gl.c to shaders.c. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-3-kraxel@redhat.com
2017-06-21sdl2: use framebuffer helper functions.Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-4-kraxel@redhat.com
2017-02-27sdl2: add scanout_disable supportGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-6-git-send-email-kraxel@redhat.com
2017-02-27console: rename dpy_gl_scanout to dpy_gl_scanout_textureGerd Hoffmann
We'll add a variant which accepts dmabufs soon. Change the name so we can easily disturgish the two variants. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-2-git-send-email-kraxel@redhat.com
2016-07-06virgl: pass whole GL scanout dimensionsMarc-André Lureau
Spice client needs the whole GL texture dimension to be able to show a scanout with a monitor offset (different than +0+0). Furthermore, this fixes a crash when calling surface_{width,height}() after dpy_gfx_replace_surface(con, NULL) was called in virgl_cmd_set_scanout() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1465911849-30423-4-git-send-email-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-02-02sdl: shorten the GUI refresh interval when mouse or keyboard is activeJindřich Makovička
Signed-off-by: Jindřich Makovička <makovick@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08sdl2/opengl: add opengl context and scanout supportGerd Hoffmann
This allows virtio-gpu to render in 3d mode. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-05-05sdl2: add support for display rendering using opengl.Gerd Hoffmann
Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-05-05sdl2: move SDL_* includes to sdl2.hGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-01-19ui/sdl2: Support shared surface for more pixman formatsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-12-17sdl2: move sdl2_2d_refresh to sdl2-2d.cGerd Hoffmann
Now that common event handling code is split off, we can move over sdl_refresh to sdl2-2d.c, and rename it to sdl2_2d_refresh. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: factor out sdl2_poll_eventsGerd Hoffmann
Create a new function to poll and handle sdl2 events, which is then just called from the refresh timer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: add+use sdl2_2d_redraw function.Gerd Hoffmann
Add a new sdl2_2d_redraw function for a complete screen refresh, so we can stop using graphic_hw_invalidate for that. There is no need to bother console / gfx emulation code if we are just going to re-blit the screen after window resizes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move sdl_switch to sdl2-2d.cGerd Hoffmann
Move sdl_switch to sdl2-2d.c file, rename to sdl2_2d_switch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move sdl_update to new sdl2-2d.cGerd Hoffmann
Create new sdl2-2d file for 2d display rendering. Move over sdl_update code, and rename to sdl2_2d_update. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move keyboard input code to new sdl2-input.cGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: rename sdl2_state to sdl2_console, move to header fileGerd Hoffmann
Create sdl2.h header file, in preparation for sdl2 code splitup. Populate it with sdl2_console struct (renamed from sdl2_state). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>