summaryrefslogtreecommitdiffstats
path: root/include/ui/sdl2.h
Commit message (Collapse)AuthorAgeFilesLines
* ui: remove gl_ctx_get_currentMarc-André Lureau2021-02-041-1/+0Star
| | | | | | | | There are no users left. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-7-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* kbd-state: use state tracker for sdl2Gerd Hoffmann2019-02-051-0/+2
| | | | | | | | | | Use the new keyboard state tracked for sdl2. We can drop the modifier state tracking from sdl2. Also keyup code is simpler, the state tracker will take care to not send suspious keyup events to the guest. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20190122092814.14919-4-kraxel@redhat.com
* sdl2: remove sdl2_reset_keys() functionGerd Hoffmann2019-02-051-1/+0Star
| | | | | | | No users left, dead code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20190122092814.14919-3-kraxel@redhat.com
* sdl: add support for high resolution window iconDaniel P. Berrangé2019-01-211-0/+3
| | | | | | | | | | | | | | | | | | | Modern desktop environments can render icons at very large sizes, especially with high DPI screens. Providing a 32x32 pixel bitmap is nowhere near sufficient anymore. When displayed in GNOME shell the QEMU icon looks awful, having been scaled up to at least x4 its base size. This is compounded by the fact that the BMP file doesn't do transparency, so while we've removed white pixels, we still have anti-aliased nearly-white pixels which make the logo look appalling on black backgrounds. Loading a high resolution PNG icon addresses both problems, but requires use of the extra SDL2_image library. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20190110120047.25369-4-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl: Move DisplayOptions global to sdl2_consoleElie Tournier2018-04-271-0/+1
| | | | | | | Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Elie Tournier <elie.tournier@collabora.com> Message-id: 20180413135842.21325-3-tournier.elie@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl2: Ignore UI hotkeys after a focus change when GUI modifier is heldJindrich Makovicka2018-01-121-0/+1
| | | | | | | | | | | | | | | | | | 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>
* opengl: move shader init from console-gl.c to shader.cGerd Hoffmann2017-10-171-1/+1
| | | | | | | | | | | | 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
* sdl2: use framebuffer helper functions.Gerd Hoffmann2017-06-211-2/+6
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-4-kraxel@redhat.com
* sdl2: add scanout_disable supportGerd Hoffmann2017-02-271-0/+1
| | | | | | 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
* console: rename dpy_gl_scanout to dpy_gl_scanout_textureGerd Hoffmann2017-02-271-5/+7
| | | | | | | | | 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
* virgl: pass whole GL scanout dimensionsMarc-André Lureau2016-07-061-0/+1
| | | | | | | | | | | | | 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>
* sdl: shorten the GUI refresh interval when mouse or keyboard is activeJindřich Makovička2016-02-021-0/+1
| | | | | Signed-off-by: Jindřich Makovička <makovick@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl2/opengl: add opengl context and scanout supportGerd Hoffmann2016-01-081-1/+21
| | | | | | | This allows virtio-gpu to render in 3d mode. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* sdl2: add support for display rendering using opengl.Gerd Hoffmann2015-05-051-0/+11
| | | | | | | | 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>
* sdl2: move SDL_* includes to sdl2.hGerd Hoffmann2015-05-051-0/+6
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* ui/sdl2: Support shared surface for more pixman formatsGerd Hoffmann2015-01-191-0/+2
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl2: move sdl2_2d_refresh to sdl2-2d.cGerd Hoffmann2014-12-171-0/+1
| | | | | | | | 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>
* sdl2: factor out sdl2_poll_eventsGerd Hoffmann2014-12-171-0/+1
| | | | | | | | 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>
* sdl2: add+use sdl2_2d_redraw function.Gerd Hoffmann2014-12-171-0/+1
| | | | | | | | | | 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>
* sdl2: move sdl_switch to sdl2-2d.cGerd Hoffmann2014-12-171-0/+6
| | | | | | | 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>
* sdl2: move sdl_update to new sdl2-2d.cGerd Hoffmann2014-12-171-0/+3
| | | | | | | | 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>
* sdl2: move keyboard input code to new sdl2-input.cGerd Hoffmann2014-12-171-0/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* sdl2: rename sdl2_state to sdl2_console, move to header fileGerd Hoffmann2014-12-171-0/+16
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>