Commit Graph

339 Commits

Author SHA1 Message Date
Christophe Fergeau
e0c20725c8 s/USE_OGL/USE_OPENGL
This is more explicit about what it does, and not much longer
2011-05-03 14:44:11 +02:00
Christophe Fergeau
78c1465ed3 add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2011-05-03 14:44:10 +02:00
Christophe Fergeau
2db7212175 autotools: correctly build canvas-related code
spice client and spice server shares code from
common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is
shared, the server code wants a canvas compiled with
SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas
compiled with SW_CANVAS_CACHE.

The initial autotools refactoring didn't take that into account,
this is now fixed by this commit. After this commit, the canvas
files from common/ are no longer compiled as part of the
libspice-common.la convenience library. Instead, there are "proxy"
canvas source files in client/ and server/ which #include the
appropriate C files after defining the relevant #define for the
binary that is being built.

To prevent misuse of the canvas c files and headers in common/,
SPICE_CANVAS_INTERNAL must be set when including the canvas headers
from common/ or when building the c files from common/ otherwise
the build will error out.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
2a4614ea94 autotools: refactor the whole build machinery
spice Makefile.am setup is a bit confusing, with source file
names being listed several times in different Makefile.am
(generally, once in EXTRA_DIST and another time in another
Makefile.am in _SOURCES). The client binaries are built
by client/x11/Makefile.am, which means recursing into client,
then into x11 to finally build spicec. This Makefile.am is
also referencing files from common/ and client/, which is
a bit unusual with autotools.

This patch attempts to simplify the build process to get
something more usual from an autotools point of view.
The source from common/ are compiled into a libtool convenience
library, which the server and the client links against which avoids
referencing source files from common/ when building the server and
the client. The client is built in client/Makefile.am and directly
builds files from x11/ windows/ and gui/ if needed (without
recursing in these subdirectories).

This makes the build simpler to understand, and also makes it
possible to list source files once, which avoids potential
make distcheck breakage when adding new files.

There is a regression in this patch with respect to
sw_canvas/gl_canvas/gdi_canvas. They should be built with
different preprocessor #defines resulting in different behaviour
of the canvas for the client and the server. However, this is not
currently the case, both the client and the server will use the same
code for now (which probably means one of them is broken). This will
be fixed in a subsequent commit.

make distcheck passes, but compilation on windows using the
autotools build system hasn't been tested, which means it's likely
to be broken. It shouldn't be too hard ot fix it though, just let
me know of any issues with this.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
da584a5e2d add missing "LGPLv2.1 or later" header to source files 2011-05-02 11:24:44 +02:00
Christophe Fergeau
04780d6996 client: remove c++ wrappers
client/ contains several .cpp file which only #include a .c file
of the same name. This is unusual and seems to only be done to
get C++ name mangling on the symbols defined in the C file.
Now that all headers files in common/ use extern "C", these
wrappers are no longer useful.
2011-05-02 11:24:44 +02:00
Christophe Fergeau
8a3f1e8e7a configure.ac: fix make dist 2011-05-02 11:24:43 +02:00
Christophe Fergeau
12f99d327f client: skip spaces in --host-subject
This fixes fdo bug #32896:

"Subject in certificates is stored in following format (values separated by
comma and space):

grep Subject: server-cert.pem | awk -F": " '{print $2}'
O=REDHAT, CN=10.34.58.2

While spicec expects that values in host subject are separated only by comma:

spicec --host-subject "O=REDHAT,CN=10.34.58.2"
"

In this case, ignoring spaces make it much easier to directly copy and paste
the subject line from certificates.
2011-04-18 12:55:41 +02:00
Christophe Fergeau
f73ab66cb8 client: add --version cmdline option to spicec
This fixes freedesktop bug #33907
2011-04-18 12:38:47 +02:00
Christophe Fergeau
d590b48a46 client: s/reqired/required in CmdLineParser 2011-04-18 12:38:44 +02:00
Christophe Fergeau
56a4a05ae7 client: s/AVAILIBLE/AVAILABLE in CmdLineParser
It was mispelt in a CmdLineParser enum.
2011-04-18 12:38:39 +02:00
Christophe Fergeau
bb9b8a3c13 gl: remove unused variables
gcc 4.6 warned about these.
2011-04-08 11:09:39 +02:00
Christophe Fergeau
ace31d1c8a gl: use correct pixman accessor for image data
Commit 774e5bd36f changed
-  dest->source.pixmap.x_image->data +
+  (uint8_t *)pixman_image_get_stride(dest->source.pixmap.pixman_image) +

