Commit Graph

598 Commits

Author SHA1 Message Date
Gerd Hoffmann
b1ea7b79e1 spice: auth fixes
Set auth to sasl when sasl is enabled, this makes "info spice" correctly
display sasl auth.  Also throw an error in case someone tries to set
a spice password via monitor without auth mode being "spice".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-11 10:12:47 +02:00
Peter Lieven
bea60dd767 ui/vnc: fix potential memory corruption issues
this patch makes the VNC server work correctly if the
server surface and the guest surface have different sizes.

Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH
x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of
VNC_DIRTY_PIXELS_PER_BIT.

If we have a resolution whose width is not dividable by VNC_DIRTY_PIXELS_PER_BIT
we now get a small black bar on the right of the screen.

If the surface is too big to fit the limits only the upper left area is shown.

On top of that this fixes 2 memory corruption issues:

The first was actually discovered during playing
around with a Windows 7 vServer. During resolution
change in Windows 7 it happens sometimes that Windows
changes to an intermediate resolution where
server_stride % cmp_bytes != 0 (in vnc_refresh_server_surface).
This happens only if width % VNC_DIRTY_PIXELS_PER_BIT != 0.

The second is a theoretical issue, but is maybe exploitable
by the guest. If for some reason the guest surface size is bigger
than VNC_MAX_WIDTH x VNC_MAX_HEIGHT we end up in severe corruption since
this limit is nowhere enforced.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01 13:26:40 +02:00
Peter Lieven
f9a70e7939 ui/vnc: limit client_cut_text msg payload size
currently a malicious client could define a payload
size of 2^32 - 1 bytes and send up to that size of
data to the vnc server. The server would allocated
that amount of memory which could easily create an
out of memory condition.

This patch limits the payload size to 1MB max.

Please note that client_cut_text messages are currently
silently ignored.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01 13:26:40 +02:00
Peter Maydell
13aefd303c ui/cocoa: Honour -show-cursor command line option
Honour the -show-cursor command line option (which forces the mouse pointer
to always be displayed even when input is grabbed) in the Cocoa UI backend.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1403516125-14568-5-git-send-email-peter.maydell@linaro.org
2014-06-29 22:00:33 +01:00
Peter Maydell
f61c387ea6 ui/cocoa: Fix handling of absolute positioning devices
Fix handling of absolute positioning devices, which were basically
unusable for two separate reasons:
 (1) as soon as you pressed the left mouse button we would call
     CGAssociateMouseAndMouseCursorPosition(FALSE), which means that
     the absolute coordinates of the mouse events are never updated
 (2) we didn't account for MacOSX coordinate origin being bottom left
     rather than top right, and so all the Y values sent to the guest
     were inverted

We fix (1) by aligning our behaviour with the SDL UI backend for
absolute devices:
 * when the mouse moves into the window we do a grab (which means
   hiding the host cursor and sending special keys to the guest)
 * when the mouse moves out of the window we un-grab
and fix (2) by doing the correct transformation in the call to
qemu_input_queue_abs().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1403516125-14568-4-git-send-email-peter.maydell@linaro.org
2014-06-29 22:00:33 +01:00
Peter Maydell
5dd45bee58 ui/cocoa: Add utility method to check if point is within window
Add a utility method to check whether a point is within the current window
bounds, and use it in the various places in the mouse handling code that
were opencoding the check.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1403516125-14568-3-git-send-email-peter.maydell@linaro.org
2014-06-29 22:00:33 +01:00
Peter Maydell
381600dad9 ui/cocoa: Cope with first surface being same as initial window size
Do the recalculation of the content dimensions in switchSurface if the
current cdx is zero as well as if the new surface is a different size to
the current window. This catches the case where the first surface registered
happens to be 640x480 (our current window size), and fixes a bug where we
would always display a black screen until the first surface of a different
size was registered.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1403516125-14568-2-git-send-email-peter.maydell@linaro.org
2014-06-29 22:00:33 +01:00
Paolo Bonzini
db39fcf1f6 qemu-char: introduce qemu_chr_alloc
The next patch will modify this function to initialize state that is
common to all backends.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23 11:12:28 -04:00
Wenchao Xia
7cfadb6b52 qapi event: convert SPICE events
SPICE_INITIALIZED, SPICE_CONNECTED, SPICE_DISCONNECTED and
SPICE_MIGRATE_COMPLETED are converted in one patch, since they
use some common functions. inet_strfamily() is removed since no
callers exist anymore.

