Commit Graph

59 Commits

Author SHA1 Message Date
balrog
8bf66d402b Fix absolute mode mice.
width and height were never set which means that host coordinates were 
divided by -1 instead of (width - 1) / 0x7fff.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6476 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-29 23:19:20 +00:00
pbrook
6e60065f88 Fix SDL slowness.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6373 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-21 01:50:17 +00:00
malc
413bfb7cfc Remove real_screen->pixels checks
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6372 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-21 00:34:46 +00:00
aliguori
7d957bd8cb DisplayState interface change (Stefano Stabellini)
This patch changes the DisplayState interface adding support for
multiple frontends at the same time (sdl and vnc) and implements most
of the benefit of the shared_buf patch without the added complexity.

Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is
also responsible for allocating the data and setting the depth.
Vga.c (or another backend) will do any necessary conversion.

The idea is to change it so that is vga.c (or another backend) together
with console.c that fully manage the DisplayState interface allocating
data and setting the depth (either 16 or 32 bit, if the guest uses a
different resolution or is in text mode, vga.c (or another backend) is
in charge of doing the conversion seamlessly).

The other idea is that DisplayState supports *multiple* frontends
like sdl and vnc; each of them can register some callbacks to be called
when a display event occurs.

The interesting changes are:

- the new structures and related functions in console.h and console.c

in particular the following functions are very helpful to manage a
DisplaySurface:

qemu_create_displaysurface
qemu_resize_displaysurface
qemu_create_displaysurface_from
qemu_free_displaysurface

- console_select and qemu_console_resize in console.c
this two functions manage multiple consoles on a single host display

- moving code around in hw/vga.c
as for the shared_buf patch this is necessary to be able to handle a dynamic
DisplaySurface bpp

- changes to vga_draw_graphic in hw/vga.c
this is the place where the DisplaySurface buffer is shared with the
videoram, when possible;


Compared to the last version the only changes are:

- do not remove support to dpy_copy in cirrus_vga
- change the name of the displaysurface handling functions

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6336 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15 22:14:11 +00:00
aliguori
8927bcfd33 remove bgr (Stefano Stabellini)
Do not handle bgr host displays in the backends.

Right now a bgr flag exists so that sdl can set it, if the SDL_Surface
is bgr.
Afterwards the graphic device (e.g. vga.c) does the needed conversion.

With this patch series is sdl that is responsible for rendering the format
provided by the graphic device that must provide a DisplaySurface
(ds->surface) in 16 or 32 bpp, rgb.
Afterwards sdl creates a SDL_Surface from the given DisplaySurface and
blits it into the main SDL_Surface using SDL_BlitSurface.

Everything is handled by sdl transparently, because SDL_BlitSurface is
perfectly capable of handling bgr displays by itself.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6335 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15 22:07:16 +00:00
aliguori
6bb816031f Handle SDL grabs failing (Mark McLoughlin)
If a X window is not viewable, XGrabPointer() fails and
returns GrabNotViewable. SDL's X backend currently handles
this by retrying the grab until the window becomes viewable
again.

This means e.g. if you Ctrl-Alt-RightArrow to switch
workspaces, QEMU tries to grab, SDL blocks because the
window isn't viewable and your guest stops executing until
you switch back to that workspace again.

See this Fedora bug for the gory details:

  https://bugzilla.redhat.com/480065

Some SDL backends will return SDL_GRAB_OFF from
SDL_WM_GrabInput(), so the fix is to make the X backend do
this if the grab fails.

The only side-effect in QEMU is that if SDL_WM_GrabInput()
fails we still change the window title to indicate that it's
grabbed, when in fact it's not. This patch fixes that minor
issue.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6325 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15 20:47:45 +00:00
aliguori
bcfad70fb0 add DisplayState->idle (Samuel Thibault)
Add idle field to DisplayState struct, so drivers can figure
the display is idle and take advantage of that.

The xen framebuffer driver will use this to communicate the
idle state to the guest, so it knows it can stop doing updates
to a virtual display which is invisible anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5056 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21 20:08:55 +00:00
aliguori
5b08fc106d Handle terminating signals (Gerd Hoffmann)
This patch makes qemu handle signals better.  It sets the request_shutdown
flag, making the main_loop exit and qemu taking the usual exit route, with
atexit handlers being called and so on, instead of qemu just being killed
by the signal.

To avoid calling vm_start() from the signal handler main_loop() got an
additional check so qemu_system_shutdown_request() works even when the
vm is in stopped state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5055 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21 20:08:03 +00:00
blueswir1
749ecd9953 Fix detection of 15 bit display depth
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4936 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-24 11:25:30 +00:00
aliguori
c7bd7bec8c Fix SDL problems with BGR displays (Avi Kivity)
revert qemu's sdl.c rev 1.40

