Commit Graph

430 Commits

Author SHA1 Message Date
Yonit Halperin
68cdc5488d client: keyboard - add mapping for volume keys
Add support for sending volume keys scancodes to the guest
RHBZ #552539

A good reference for mapping keymaps to scancodes can be found in
spice-gtk/gtk/keymaps.csv

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
2012-03-01 08:58:52 +02:00
Christophe Fergeau
a50619e733 Fix compilation when smartcard support is disabled
The addition of smartcard control to the controller doesn't handle
the case when smartcard support is disabled at compile time. When
this is the case, this causes compile errors.
2012-02-29 18:20:01 +01:00
Alon Levy
4b7c66cafc controller_test: add README 2012-02-28 14:40:42 +02:00
Alon Levy
294dae31b0 client controller_test: reorder parameters since pid isn't needed for linux client test 2012-02-28 14:40:42 +02:00
Alon Levy
26516fc5a2 client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828) 2012-02-28 14:40:42 +02:00
Alon Levy
bbd01f5f63 controller_test: add ENABLE_SMARTCARD 2012-02-28 14:40:42 +02:00
Christophe Fergeau
67178944d2 Handle Application::set_hotkeys failure
Application::set_hotkeys can throw an exception if it fails parsing
the string describing the hotkeys to set. Currently this exception
is uncaught which causes spicec to terminate when the controller
tries to set invalid hotkeys. Fall back to using the default
hotkeys when the controller sends an invalid hotkeys string.
2012-02-03 13:11:11 +01:00
Christophe Fergeau
e3fb720cd1 Don't use "hw:0,0" for recording with alsa
We currently hardcode this device when spicec needs to record with
alsa. However, this doesn't interact well with PulseAudio, which
means that if something is already using the recording device, spicec
won't be able to open it again.
Using "default" as the device will let spicec use the PulseAudio
alsa support and will avoid this issue.
2012-01-31 16:40:57 +01:00
Hans de Goede
965a1a253c More comparison between signed and unsigned integer expressions warning fixes
Turns out that more recent snapshots of gcc-4.7 emit even more of these,
so the fixes which I've done before tagging the 0.10.1 release are not
enough to build warning free with the latest gcc-4.7 snapshot <sigh>.

This fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-23 20:33:27 +01:00
Hans de Goede
a0190fce23 Fix various comparison between signed and unsigned integer expressions warnings
These turn into errors because of our -Werror use, breaking the build.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-23 15:58:13 +01:00
Dan McGee
90d6126869 Remove epoll headers from client code
There is no more usage of epoll on the client side, so no need to
include these header files.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:59 +02:00
Dan McGee
b0b19f4b25 Update .gitignore with a few more generated files
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:58 +02:00
Alon Levy
7dbdd93bf9 client/foreign_menu: arm build fix 2012-01-22 15:13:32 +02:00
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
64f4826b6d Death to all TABs
Source files should all use spaces instead of tabs for
indentation. Update the few files not already in
compliance
2012-01-13 18:11:58 +02:00
Alon Levy
a9bf749779 client/windows: fix several assigned but not used errors 2012-01-13 17:42:23 +02:00
Alon Levy
96c292a0b4 client/windows: arraysize(inf.bmiColors) == 1 in mingw32 2012-01-13 17:42:23 +02:00
Alon Levy
fe61197643 client/windows: fix typo, make error messages unique 2012-01-13 17:42:23 +02:00
Alon Levy
54a7b36a57 client/windows/main: mingw32 provides PACKAGE_VERSION 2012-01-13 17:42:23 +02:00
Alon Levy
4236d1440b client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.h 2012-01-13 17:42:22 +02:00
Alon Levy
be3711f8b4 client: mingw32 build needs the jpeg_boolean define 2012-01-13 17:42:22 +02:00
Alon Levy
5430f3a61f client/common.h: mingw32 fix
define PACKAGE_VERSION only ifndef __GNUC__
Since it is defined by autoconf and so it kinda comes with using the GNU
compilers.
2012-01-13 17:42:22 +02:00
Alon Levy
01102ff62b client/Makefile.am: mingw32 fixes
* build resource file with windres
* include client/windows and not client/x11
* use CXIMAGE_CFLAGS (it's already set to -DDISABLE_CXIMAGE correctly)
2012-01-13 17:42:21 +02:00
Alon Levy
9d2768d7de client: log command line (rhbz 767581) 2012-01-13 17:37:50 +02:00
Hans de Goede
0ac13ecbc4 client-x11: Fix building with gcc-4.7
Without this change gcc says:
x11/res.cpp:31:1: error: narrowing conversion of ‘(((unsigned int)_alt_image.<anonymous struct>::width) * 4u)’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::width’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::height’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
cc1plus: all warnings being treated as errors

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-13 15:26:57 +01:00
Uri Lublin
8b797180ee client: screen: fix typo _forec_update_timer
sed -i 's/_forec_update_timer/_force_update_timer/' screen.cpp screen.h
2011-12-22 11:44:53 +02:00
Uri Lublin
a3a3b34a46 client: RedScreen::RedScreen: fix initialization order of _menu_needs_update
Related to a91b0b3ff7
2011-12-22 11:41:23 +02:00
Uri Lublin
fdcef17364 client: foreign-menu: pass "active" param when creating a ForeignMenu (#769020)
The default stays the same -- false.

A race could prevent setting ForeignMenu::_active correctly.
That happened when Application::on_app_activated was called before
_foriegn_menu was created. When foriegn_menu was created its
_active defaults to false, and that has not changed, until focus
was taken out and back in spice-client window.

This caused usbrdr to sometimes not auto-share devices, unless
the user switched focus to a different application and back to
spicec.

The fix updates ForiegnMenu::_active upon creation.
2011-12-20 18:44:11 +02:00
Uri Lublin
a91b0b3ff7 client: update menu if needed when exiting full-screen mode (#758260) 2011-12-20 18:44:05 +02:00
Uri Lublin
24d5852611 client: menu: make RedWindow::set_menu() return an error-code (#758260)
RedWindow::set_menu() can fail (on Windows when in fullscreen mode).
For Windows spice-client, when in fullscreen mode, the system-menu
is NULL.

Returns 0 upon success, non-0 (currently only -1) upon failure.
2011-12-20 18:43:53 +02:00
Uri Lublin
5d28d1662e client controller/foreign_menu: use memmove instead of memcpy in readers
When src/dst memory areas may overlap, it's safer to use memmove.
2011-12-20 18:27:32 +02:00
Marc-André Lureau
cf21af1846 build: remove unused variable 2011-12-15 16:51:53 +01:00
Marc-André Lureau
5b042031b0 spelling: s/cupture/capture 2011-12-14 00:27:17 +01:00
Gal Hammer
9ffa2e9990 client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
Hello,

The second patch check to see if Windows is sending a fake VK_CONTROL
message when the user pressed Alt-Gr when using a non-US keyboard layout
(German, Czech, etc...).

If the function is_fake_ctrl return true and key event is translated to
a REDKEY_INVALID and the event is discarded.

     Gal.
2011-11-24 18:30:13 +02:00
Gal Hammer
33be8633f5 client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
Hello,

I first updated the translate_key function. It now requires the windows
message as parameter (will be used later). It also use the raw wparam
and lparam parameters in order to remove the code duplication when
calling the function.

     Gal.
2011-11-24 18:29:55 +02:00
Arnon Gilboa
cc71891a02 client: add xinerama support
RHEL-6 Bugzilla: 695323

cherry-picked from qspice commit
 003667ac99beeec9b330a07bc3569c59a96d4588
 which fixes RHEL-5 541566

with merge of the one line qspice fix to SPICE_REQUIRES:
 9f3fe4755f11044a45c4b21148466a997fcbf735
 spice: fixed reference to xinerama pkg config file
 (Xinerama.pc=>xinerama.pc)
 Author: Yonit Halperin <yhalperi@redhat.com>
2011-11-14 15:10:23 +02:00
Yonit Halperin
c39d842ff1 client: support semi-seamless migration between spice servers with different protocols.
It can't actually happen right now, since switch-host migration scheme will take
place if the src/target server has protocol 1.
(cherry picked from commit 4b2bf4d88c branch 0.8)
2011-11-02 11:30:31 +02:00
Yonit Halperin
3a1473760c client: display channel - destroy all surfaces on disconnect
Fix not destroying surfaces and other data (e.g., streams) upon disconnection.
(cherry picked from commit 010b22cd77 branch 0.8)
2011-11-02 11:30:30 +02:00
Yonit Halperin
00ff038cc9 client: display channel migration
(cherry picked from commit cad3c58544 branch 0.8)

Conflicts:

	client/display_channel.cpp
2011-11-02 11:30:29 +02:00
Yonit Halperin
87664af999 client: playback/record channels: implement on_disconnect
(cherry picked from commit d3ed9d5e9d branch 0.8)
2011-11-02 11:30:27 +02:00
Yonit Halperin
0a5e9cbbcf client: main channel migration: do partial cleanup when switching hosts
Implement on_disconnect_mig_src and on_connect_mig_target in order to avoid
unnecessary cleanups done in on_(disconnet|connect).
In addition, do not request guest display settings changes after migration.
(cherry picked from commit f91d202eb3 branch 0.8)
2011-11-02 11:30:26 +02:00
Yonit Halperin
c73d5c10e6 client: handle SPICE_MSG_MAIN_MIGRATE_END
(1) disconnect all channels from the migration src
(2) after all channels are disconnected, clean global resources
(3) send SPICE_MSGC_MAIN_MIGRATE_END to migration target
(4) wait for SPICE_MSG_MAIN_INIT
(4) switch all channels to migration target
(cherry picked from commit 510a4ff7c4 branch 0.8)

Conflicts:

	client/red_channel.h
2011-11-02 11:30:24 +02:00
Yonit Halperin
6cd3ffba6f client: handle SpiceMsgMainMigrationBegin (semi-seamless migration)
RHBZ 725009, 738270
(cherry picked from commit 31ed2519a7 branch 0.8)

Conflicts:

	client/red_client.cpp
2011-11-02 11:30:23 +02:00
Yonit Halperin
f22caf9aee client: rewrite surfaces cache
use std::map instead of a specific template (CHash).
There is no need for special template. Moreover, using
std::map will allow easy iteration over the surfaces.
(cherry picked from commit fcb3b4ce52 branch 0.8)

Conflicts:

	client/display_channel.cpp
2011-11-02 11:30:21 +02:00
Christophe Fergeau
bc9306852d client/x11: reset screen positions in XMonitor::do_restore
XMonitor::do_restore (called for example when going out of
fullscreen) restore the screen resolution to its previous state,
but it doesn't take care of repositioning the screen to their
previous position, which is one of the advantages of using randr
1.2.
Since MultyMonScreen::restore handles all of this for us, just call
it to restore the monitor position/resolutions to their previous
settings. Before doing any changes, MultyMonScreen::restore checks
if there's something to do, so calling it once per monitor won't be
an issue, the resolution/position will only be set the first time.

This has the side-effect of fixing bug #693431. This bug occurs when
closing the client after the client went in and out of fullscreen.
MultyMonScreen::~MultyMonScreen calls MultyMonScreen::restore, which
decides to change the screen positions since they were lost when going
to fullscreen because XMonitor::restore didn't restore the positions.
After this change, the positions will be properly restored and
MultyMonScreen::restore won't be needlessly called upon client
shutdown.
2011-10-05 15:09:48 +02:00
Christophe Fergeau
e3e04b0a2a client/x11: fix mode setting in MultyMonScreen::restore
MultyMonScreen::restore changes the X11 Screen resolution, but it
doesn't use MultyMonScreen::set_size. This means
MultyMonScreen::_width and MultyMonScreen::_height don't get
updated to reflect the new resolution settings, which could cause
issues later on. Until now this was safe since the only caller of
MultyMonScreen::restore was MultyMonScreen destructor.
2011-10-05 15:09:47 +02:00
Christophe Fergeau
ae3e63a9d8 client/x11: fix typos (finde => find) 2011-10-05 15:09:46 +02:00
Christophe Fergeau
45ef140e23 client: fix typo commnad=>command 2011-09-20 14:51:45 +02:00
Christophe Fergeau
26e172e4be client: don't crash when booting a Xinerama setup
In a Xinerama setup, when X starts up and creates one of the
secondary screens, first a non-primary surface is created on the
secondary screen, and then the primary surface for this screen is
created.
This causes a crash when the guest uses Xinerama and the client
is attached to the VM before X starts (ie while the guest is
booting).
This happens because DisplayChannel::create_canvas (which is called
when creating a non-primary surface) assumes a screen has already been
set for the DisplayChannel while this only happens upon primary surface
creation. However, it uses the screen for non important stuff, so we
can test if screen() is non NULL before using it. This is what is done
in other parts of this file.

Fixes rhbz #732423
2011-09-19 18:33:33 +02:00