Note that there is no existing doc for SPICE_MIGRATE_COMPLETED
in docs/qmp/qmp-events.txt before this patch.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23 11:12:28 -04:00
Wenchao Xia
fb6ba0d525 qapi event: convert VNC events
Since VNC_CONNECTED, VNC_DISCONNECTED, VNC_INITIALIZED share some
common functions, convert them in one patch.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23 11:12:28 -04:00
Wenchao Xia
a589569f2f qapi: adjust existing defines
In order to let event defines use existing types later, instead of
redefine new ones, some old type defines for spice and vnc are changed,
and BlockErrorAction is moved from block.h to qapi schema. Note that
BlockErrorAction is not merged with BlockdevOnError.

At this point, VncInfo is not made a child of VncBasicInfo, because
VncBasicInfo has mandatory fields where VncInfo makes them optional.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23 11:01:25 -04:00
Peter Maydell
9d3c512021 vnc: cleanups and fixes
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTosMxAAoJEEy22O7T6HE436sQAMimtuVhUWMxNoyC86ucQ3Db
 2hk8x7ok3kSPQwNT6EcCwgBf+aSLZPU7mc8QMNVk1VxNf2cMNeYTKWJvBLFKyz8i
 XvqSVSUWCLAfl3a9UN2AuKGE1GvFvmgb8pq4eSPfPBsP9CDzdzS5ftOFDpY5MMtB
 fX8CCCrmw+QZoVS5RLd7XTT6bkYgaQdHbZdzAODLaTl8q3whKtHwVENbxYtvYuVs
 i5/0IoWD3xOL91hiuyZ+ZFigSzEjUB3L0gsguzaHkz5rvSuM2yFD7UKAFurG7pQy
 HZ3UbzeQmge2CsAf3oSkQvZlEBNCFL8sTFElK6NLh0my3PZld8vA4D5YTFEBMi0l
 fp5rlEwNuIyPwOnHw2WJOG/1Op4XDM2deNxubrCRnvxeS+r48uDAUPdIhIq2+Ygs
 afWcC50Uu+r3q5yuqccdCUriqfE4ePq4u/+d4IlvrX6tUtZpc9LI82rLRjUkM80I
 MtEL1+unTFdKl5YZduGzs1NIuBDH5vjvkmtkAQ98blNNQ9c4i2nTED+SpVwqIYqw
 A7WQ1dC3YqP03Mf3O0ZatvA2HSvPl39LRC6peMSubqjysqBCnox9Y/U6vcY0Y0+6
 uq1I3dYEHwmM0JqOPgl356s9N8hgG2lq503RIZvFQxSuE/E+PuS/8/mx/Z5hmwgV
 jFyILXZaUfJd46f/IVO2
 =rFPx
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140619-1' into staging

vnc: cleanups and fixes

# gpg: Signature made Thu 19 Jun 2014 12:02:09 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vnc-20140619-1:
  vnc: fix screen updates
  vnc: Drop superfluous conditionals around g_strdup()
  vnc: Drop superfluous conditionals around g_free()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-20 16:57:28 +01:00
Gerd Hoffmann
e8e23b7dcf spice: fix 32bit build
Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1403244764-8622-1-git-send-email-kraxel@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-20 16:22:07 +01:00
Gerd Hoffmann
eb214ff8ef vnc: fix screen updates
Bug was added by 38ee14f4f3.
vnc_jobs_join call is missing in one code path.

Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-19 12:48:07 +02:00
Markus Armbruster
c14e98479b vnc: Drop superfluous conditionals around g_strdup()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-19 12:48:07 +02:00
Markus Armbruster
64641d8764 vnc: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-19 12:48:07 +02:00
Gerd Hoffmann
5643fc012c spice: add mouse cursor support
So you'll have a mouse pointer when running non-qxl gfx cards with
mouse pointer support (virtio-gpu, IIRC vmware too).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-13 12:34:57 +02:00
Gerd Hoffmann
fa7a1e5219 gtk: update window size after showing/hiding tabs
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-11 14:26:49 +02:00
Gerd Hoffmann
f50def915e gtk: factor out gtk3 grab into the new gd_grab_devices function
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-11 14:26:49 +02:00
Gerd Hoffmann
0a337ed067 gtk: cleanup backend dependencies
Make configure detect gtk x11 backend and link libX11 then.  Make
gtk backend specific code properly #ifdef'ed on the GTK_WINDOWING_*
backends at runtime).  Our gtk ui code should build and run fine on
any platform now.

