Statistics
| Branch: | Revision:

root / ui / sdl.c @ 6a1751b7

History | View | Annotate | Download (27.1 kB)

# Date Author Comment
5209089f 04/25/2013 10:45 pm Gerd Hoffmann

console: zap ds arg from register_displaychangelistener

We don't have multiple DisplayStates any more,
so passing it in as argument is not needed.

Signed-off-by: Gerd Hoffmann <>

81c0d5a6 04/16/2013 10:26 am Gerd Hoffmann

console: add qemu_console_is_*

Signed-off-by: Gerd Hoffmann <>

0f7b2864 04/16/2013 10:03 am Gerd Hoffmann

console: gui timer fixes

Make gui update rate adaption code in gui_update() actually work.
Sprinkle in a tracepoint so you can see the code at work. Remove
the update rate adaption code in vnc and make vnc simply use the
generic bits instead.

Signed-off-by: Gerd Hoffmann <>

1dbfa005 04/16/2013 10:03 am Gerd Hoffmann

console: rename vga_hw_*, add QemuConsole param

Add QemuConsole parameter to vga_hw_*, so the interface allows to update
non-active consoles (the actual code can't handle this yet, see next
patch). Passing NULL is allowed and updates the active console, like...

8db9bae9 03/18/2013 11:21 am Gerd Hoffmann

sdl: stop using DisplayState

Rework DisplayStateListener callbacks to not use the DisplayState
any more.

Signed-off-by: Gerd Hoffmann <>

bc2ed970 03/18/2013 11:21 am Gerd Hoffmann

console: zap displaystate from dcl callbacks

Now that nobody depends on DisplayState in DisplayChangeListener
callbacks any more we can remove the parameter from all callbacks.

Signed-off-by: Gerd Hoffmann <>

7c20b4a3 03/18/2013 11:21 am Gerd Hoffmann

console: fix displaychangelisteners interface

Split callbacks into separate Ops struct. Pass DisplayChangeListener
pointer as first argument to all callbacks. Uninline a bunch of
display functions and move them from console.h to console.c

Signed-off-by: Gerd Hoffmann <>

468dfd6d 03/18/2013 11:21 am Gerd Hoffmann

sdl: drop dead code

DisplayAllocator removal (commit
187cd1d9f30d13f0d0ef682e4d91cfa3e4cbd472) made this a nop.

Signed-off-by: Gerd Hoffmann <>

c12aeb86 03/18/2013 11:21 am Gerd Hoffmann

console: rework DisplaySurface handling [dcl/ui side]

Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener
callbacks with a dpy_gfx_switch callback which notifies the ui code
when the framebuffer backing storage changes.

Signed-off-by: Gerd Hoffmann <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

28ecbaee 12/19/2012 09:31 am Paolo Bonzini

ui: move files to ui/ and include/ui/

Signed-off-by: Paolo Bonzini <>

a93a4a22 11/01/2012 02:10 pm Gerd Hoffmann

console: untangle gfx & txt updates

Stop abusing displaysurface fields for text mode displays.
(bpp = 0, width = cols, height = lines).

Add flags to displaystate indicating whenever text mode display
(curses) or gfx mode displays (sdl, vnc, ...) are present....

4dc6a39b 11/01/2012 02:10 pm Gerd Hoffmann

console: remove dpy_gfx_fill

Unused code. 'nuff said.

Signed-off-by: Gerd Hoffmann <>

187cd1d9 11/01/2012 02:10 pm Gerd Hoffmann

console: remove DisplayAllocator

Causes [temporary] preformance regression with 24bpp vga modes @ sdl.

Signed-off-by: Gerd Hoffmann <>

bf2fde70 11/01/2012 02:10 pm Gerd Hoffmann

console: move set_mouse + cursor_define callbacks

When adding DisplayChangeListeners the set_mouse and cursor_define
callbacks have been left in DisplayState for some reason. Fix it.

Signed-off-by: Gerd Hoffmann <>

63ea491d 02/27/2012 10:46 am Alon Levy

sdl: remove NULL check, g_malloc0 can't fail

Signed-off-by: Alon Levy <>
Signed-off-by: Gerd Hoffmann <>