The correct accessor to use is pixman_image_get_data. Thanks to gcc
4.6 for warning about a "different size" int to pointer conversion.
2011-04-08 11:09:36 +02:00
Christophe Fergeau
0fcba8ba40 client: use silent generation rules in Makefile.am
The server Makefile.am rules for marshallers generation are
prefixed with AM_V_SILENT to integrate nicely with automake silent
rules. The same AM_V_SILENT prefix isn't used in client/Makefile.am
resulting in verbose output even when automake silent mode is
enabled. This commit removes this verbosity.
2011-04-08 11:09:32 +02:00
Hans de Goede
66dde82fee spicec-x11: Work around a bug in xsel
Although ICCCM 2.2. Responsibilities of the Selection Owner:
http://tronche.com/gui/x/icccm/sec-2.html#s-2.2

Clearly states (about selection notify events):
The owner should set the specified selection, target, time, and property
arguments to the values received in the SelectionRequest event.

xsel sets the selection notify event target member to the incr atom when it
is going to send the clipboard data incremental, rather then setting it to
the UTF8_STRING atom (which was the target of the SelectionRequest).

Work around this (esp as it is likely other programs may get this wrong too)
and accept the incr atom as a valid target in a selection notify event.

This fixes Alon's test with running:
python -c "print list(range(1000))" | xsel -i -b
on the client.
2011-03-23 17:18:37 +01:00
Hans de Goede
4020e24345 spicec-x11: Don't crash on apps sending bad atoms as TARGETS
Some apps (bad xsel, bad!) send invalid Atoms in their TARGETS property,
causing spicec to exit because of an XError. This patch makes spicec survive
this scenario.

For more info on the xsel bug, see:
https://bugzilla.redhat.com/show_bug.cgi?id=690214
2011-03-23 17:11:25 +01:00
Christophe Fergeau
ade5ecb2c8 opengl: fix compilation
When OpenGL is enabled, build fails in DisplayChannel::create_surface
because Canvas *canvas is declared twice. Remove the first
declaration to fix compilation.
2011-03-23 11:26:29 +01:00
Alon Levy
644b727184 client/smartcard: use proper include delemiters 2011-03-22 09:44:52 +02:00
Hans de Goede
9d204f8b74 client: Don't handle hotkeys while sticky alt is active
In some cases rhev-m changes the hotkey for releasing the mouse grab
to ctrl + alt. This makes it impossible to send ctrl + alt + other-key
to the guest, even when using sticky alt.

What happens is:
-press alt until sticky alt activates
-release alt (but recorded state stays pressed due to sticky alt)
-press ctrl
-hotkey code sees ctrl+alt pressed, releases mouse grab
-mouse grab release code does an unpress all -> end of sticky state.

This patch makes it possible to atleast send ctrl + alt + del (or other key)
using sticky alt. Note: even with this patch it is still a bad idea to
use ctrl + alt as hotkey combi.
2011-03-11 14:59:15 +01:00
Alon Levy
1af83642c1 client/smartcard: handle the --smartcard-db option 2011-03-08 21:18:55 +02:00
Arnon Gilboa
1a648fb397 client/windows: cleanup vcproj based on updated libs
using updated windows libraries:
http://www.spice-space.org/download/stable/wspice-x86_08032011.zip
http://www.spice-space.org/download/stable/wspice-x64_08032011.zip

-remove IgnoreDefaultLibraryNames="MSVCRT.lib", since pixman is now compiled
using MT threading model similar to other libraries. It used to be mistakenly
compiled with MD.