This also fixes the linker failute due to the new XkbGetKeyboard call
added by commit 3158a3482b.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-11 14:26:49 +02:00
Gerd Hoffmann
932f2d7e0f gtk: factor out keycode mapping
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-11 14:26:49 +02:00
Gerd Hoffmann
333cb18ff4 console: fix -vga none -sdl crash
Call get_alloc_displaystate() for proper initialization
instead of allocating with g_new().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-10 12:36:36 +02:00
Gerd Hoffmann
a1d2db08d8 console: kill MAX_CONSOLES, alloc consoles dynamically
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-10 12:36:36 +02:00
Gerd Hoffmann
2deb4acc7c input/vnc: use kbd delays in press_key
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-04 08:40:42 +02:00
Gerd Hoffmann
5a165668e7 input/curses: add kbd delay between keydown and keyup events
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-04 08:40:42 +02:00
Gerd Hoffmann
2e377f1730 input: use kbd delays for send_key monitor command
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-04 08:40:41 +02:00
Gerd Hoffmann
be1a717624 input: add support for kbd delays
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-04 08:40:41 +02:00
Peter Maydell
1673e89e93 sdl2: add support for text consoles
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTjIuoAAoJEEy22O7T6HE4qYQQALToHNyddpNlMHRUIbmCqKsY
 vDPxUJIy/DGcW8wzH6dvrPFa28QVYGBnrhfpj9ck4Kc1YpN8NrQE+0I8wS3snpuw
 LRwUkmzc+we07iPK0pFn1vpgXek0BYAZVtXUayDQnf79j83rVkHoOB8cFu/2IwA3
 FJR9pvBrQuqdblrEEFMmAvw6cBtSoqWXae+fjxzRdopC9Oz0pJUfr1FT+MXvhOPY
 FjC6G00JmAN3cGStanbs4HL4RFWEf7PSmETJXHOIPe6OA6ky1peINw37Z4AXGJNZ
 Gv9A59spjC3vhqO1DzhuA1eDZjLrQf+YfPsvAXvEq7GkLJ9j8TJu+uoaZuMhQ+6n
 RqoUG9TgDX9Hhfr07tYD2IOZdQiZ6Epb43OjZaJqp1NcS0LGdvt4/ewu6UxrzRw4
 gU0x1p47BsQc1RJJ4668rswjqmwaOhkDhwaWgCCQ0PdSGxN2SC/4sGqO9WCLkL3L
 MjgnNL3ZqxEN6UDW8o80JzZ0VEFLq8jlKOT8wBMquM4zgV3+ICi+StaLuOMnetmM
 LVKqpm3DcxvKWoDx7GZHQkk2ExXND4O41yLV1Q1mYXJSM7YZtDBz5VwZqFKVRqJl
 aE/xP0IIZIPXjO14uz7aH+kQoc43WSIZEeKv3KvJNqpdP9H6a9o//0PzKfdDsUB/
 nw93tGaQVlwGzaD5wEmf
 =Ma/a
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into staging

sdl2: add support for text consoles

# gpg: Signature made Mon 02 Jun 2014 15:35:20 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-sdl-3:
  sdl2: textinput + terminal
  sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
  console: add kbd_put_string_console
  console: add kbd_put_qcode_console

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-02 16:10:12 +01:00
Gonglei
b52991537c vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}
Spotted by Coverity:

(1) Event assignment:  Assigning: "pixels" = "0".
(2) Event cond_true:  Condition "y < h", taking true branch
(3) Event cond_false:  Condition "x < w", taking false branch
(4) Event loop_end:  Reached end of loop
(5) Event divide_by_zero:  In expression "(stats[0] + stats[1]) * 100U / pixels",
division by expression "pixels" which may be zero has undefined behavior.