85f94f86 02/01/2012 10:45 pm Jan Kiszka

sdl: Fix block prevention of SDL_WM_GrabInput

Consistently check for SDL_APPINPUTFOCUS before trying to grab the input
focus. Just checking for SDL_APPACTIVE doesn't work. Moving the check to
sdl_grab_start allows for some consolidation.

Signed-off-by: Jan Kiszka <>...

eaa2e027 02/01/2012 10:45 pm Jan Kiszka

Revert "Handle SDL grabs failing (Mark McLoughlin)"

This reverts commit 6bb816031f8bc0aafc3476e6dfa4293ee3a5f106.

SDL_WM_GrabInput does not reliably bail out if grabbing is impossible.
So if we get here, we already lost and will block. But this can no
longer happen due to the check in sdl_grab_start. So this patch became...

822f98d2 02/01/2012 10:45 pm Jan Kiszka

sdl: Grab input on end of non-absolute mouse click

By grabbing the input already on button down, we leave the button in
that state for the host GUI. Thus it takes another click after releasing
the input again to synchronize the mouse button state.

Avoid this by grabbing on button up....

02df4d6f 02/01/2012 10:45 pm Jan Kiszka

sdl: Limit sdl_grab_end in handle_activation to Windows hosts

There are scenarios on Linux with some SDL versions where
handle_activation is continuous invoked with state = SDL_APPINPUTFOCUS
and gain = 0 while we grabbed the input. This causes a ping-pong when we...

66596356 02/01/2012 10:45 pm Jan Kiszka

sdl: Do not grab mouse on mode switch while in background

When the mouse mode changes to absolute while the SDL windows is not in
focus, refrain from grabbing the input. It would steal from some other
window.

Signed-off-by: Jan Kiszka <>...

1354869c 09/15/2011 10:39 pm Luiz Capitulino

Drop the vm_running global variable

Use runstate_is_running() instead, which is introduced by this commit.

Signed-off-by: Luiz Capitulino <>

f8b8d633 08/22/2011 10:37 pm Jan Kiszka

sdl: Don't release input on mouse mode change in full-screen mode

While in full-screen mode, the input focus naturally belongs to the SDL
window. Avoid dropping it when switching from absolute to relative
mouse mode.

Signed-off-by: Jan Kiszka <>...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

9510a486 08/05/2011 06:57 pm Jan Kiszka

sdl: Refactor sdl_send_mouse_event

Replace width/height globals with the identical values from real_screen,
refactor the function according to our coding style.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

2a8ad7da 08/05/2011 06:57 pm Jan Kiszka

sdl: Fix full screen toggling from scaled mode

When switching to full screen mode from a scaled window, we need to
resize to DisplayState's dimension, not the scaled "real" screen size.
Moreover, scaling mode may have manipulated the bpp. So we need to
restore it from the DisplayState as well....

f9977897 08/05/2011 06:57 pm Jan Kiszka

sdl: Restore scaling mode on return from full screen

Save the scaling mode and its geometry when going full screen, restore
it when returning to windowed mode.

CC: Stefano Stabellini <>
Signed-off-by: Jan Kiszka <>...

982aae66 08/05/2011 06:57 pm Jan Kiszka

sdl: Drop bogus gui_fullscreen_initial_grab

There must be no difference between initial -full-screen and switching
to this mode via the hot key.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

110defd7 08/05/2011 06:57 pm Jan Kiszka

sdl: Initialize gui_fullscreen earlier during setup

This ensures that we actually enter full screen on startup when e.g.
'-vga none -full-screen' was specified.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

f8558100 08/05/2011 06:57 pm Jan Kiszka

sdl: Consistently avoid grabbing input for text consoles

There were some preexisting bits that released the input when switching
to text console. This patch spreads this logic consistently and also
avoids grabbing the input while a text console is active....

f623d885 08/05/2011 06:57 pm Jan Kiszka

sdl: Never release input while in full screen mode

It's confusing to suddenly find two mice in full screen mode when
switching consoles or accidentally hitting the grab hot keys.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