this fixes problems with bgr displays.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4925 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-23 13:24:33 +00:00
aurel32
3bee8bd013 SDL: Fix dead keys
(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4208 c046a42c-6fe2-441c-8c8c-71466251a162
2008-04-13 16:08:37 +00:00
aurel32
f442e08b41 Slowdown SDL while minimized
When SDL is invisible/minimized, there is no need to keep calling the
VGA refresh 33 times per second.  This patch reduces in that case the
rate to 2 times per second, which should be responsive enough for the
un-minimizing event.

(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4050 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-13 19:20:33 +00:00
aurel32
4c44bdcb70 SDL mouse events smoothness
(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4049 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-13 19:20:18 +00:00
aurel32
b94ed5772e Let the USB tablet reach the far bottom and right pixels
(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4036 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-10 19:34:27 +00:00
pbrook
87ecb68bdf Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17 17:14:51 +00:00
ths
3b46e62427 find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17 08:09:54 +00:00
ths
5fafdf24ef find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16 21:08:06 +00:00
ths
3780e197e4 Add alternate grab key, by Michael Mohr.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2990 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-21 21:08:02 +00:00
balrog
731345e17b Unpause the emulation after shutdown request on SDL close, so that it can take effect.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2989 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-21 17:56:50 +00:00
blueswir1
b29169d265 Attempt to fix incorrect colours on some BGR displays
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2974 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-10 16:07:38 +00:00
ths
e91c8a7783 Spelling fixes, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2927 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-03 13:35:16 +00:00
balrog
9467cd4602 -show-cursor switch to inhibit SDL hiding cursor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2763 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-01 01:34:14 +00:00
ths
d34cab9f49 VMware SVGA II emulation, by Andrzej Zaborowski.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2579 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-02 01:10:46 +00:00
ths
c35734b2a6 Add -name option, by Anthony Liguori.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2505 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-19 15:17:08 +00:00
ths
43523e9332 -no-frame option for sdl, by Christian Laursen.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2435 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-18 18:19:32 +00:00
ths
6070dd07e9 Split out SDL X keymap, by Bernhard Fischer.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2354 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-24 21:40:21 +00:00
ths
455204eb1a Dynamic handling of guest mice, by Lonnie Mendez.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2290 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-05 16:42:13 +00:00
ths
667accab8e Implement -no-quit option, by Xavier Gnata.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2239 c046a42c-6fe2-441c-8c8c-71466251a162
2006-12-11 02:08:05 +00:00
bellard
60659e3b44 Japanese keyboard fixes (kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2129 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-19 14:27:31 +00:00
bellard
dfd92d3a46 reset key modifiers when switching console (aka savevm keyboard bug)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2112 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-17 10:42:46 +00:00
bellard
c66b0d4cf4 avoid stopping QEMU when switching desktops with Ctrl-Alt-x
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1954 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-13 12:03:53 +00:00
bellard
8785a8ddcc 'invisible wall' patch (Anthony Liguori)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1953 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-13 10:49:12 +00:00
bellard
d3079cd241 bgr32 pixel format support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1912 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-10 22:17:36 +00:00
bellard
09b26c5ec0 USB tablet support (Brad Campbell, Anthony Liguori)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1810 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-12 21:09:08 +00:00
pbrook
95219897ff Allow multiple graphics devices.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1803 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-09 01:06:34 +00:00
pbrook
5b31187812 Make sure gui_key_modifier_pressed is cleared correctly.
Use correct event fields for SDL_ACTIVEEVENT.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1780 c046a42c-6fe2-441c-8c8c-71466251a162
2006-03-11 20:07:45 +00:00
bellard
9903da21e3 SDL full screen patch for Windows (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1595 c046a42c-6fe2-441c-8c8c-71466251a162
2005-10-30 23:19:10 +00:00
bellard
1ff5c1a68e prevent window resizing
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1519 c046a42c-6fe2-441c-8c8c-71466251a162
2005-07-23 17:54:50 +00:00
bellard
18a6d284ad enabled wheel mouse support (initial patch by Volker Ruppert)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1229 c046a42c-6fe2-441c-8c8c-71466251a162
2005-01-17 22:32:23 +00:00
bellard
3d11d0eb33 keymaps support (initial patch by Johannes Schindelin)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1173 c046a42c-6fe2-441c-8c8c-71466251a162
2004-12-12 16:56:30 +00:00
bellard
bf2b84e4a7 better ctrl-alt handling, at least for SDL/X11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1145 c046a42c-6fe2-441c-8c8c-71466251a162
2004-11-14 19:46:35 +00:00
bellard
32ff25bf68 ctrl-alt is the default grab key - reset modifiers when toggling grab state
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1094 c046a42c-6fe2-441c-8c8c-71466251a162
2004-10-03 14:33:54 +00:00
bellard
d63d307f6e -loadvm and -full-screen options
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1090 c046a42c-6fe2-441c-8c8c-71466251a162
2004-10-03 13:29:03 +00:00
bellard
457831f4bc virtual console support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1022 c046a42c-6fe2-441c-8c8c-71466251a162
2004-07-14 17:22:33 +00:00
bellard
e58d12ed5b Darwin patch
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@982 c046a42c-6fe2-441c-8c8c-71466251a162
2004-07-05 22:13:07 +00:00
bellard
979a54fb20 new reset API
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@936 c046a42c-6fe2-441c-8c8c-71466251a162
2004-06-20 12:36:04 +00:00
bellard
ee38b4c813 fixed full screen refresh
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@913 c046a42c-6fe2-441c-8c8c-71466251a162
2004-06-08 00:56:42 +00:00
bellard
22a56b8a87 sdl keyboard fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@889 c046a42c-6fe2-441c-8c8c-71466251a162
2004-06-05 08:32:36 +00:00
bellard
de2200d36d fixed window switch - fixed caps lock and num lock - simplified keycodes (initial idea by Mark Jonckheere)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@886 c046a42c-6fe2-441c-8c8c-71466251a162
2004-06-04 13:15:06 +00:00
bellard
b71e95fc2c win32 patch (kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@829 c046a42c-6fe2-441c-8c8c-71466251a162
2004-05-20 13:08:06 +00:00