290     DEFINE_DETECT_FUNCTION(16)
291     DEFINE_DETECT_FUNCTION(32)

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:30:52 +02:00
Gerd Hoffmann
4006617552 vnc: add trace events for key events
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:29:01 +02:00
Gerd Hoffmann
cf864569cd vnc: refuse to set a password with VNC_AUTH_NONE
Current code silently changes the authentication settings
in case you try to set a password without password authentication
turned on.  This is bad.  Return an error instead.

If we want allow changing auth settings at runtime this should
be done explicitly using a separate monitor command, not as
side effect of set_passwd.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:29:01 +02:00
Gerd Hoffmann
f2335791fd sdl2: textinput + terminal
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:28:58 +02:00
Gerd Hoffmann
363f59d9e4 sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:28:58 +02:00
Gerd Hoffmann
bdef972474 console: add kbd_put_string_console
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:28:58 +02:00
Gerd Hoffmann
50ef467923 console: add kbd_put_qcode_console
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02 16:28:58 +02:00
Peter Maydell
53651ec26b console: multiwindow support for text terminal QemuConsoles
console: small fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTgviXAAoJEEy22O7T6HE4MT8P/2KmAyqcBgq5Z1UXFdjrR9NC
 LAcYNDDPan0ZRfVXwg2r6XV2lCrQgZN9g9mprE5KZGrGHTvoOgzdECBB5FR0R6mg
 1XcYyxyNAsN/9ddUxFPnN3Mku5lczHG5PtDaP4eSPl4PaMEe7Cz66H36QNRZOC7v
 D8bNGYoXlncTcmU8I1vSqUnVglpbHCN4JLMhpAF9Ak+7GC9Yxq3nWJ9D38Cy8V7N
 Y0DdUxPK/Hx48HSjgs2hrmrXtMnUmhz154sL4IVpiVuQG19Fs69Zd0fTcw4Gcu+W
 V2GdNiH206H8VC/DA7toN/CNj6MIQqxiM4vu846rdUdin42romATg2E7UF8vu2c0
 sw+86DDGB+J0G4J6iQoWyt5dcOB/XoplEqXh0zsudbmPLcUrwSHuMlWoMwf+8pvu
 Cjl9tl/6yXWS/ChVErcMHxyGG9FXsB3ouU7mmKTX2efimssHcRwvTyp8y0Knt6/e
 ZweMXozdJASrwSy0HDHCJvVOqva6UjTPClzjKISq/rHa5E5D1CybKOxz3BWydC51
 ppGHu1kzTVD7d/hSz4+M4SHLg/jkSSK9s7fM8lwNvIAN6PpVOdf7bsxrnNZOrYiH
 2ZsbiOaZISiDcP94PntP/1yyJRDQCp7wOQ+orAv0WLLYwuDdqnzCDrFn1IkVq9PT
 +ykImMosc8dgdc5+pBAU
 =NwUd
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-1' into staging

console: multiwindow support for text terminal QemuConsoles
console: small fixes

# gpg: Signature made Mon 26 May 2014 09:17:27 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-console-1:
  console: add kbd_put_keysym_console
  console: rework text terminal cursor logic
  console: update text terminal surface unconditionally
  console: nicer initial screen
  console: Abort on property access errors

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-28 12:36:25 +01:00
Peter Maydell
109519fd32 gtk: ui overhaul, multiwindow support.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTgvNPAAoJEEy22O7T6HE4jawQANUGoa3wgDawhjj3OGSw0Ik8
 OvcoVdGUXPYTDlBdd7165aNuQvcVobq+Ox2/ghkZozOUZWts4KUdshTNx7n51mrR
 tPDlsOwcowXuhJxwkykIbE2uT4cQ374l/G0gnpc6erV4MV5GVkm7FnBsZeCGKEBu
 +CMb8w6gWY6w7Q++BH8Sq0BBV7z+w3dIFpBRGrFgFWkBMdyRJRXCF3r9zqdkb39J
 RyoxRnwQXbzIfJx9suvSLiuXU2w7D6uQ2wQiprKlGW7MaxgDeSBihr1B6eyoT+VW
 2XEDcrY02AgwgCWkOSVDn4S/qWVoXv02o1sfWqyr4ADJNYMXaqwtuFtsI9q6F77M
 l8PmdJm8K8tkgsioAzrfcxkGZ17Yd3xZLL0pzRjOP/tsxhL0VdK/E286+Rg1Gl8w
 1rnNrZInWNm6JjQvzUc14+UVbcb8IGI5VbGmHulJxu3QovcxOkRffAbAvy+ESfRw
 q3kokMfO4eFTQ3xPL4lcoPajjaXlZ2nujkyA31XjNnMOYH0Ns7mU0W+hB5uaLWaS
 0FkmmmfNShhI5jy4dlI11DA9fIPDcEttzEgmkBr5FWft4Mz+/HjrS50CHnvL4MIA
 ma0TFgR7fgOkb1A/hS0CkqiYSIXS5CsJMKD/fNn0olLeqdaTpWpL5vF10Dh/hUPQ
 +GLzLmvcCGXsZUguJXpu
 =418E
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-7' into staging