-downgrade freetype lib to 2.3.11-7, which is the one used/tested with
CEGUI 0.6.2

-pthread lib patched (InterlockedCompareExchange), so x64 client will no
longer crash on SelectClipRgn, BitBlt etc.
2011-03-08 13:00:01 +02:00
Hans de Goede
15b8252289 x11: Use _exit rather then exit on X errors (rhbz#680763)
This avoids us trying to restore the original resolution when we're fullscreen
and an X error happens. As restoring fullscreen is a bad idea then as this
involves making more X calls, which can get us stuck (in side an XLockDisplay
call for example).
2011-03-01 18:08:20 +02:00
Uri Lublin
e9ee6cf914 client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
When starting spicec with --controller, SPICE_XPI_SOCKET environment
variable must be defined so spicec and the controller can be connected.
2011-03-01 17:58:47 +02:00
Hans de Goede
0c88a60ecc Fix keyb modifiers not syncing from client to client os (rhbz#679467) 2011-03-01 16:12:32 +02:00
Arnon Gilboa
a76fce5514 client/windows: use SPICE_PROTOCOL_DIR in project include dirs
instead of ..\..\..\spice-protocol. Relative path to another git tree is a bit
ugly, since it requires spice-protocol to be in a specific location.

SPICE_PROTOCOL_DIR should also be used in windows qxl and vdagent instead of
SPICE_COMMON_DIR, which is an old and confusing name, due to the common
directory in spice git repo.
2011-02-13 12:23:47 +02:00
Hans de Goede
81f0f04ddc Drop static_title.bmp from windows/Makefile.am 2011-02-11 15:36:43 +01:00
Alon Levy
85ce53b6be client/smartcard: libcacard dropped ReaderAddResponse
uses VSC_Error with code==VSC_SUCCESS instead. This means that the VSC_Error
message is overloaded. Instead of the other option of adding a message id,
since the connection is TCP so no messages may be dropped or reordered, by
having each message followed by a response there is no ambiguity. Still
this commit adds a queue for messages that we only have one of which outstanding
at a time, i.e. send, wait for response, send the next, etc. This further
simplifies the logic, while not adding much overhead since only when spicec
starts up it has a situation where it needs to send two events (ReaderAdd
and ATR for Card Insert).
2011-02-09 12:14:03 +02:00
Alon Levy
91bf99a1e9 client/smartcard: ignore VSC_Init 2011-02-07 21:32:40 +02:00
Alon Levy
aed4c72a49 client/smartcard: s/reader_id_t/uint32_t/ (libcacard changed) 2011-02-07 21:31:43 +02:00
Alon Levy
bf6f246b2e client: log subject-host mismatch, and raise ssl warnings to errors 2011-02-07 18:49:37 +02:00
Uri Lublin
ed9b8ae69f spice-client migration: fix minor for old migration support.
For not too old spice-migration, minor is 1.
For older (ancient) spice-migration, minor is 0.

Affects only VM migration while a spice client is connected.
2011-01-27 18:26:09 +02:00
Alon Levy
42f83d18b5 client/windows: don't allocate console unless required 2011-01-27 17:19:07 +02:00
Alon Levy
645236df2b client: fix broken vs2008 build 2011-01-27 17:19:06 +02:00
Alon Levy
9394b2c50e client: --help should not need platform initialization
separate initialization into before command line parsing and after,
call later only if command line parsing succeeds (in particular, it
"fails" if --help is given).
2011-01-27 17:19:05 +02:00
Alon Levy
d20c90c7ef client: gcc 4.6.0: two more unused variable fixes 2011-01-25 17:29:31 +02:00
Alon Levy
9076e2e957 client/cegui: cegui 0.6.0 gcc 4.6.0 related fix
cegui doesn't include stddef required for ptrdiff_t type, we
include it for it.
2011-01-25 17:29:31 +02:00
Alon Levy
6fb222e4f3 client/glz_decoder.cpp: gcc 4.6.0 unused fixes 2011-01-25 17:29:31 +02:00
Alon Levy
f899034fd2 client/display_channel: gcc 4.6.0 unused fixes 2011-01-25 17:29:31 +02:00
Alon Levy
46c70521d5 client/server: warning fixes (gcc 4.6.0)
gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
few fixes tend to that. Mostly harmless.
2011-01-25 17:22:48 +02:00
Alon Levy
d3b22d86f0 client/server: add missing USE_TUNNEL
disable some code that only makes sense when USE_TUNNEL is defined
in client and server channel security level setting.
2011-01-25 17:16:27 +02:00
Alon Levy
5a2ef3b21c client/server: add missing smartchannel channel security handling
The name to channel id mapping for the smartcard channel is missing,
add it in client and server.
2011-01-25 17:16:18 +02:00
Alon Levy
4b81a8c2a5 client/cmd_line_parser: fix wrong reporting of bad argument in --bla=val case
We use get_opt_long, which allows non ambiguous abbreviations, but
since we didn't like that we have code that checks for abbreviations and
issues an error. But that code only handled separate argument and key like:
--bla value
and didn't handle them in the same arguemnts, like:
--bla=value
This patch fixes that, and gives a slightly better error report (it still
contains the =value part though)
2011-01-06 13:17:21 +02:00
Alon Levy
64c330793e client: CEGUI: search for CEGUI-0.6 to work in F15 (rawhide) 2011-01-05 15:02:56 +02:00
Thomas Tyminski
9f93db6f07 Fixes compilation error of Spice Client (Linux/X11) with OpenGL enabled modified: client/x11/red_window.cpp 2011-01-05 09:59:59 +01:00
Alon Levy
742703f641 mingw32: refix to build on mingw.. 2010-12-30 12:16:31 +02:00
Marc-André Lureau
d66c1904f9 client inputs: stop blinking keyboard when out of focus
We could introduce another boolean to prevent changes, or just reuse
_active_modifiers_event = true to prevent further update.

Additionaly this patch restore the keyboard state when focusing out,
which is fine when dealing with full remote desktop, but should be
reconsidered if/when SPICE supports remote windows managed by client
window manager for instance, imho.
2010-12-30 12:08:31 +02:00
Tiziano Mueller
3c46335004 jpeg_boolean is a mingw32-libjpeg specific thing. Use a define check rather than a version check. 2010-12-30 11:27:29 +02:00
Hans de Goede
392ed65dda spicec: Remove spice-client watermark (rhbz#662450)
This patch stops us from drawing the spice client watermark at the top of
the virtual machine view. We have had requests through several channels to
remove this as it has little added value, and is seen as annoying by some.
Given that we now also have a bugzilla for this I think it is time we really
remove it.
2010-12-16 14:54:46 +01:00
Hans de Goede
3e37f2c1e8 spicec-x11: Let the window manager place our window the 1st time (rhbz#662407)
The problem is that RedWindow::show calls the XLib MoveWindow function
on the window after it has been mapped, moving it to the location in
_show_pos. This is seen by the window manager as the application saying
I know exactly where I want my window to be placed, don't do placing for
me. Which causes the client window to always be shown at pos 0x0, even
though that may not be the best location.

What this patch does is:
1) It makes RedWindow::show not call MoveWindow when a window is
   first created normally and then shown
2) It makes RedWindow::show still call MoveWindow when:
   -when the window has been shown before, and was hidden for some
    reason (controller interface), and is now being re-shown
    so that it ends up being re-shown at its old position
   -when the window is a fullscreen window (screen.cpp always
    calls move on the window before showing it to set its position)
   -when the user switch from windowed mode -> fullscreen ->
    windowed mode again, to make sure that the windowed mode window
    is shown in the same position as before switching to fullscreen
    mode
2010-12-16 14:54:46 +01:00
Hans de Goede
4081d67162 spicec-x11: Add a class hint to our window managet hints
This helps people who want to tell their windowmanager to do something special
with spicec, like make it sticky, or whatever, see:
https://bugzilla.redhat.com/show_bug.cgi?id=662452#c4
2010-12-16 14:54:46 +01:00