74d9dc69 08/05/2011 06:57 pm Jan Kiszka

sdl: Fix cursor handling when switching consoles in absolute mouse mode

Restore the cursor when switching from graphic to text console while the
mouse is in absolute mode. Disable it again when returning.

Signed-off-by: Jan Kiszka <>...

35b0f237 08/05/2011 06:57 pm Jan Kiszka

sdl: Dynamically grab input in absolute mouse mode

Not grabbing the input means that special keys like ALT+TAB are still
handled by the host. Improve the usability by grabbing input once the
mouse is inside the guest screen, provided the SDL window has the input...

d6a65ba3 08/05/2011 06:57 pm Jan Kiszka

sdl: Add zoom hot keys

Allow to enlarge or shrink the screen via CTRL-ALT-+/-. In contrast to
scaling the window, these controls always preserve the aspect ratio of
the current console.

CC: Stefano Stabellini <>
Signed-off-by: Jan Kiszka <>...

1ae1caf1 08/05/2011 06:57 pm Jan Kiszka

sdl: Factor out event handlers from sdl_refresh

No functional changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

941f511a 08/05/2011 06:57 pm Jan Kiszka

sdl: Fix termination in -no-shutdown mode

Just like the monitor does, we need to clear no_shutdown before calling
qemu_system_shutdown_request on quit requests. Otherwise, QEMU just
stops the VM.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

91ada980 08/05/2011 06:57 pm Jan Kiszka

sdl: Do not make full screen mode resizable

This prevents continuous resizing events and improper screen setups when
going full screen.

CC: Stefano Stabellini <>
Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

97ad1c26 08/05/2011 06:57 pm Jan Kiszka

sdl: Avoid redundant scaling deactivation

Prevents screen flickering.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

d71680c8 08/05/2011 06:57 pm Jan Kiszka

sdl: Properly mark modifier+u as hotkey

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

9e8dd451 07/23/2011 07:26 pm Jan Kiszka

notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <>...

9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

1de9756b 05/15/2011 02:05 am Michael Tokarev

set $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for video card

Signed-off-by: Michael Tokarev <>
Acked-by: Alexander Graf <>
Signed-off-by: Aurelien Jarno <>

09cec717 04/01/2011 10:53 pm Stefan Weil

ui/sdl: Load optional QEMU icon

Load an optional QEMU icon file. If there is no icon file named
qemu.bmp in QEMU's default search path, QEMU will run with
the usual system default icon.

A matching icon file will be loaded and used by X Windows managers...

ffe8b821 03/22/2011 03:39 pm Jes Sorensen

Consolidate DisplaySurface allocation in qemu_alloc_display()

This removes various code duplication from console.e and sdl.c

Signed-off-by: Jes Sorensen <>
Signed-off-by: Anthony Liguori <>

4e79bcbb 02/04/2011 02:33 pm Stefan Weil

ui/sdl: Fix handling of caps lock and num lock keys

Starting with SDL version 1.2.14, caps lock and num lock keys
will send a SDL_KEYUP when SDL_DISABLE_LOCK_KEYS=1 is set in
the environment.

The new code sets the environment unconditionally
(it won't harm old versions which do not know it)....

1b958498 01/30/2011 12:52 am Blue Swirl

sdl: remove unused variable

Variable rec is not used, remove it. Spotted by GCC 4.6.0:
CC ui/sdl.o
/src/qemu/ui/sdl.c: In function 'sdl_setdata':
/src/qemu/ui/sdl.c:90:14: error: variable 'rec' set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Blue Swirl <>

cdfb017e 08/15/2010 12:46 pm Stefan Weil

win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)

configure adds the macro WIN32_LEAN_AND_MEAN to
QEMU_CFLAGS, and SDL_syswm.h defines it, too.

This results in a compiler warning (redefinition of
WIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents...

3e230dd2 07/27/2010 01:35 am Corentin Chary

ui: move all ui components in ui/

Move sdl, vnc, curses and cocoa UI into ui/ to cleanup
the root directory. Also remove some unnecessary explicit
targets from Makefile.

aliguori: fix build when srcdir != objdir

Signed-off-by: Corentin Chary <>...