gtk: ui overhaul, multiwindow support.

# gpg: Signature made Mon 26 May 2014 08:54:55 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-gtk-7: (24 commits)
  gtk: workaround gtk2 vte resize issue
  gtk: window sizing overhaul
  gtk: zap unused global_state
  gtk: Add handling for the xfree86 keycodes
  gtk: enable untabify for gfx
  gtk: detached window pointer grabs
  gtk: update all windows on mouse mode changes
  gtk: fix grab checks
  gtk: update gd_update_caption
  gtk: skip keyboard grab when hover autograb is active
  gtk: keep track of grab owner
  gtk: add gd_grab trace event
  gtk: add tab to trace events
  gtk: allow moving tabs to windows and back.
  gtk: simplify resize
  gtk: use device type as label
  gtk: support multiple gfx displays
  gtk: move vga state into VirtualGfxConsole
  gtk: VirtualConsole restruction
  gtk: remove page numbering assumtions from the code
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-28 11:18:58 +01:00
Gerd Hoffmann
ee8c0b622c sdl: pass key event source to input layer
So the input layer knows where the input is coming from
and input routing works correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:43 +02:00
Gerd Hoffmann
6f5943cf45 input: bind devices and input routing
Add function to bind input devices to display devices.  Implementing
input routing on top of this:  Events coming from the display device in
question are routed to the input device bound to it (if there is one).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:43 +02:00
Gerd Hoffmann
86846bfe64 input: keymap: add meta keys
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:43 +02:00
Gerd Hoffmann
2386a90730 input: add name to input_event_key_number
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:42 +02:00
Gerd Hoffmann
11c7fa7fa6 input: add qemu_input_key_number_to_qcode
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:42 +02:00
Andrew Oates
f5c0ab1312 input (curses): mask keycodes to remove modifier bits
Without the mask, control bits are passed on in the keycode, generating
incorrect PS/2 sequences when SHIFT, ALT, etc are held down.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andrew Oates <andrew@aoates.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:42:42 +02:00
Gerd Hoffmann
6fa2769751 gtk: workaround gtk2 vte resize issue
Hack isn't pretty, but gets the job done.
See source code comment for details.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Gerd Hoffmann
82fc18099a gtk: window sizing overhaul
Major overhaul for window size handling.  This basically switches qemu
over to use geometry hints for the window manager instead of trying to
get the job done with widget resize requests.  This allows to specify
better what we need and also avoids window resizes.

FIXME: on gtk2 someone overwrites the geometry hints :(

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Gerd Hoffmann
0f61a61df3 gtk: zap unused global_state
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Bruce Rogers
3158a3482b gtk: Add handling for the xfree86 keycodes
Currently only evdev keycodes are handled by the gtk-ui. SDL has
code to handle both. This patch adds similar processing so that
both keycode types will be handled via the gtk-ui.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Gerd Hoffmann
aa0a55d42d gtk: enable untabify for gfx
Now we have all grab fixes in place, so we can allow detaching
graphic display tabs too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Gerd Hoffmann
0c77a37f11 gtk: detached window pointer grabs
Make ungrab hotkey work with detached windows.
Enable pointer grabs for detached windows.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:04 +02:00
Gerd Hoffmann
99623c90d1 gtk: update all windows on mouse mode changes
We might have multiple graphic displays now which all need a cursor update.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26 08:41:03 +02:00