summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Windows mingw: usb: Dynamically install a libusb driver for USB devicesUri Lublin2012-07-105-5/+626
| | | | | | | | | | | | | | | | | - Added win-usb-driver-install.[ch] - Added win-usb-clerk.h Operation (on Windows, spice-gtk point of view): - After some sanity checks, just before redir'ing a USB device a libusb driver needs to be installed (before libusb can open the device) - A connection (NamedPipe) is established with usb-clerk, a libusb driver installation service, and a request for driver installation is sent. - Installation status is asynchronously read from the pipe, and spice_usb_drv_install_finished() is called. - Upon a successful intallation, usbredir continues. Linux operation is not changed.
* Windows mingw: usb: implement GUdevDevice & GUdevClient for windowsArnon Gilboa2012-07-104-0/+641
| | | | | | - Added win-usb-dev.[ch] - Added GUdevDevice and GUdevClient like classes - Added uevent signal based on WM_DEVICECHANGE
* Make SpiceUsbDevice a box for SpiceUsbDeviceInfo, instead of a box for ↵Uri Lublin2012-07-101-35/+102
| | | | | | | libusb_device Note that this change may affect performance a bit, as sometimes there is a need to find the libusb_device or the SpiceUsbDevice. Likely it's negligible.
* Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_deviceUri Lublin2012-07-102-0/+137
| | | | | | | For Windows, it's better not to keep references for libusb_devices that are not used. So instead of makeing SpiceUsbDevice a box for a libusb_device it is going to be a box for a SpiceUsbDeviceInfo.
* Windows mingw: usb: configure.ac: do not require GUDEV for USBREDIRUri Lublin2012-07-102-1/+16
| | | | | | For windows GUDEV is not required For Linux GUDEV is checked as a part of USBREDIR block, but as a separate check.
* usb-device-manager: mingw: add_dev: ignore already known devicesUri Lublin2012-07-101-0/+8
| | | | | Sometimes on a Windows client, udev events are received while the driver is being un/installed. so just ignore it
* usb-device-manager: add a helper function to find a usb device <bus, addr>Uri Lublin2012-07-101-11/+21
| | | | And use it in spice_usb_device_manager_remove_dev
* spice_usb_device_get_description: use device-descriptor only to get <vid,pid>Uri Lublin2012-07-101-6/+11
| | | | | | | In preparation for a different SpiceUsbDevice. With the new SpiceUsbDeviceInfo, <vid,pid> will be provided by SpiceUsbDevice, and not by the device_descriptor (from libusb)
* spice_usb_device_manager_device_error: replace SpiceUsbDevice with libusb_deviceUri Lublin2012-07-103-3/+7
| | | | | | Its only user is channel-usbredir, which needs the libusb_device. In preparations for a different SpiceUsbDevice.
* spice_usb_device_manager_auto_connect_cb: use type SpiceUsbDevice for "device"Uri Lublin2012-07-101-3/+3
| | | | | Currently SpiceUsbDevice is a BOX for libusb_device. In preparation for a different SpiceUsbDevice.
* spice_usb_device_manager_add_dev: use type SpiceUsbDevice for "device"Uri Lublin2012-07-101-6/+10
| | | | | | | | Currently SpiceUsbDevice is a BOX for libusb_device. In preparation for a different SpiceUsbDevice. Renamed the libusb_device variable to libdev. Needed when asking usbredir to check the filter.
* spice_usb_device_manager_add_dev: check auto_ok before freeing libusb device ↵Uri Lublin2012-07-101-6/+9
| | | | | | list In preparation for a different SpiceUsbDevice.
* spice_usb_device_manager_remove_dev: use type SpiceUsbDevice for "device"Uri Lublin2012-07-101-4/+4
| | | | | Currently SpiceUsbDevice is a BOX for libusb_device. In preparation for a different SpiceUsbDevice.
* controller/test.c: mingw: fix compiler bad param warning for ReadFileUri Lublin2012-07-101-1/+3
| | | | | | | | | | | | | It seems that ssize_t is int, while DWORD is long Compiler warning (some whitespaces where added for readability): ../../../gtk/controller/test.c: In function 'read_from_pipe': ../../../gtk/controller/test.c:108:5: warning: passing argument 4 \ of 'ReadFile' from incompatible pointer type [enabled by default] In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:70:0, from ../../../gtk/controller/test.c:27: /usr/i686-w64-mingw32/sys-root/mingw/include/winbase.h:1426:29: note: expected \ 'LPDWORD' but argument is of type 'ssize_t *'
* usb-device-manager: warn if a device to remove was not foundUri Lublin2012-07-101-2/+6
| | | | Also changed a bit the warning text on device-add to differentiate the two.
* spicy: more informative presentation of usb devices in menuUri Lublin2012-07-101-1/+1
| | | | Using the default format.
* controller: async flush read/writeMarc-André Lureau2012-07-104-59/+69
| | | | | | | | | | | | | Windows namedpipes behave a bit differently from Unix socket, and may return incomplete read/write. By using 2 read/write() helpers, try to complete the operation before returning. Since the IO operation may be splitted over several call, we make sure the buffer pointer is on the heap. We use exception for EOF or BROKEN_PIPE condition, which also simplifies the code. To really work with namedpipe, the giowin32streams need to be fixed as well to handle concurrent read & write properly, see for details: https://bugzilla.gnome.org/show_bug.cgi?id=679288
* Remove mandatory generation of vala debug CMarc-André Lureau2012-07-101-1/+1
| | | | Use make VALAFLAGS=-g if you need it instead
* Fix mingw buildMarc-André Lureau2012-07-081-1/+4
| | | | | | | | | | | | | | | | | | | printf is redefined by glib/gi18n.h In file included from ../spice-common/common/spice_common.h:29:0, from ../spice-common/common/ring.h:23, from spice-channel-cache.h:23, from spice-session-priv.h:26, from desktop-integration.c:29: ../spice-common/common/log.h:49:17: error: 'libintl_printf' is an unrecognized format function type [-Werror=format] ../spice-common/common/log.h:56:16: error: 'libintl_printf' is an unrecognized format function type [-Werror=format] In file included from ../spice-common/common/canvas_base.h:25:0, from decode.h:23, from spice-session-priv.h:27, from desktop-integration.c:29: ../spice-common/common/lz.h:22:5: error: 'libintl_printf' is an unrecognized format function type [-Werror=format] ../spice-common/common/lz.h:23:5: error: 'libintl_printf' is an unrecognized format function type [-Werror=format] ../spice-common/common/lz.h:24:5: error: 'libintl_printf' is an unrecognized format function type [-Werror=format]
* unused variable 'self' if !USE_USBMarc-André Lureau2012-07-081-1/+1
| | | | | | | CC spice-widget-enums.lo desktop-integration.c: In function 'spice_desktop_integration_dispose': desktop-integration.c:175:30: error: unused variable 'self' [-Werror=unused-variable]
* spice-widget: Don't change usbredir/automount settings while redirectingHans de Goede2012-07-061-6/+19
| | | | | | | | | | | | The keyboard focus may change while usb-device-manager is in the process of redirecting a usb-device (as this may show a policykit dialog). Making autoredir/automount setting changes while this is happening is not a good idea! Since usb-device-manager already sets keyboard_grab_inhibit when it is redirecting to allow the policykit dialog to show, we can use that to inhibit usb-autoredir setting changes. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice-gtk-session: hookup automount inhibitingHans de Goede2012-07-061-1/+22
| | | | | | Inhibit automounting when usb-autoredirection is active. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add a desktop-integration helper classHans de Goede2012-07-066-0/+319
| | | | | | | | | | | | | | | | | We need to integrate closely with the desktop environment of the user in several cases. Some examples are disabling auto-mounting when auto-usbredir is active (rhbz#812972), and disabling the screensaver when fullscreen (fdo#34793). Unfortuntely these kinds of things require desktop environment specific handling. Therefor this patch introduces a desktop-integration helper class, which is to server as a container for all sort of desktop environment specific functions. For now it just supports disabling automounting under Gnome, but this will be extended in the future. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* agent: fix mishandling of SPICE_MSG_MAIN_AGENT_TOKENYonit Halperin2012-06-281-1/+1
| | | | Add the given tokens instead of overriding the existing ones.
* spice-gtk-session: rename update_keyboard_focus to request_auto_usbredirHans de Goede2012-06-263-11/+11
| | | | | | | To better reflect what then function does, also rename the tracking variable inside spice-gtk-session to match. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice-gtk-session: Fix keyboard focus trackingHans de Goede2012-06-261-2/+11
| | | | | | | | | | This patch changes the "do we have focus?" tracking, to keeping a counter with how many widgets have focus. The reason for this is that sometimes multiple spice-widgets can have focus at the same time, yes really! Sometimes (rarely, hard to reproduce) the focus in event for one window arrives before the focus out of the other window. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice-gtk-session: Only update usb "auto-connect" when doing "auto-usb-redir"Hans de Goede2012-06-262-7/+21
| | | | | | | | | Only update the UsbDeviceManager's "auto-connect" property when "auto-usb-redir" is set, otherwise leave it as is. This allows apps to control UsbDeviceManager's "auto-connect" directly, without it getting reset on every keyboard focus change. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Move "err" variable definition to beginning of the functionUri Lublin2012-06-241-1/+3
| | | | | | This fixes the following compilation error: channel-usbredir.c: In function 'spice_usbredir_channel_connect_device_async': channel-usbredir.c:313:9: error: jump skips variable initialization [-Werror=jump-misses-init]
* Fix build when usbredir is disabledChristophe Fergeau2012-06-131-1/+1
| | | | I broke it with my leak fixes
* Fix various memory leaksChristophe Fergeau2012-06-133-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==25063== 12,827 (2,032 direct, 10,795 indirect) bytes in 127 blocks are definitely lost in loss record 9,477 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE38616B1: g_slice_alloc (gslice.c:1003) ==25063== by 0x3DE38346B0: g_error_new_valist (gerror.c:393) ==25063== by 0x3DE3834A8C: g_set_error (gerror.c:560) ==25063== by 0x3DE4871108: g_socket_receive_with_blocking (gsocket.c:2513) ==25063== by 0x5B708E8: bio_gsocket_bread (bio-gsocket.c:56) ==25063== by 0x61AEBD8: BIO_read (bio_lib.c:212) ==25063== by 0x5ECAC5B: ssl3_read_n (s3_pkt.c:238) ==25063== by 0x5ECBD3D: ssl3_read_bytes (s3_pkt.c:318) ==25063== by 0x5ECD6CF: ssl3_get_message (s3_both.c:426) ==25063== by 0x5EC5AFB: ssl3_get_new_session_ticket (s3_clnt.c:1822) ==25063== 90 bytes in 3 blocks are definitely lost in loss record 7,354 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356) ==25063== by 0x5B961B5: spice_usb_device_manager_set_property (usb-device-manager.c:306) ==25063== by 0x3DE40148FB: g_object_constructor (gobject.c:1352) ==25063== by 0x3DE4015D70: g_object_newv (gobject.c:1713) ==25063== by 0x3DE401655F: g_object_new_valist (gobject.c:1830) ==25063== by 0x3DE485924D: g_initable_new_valist (ginitable.c:224) ==25063== by 0x3DE4859348: g_initable_new (ginitable.c:148) ==25063== by 0x5B97330: spice_usb_device_manager_get (usb-device-manager.c:770) ==25063== by 0x52D8C6B: spice_gtk_session_update_keyboard_focus (spice-gtk-session.c:845) ==25063== by 0x52D6DC1: spice_gtk_session_set_property (spice-gtk-session.c:238) ==25063== 120 bytes in 3 blocks are definitely lost in loss record 8,448 of 9,502 ==25063== at 0x4A06F18: calloc (vg_replace_malloc.c:566) ==25063== by 0x68BB2E5: usbredirfilter_string_to_rules (usbredirfilter.c:54) ==25063== by 0x5B96123: spice_usb_device_manager_set_property (usb-device-manager.c:293) ==25063== by 0x3DE40148FB: g_object_constructor (gobject.c:1352) ==25063== by 0x3DE4015D70: g_object_newv (gobject.c:1713) ==25063== by 0x3DE401655F: g_object_new_valist (gobject.c:1830) ==25063== by 0x3DE485924D: g_initable_new_valist (ginitable.c:224) ==25063== by 0x3DE4859348: g_initable_new (ginitable.c:148) ==25063== by 0x5B97330: spice_usb_device_manager_get (usb-device-manager.c:770) ==25063== by 0x52D8C6B: spice_gtk_session_update_keyboard_focus (spice-gtk-session.c:845) ==25063== by 0x52D6DC1: spice_gtk_session_set_property (spice-gtk-session.c:238) ==25063== by 0x3DE40148FB: g_object_constructor (gobject.c:1352) ==25063== 11,959 (72 direct, 11,887 indirect) bytes in 1 blocks are definitely lost in loss record 9,475 of 9,502 ==25063== at 0x4A06F18: calloc (vg_replace_malloc.c:566) ==25063== by 0x3459C92DDC: XkbGetKeyboardByName (XKBGetByName.c:59) ==25063== by 0x52DF000: vnc_display_keymap_gdk2xtkbd_table (vncdisplaykeymap.c:153) ==25063== by 0x52D9FA6: spice_display_init (spice-widget.c:389) ==25063== by 0x3DE402FA05: g_type_create_instance (gtype.c:1892) ==25063== by 0x3DE40147A7: g_object_constructor (gobject.c:1849) ==25063== by 0x52DA07B: spice_display_constructor (spice-widget.c:412) ==25063== by 0x3DE4015D70: g_object_newv (gobject.c:1713) ==25063== by 0x3DE401655F: g_object_new_valist (gobject.c:1830) ==25063== by 0x3DE4016893: g_object_new (gobject.c:1545) ==25063== by 0x52DE746: spice_display_new (spice-widget.c:1924) ==25063== by 0x41D6C3: virt_viewer_display_spice_new (virt-viewer-display-spice.c:219)
* misc: use g_value_dup_objectMarc-André Lureau2012-06-111-1/+2
|
* Fix incorrect format stringMarc-André Lureau2012-06-111-1/+1
|
* Fix video playback with GStreamer backendMarc-André Lureau2012-06-111-1/+4
| | | | | The playback audio delay is not correctly adjusted, we should take min_latency, set by gst_bin_do_latency_func ().
* Deprecate spice_channel_set_capability()Marc-André Lureau2012-06-113-3/+8
| | | | | | | This was initially public to eventually let a derived class implement more capabilities. Even though it is technically doable to derive and tweak exisiting channels, there is a lack of support in spice-gtk for doing that.
* Allow to disable specific capabilities at runtimeMarc-André Lureau2012-06-112-7/+13
| | | | | | Capability BAR for channel FOO can be disabled at runtime by setting the SPICE_FOO_CAP_BAR environment variable to '0' Disabling capabilities is useful for testing purpose.
* spice_channel_coroutine: fix function exit in error pathChristophe Fergeau2012-06-111-1/+1
| | | | | | spice_channel_coroutine returns a void *, but one of its error path is doing 'return FALSE'. This commit replaces this return with a 'goto cleanup' since this is what is done in the other error paths.
* spice_channel_coroutine: emit signals in all error casesChristophe Fergeau2012-06-111-0/+4
| | | | | | | There are several very unlikely failures where no signal is emitted to indicate the failure. Since applications rely on these signals to detect spice-gtk connection failures, it's important to emit one in all error cases.
* Emit SPICE_CHANNEL_ERROR_TLS when certificate can't be foundChristophe Fergeau2012-06-101-3/+4
| | | | | | | | | | | | When trying to start remote-viewer with SPICE over TLS with --spice-ca-file with a wrong filename, the connection fails but remote-viewer keeps displaying the "Trying to connect" message. The only hint that something went wrong is: (remote-viewer:12924): GSpice-WARNING **: loading ca certs from a/home/teuf/foo.crt This patch makes sure we emit a SPICE_CHANNEL_ERROR_TLS before giving up on channel creation to inform the application that an error happened.
* build: allow building with newer glibc-headers and -O0Christophe Fergeau2012-06-071-2/+6
| | | | | | | | | | | | | Fix copied from libvirt, commit by Eric Blake. glibc 2.15 (on Fedora 17) coupled with explicit disabling of optimization during development dies a painful death: /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] Work around this by only conditionally defining _FORTIFY_SOURCE, in the case where glibc can actually use it. The trick is using AH_VERBATIM instead of AC_DEFINE.
* Update spice-commonMarc-André Lureau2012-06-051-0/+0
|
* spicy: Change 'OK' button to 'Close' button in USB device selectionHans de Goede2012-06-042-1/+1
| | | | | | | | | The USB device selection applies immediately, so the dialog should be using 'Close' instead of 'OK' for its primary button. This patch syncs spicy with virt-viewer wrt the USB device selection dialog. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* widget: disconnect session_inhibit_keyboard_grab_changedMarc-André Lureau2012-05-291-0/+2
| | | | | | | | | | | There is one handler we forgot to disconnect on dispose() that may cause a crash. I am thinking of generalizing usage of spice_g_signal_connect_object().. Should fix: https://bugzilla.redhat.com/show_bug.cgi?id=823570
* Clipboard clean-up and fixes for Windows clientMarc-André Lureau2012-05-281-12/+6
| | | | | | | | | | | | | | | | | | The Windows client was getting in the way of guest copy-paste, because when the guest was taking the clipboard grab, the agent notifies the client, it takes the grab too, and in return receives clipboard notification of new ownership from the client clipboard. Though we had a hack to check if this new client clipboard event is caused by us, the Windows Gtk clipboard is giving 2 notifications for some reasons. It turned out there is a much better way than the "selfgrab" hack, by setting ownership of the clipboard. Problem solved, and cleaner code! https://bugzilla.redhat.com/show_bug.cgi?id=822688
* session: correctly track main channelMarc-André Lureau2012-05-221-14/+18
| | | | | | | | | | The main channel can change when we are reconnecting to the server, for example, when querying the password to the user. From there, the old main channel is destroyed, but we don't track properly the new main channel. This fix migration crashing later on, because of missing main channel: https://bugzilla.redhat.com/show_bug.cgi?id=823874
* Reset grab-sequence on matchMarc-André Lureau2012-05-181-6/+12
| | | | | | | This avoids triggering the grab event on consecutive matches, such as ctrl+alt (match) then ctrl+alt+foo (match again) that would prevent the longer combination from being sent.
* If grab sequence is matched, still send modifier keysMarc-André Lureau2012-05-181-1/+4
| | | | | | | | If the last key pressed from the grab sequence is a modifier key, let send it to the guest too. This solves the issue of default grab-sequence being ctrl+alt and preventing ctrl+alt+del from working.
* Running out of reserved space, break ABIMarc-André Lureau2012-05-178-29/+22
| | | | | | | | | | | | | | | | | | | | | | The change abc56811de978ad336a651924a21b920cfe677f0 actually added a field in a public struct while changing overall struct size, the fields were also reorder, all of this breaks ABI. However, we are running out of free space in SpiceChannelClass struct. And since the SPICE_RESERVED_PADDING was 44 bytes, that is quite limited on 64bits (only 5 pointers fit). I propose we break ABI during this cycle. This means that programs using spice-gtk will need to be recompiled to use the new library. (the old library should be parallel installable though). This let us: - use a better SPICE_RESERVED_PADDING based on pointer size, since it is what is usually added for virtual methods - reset the amount taken from the padding in the various struct - reorder fields a little - add some missing "priv" pointers - whatever I am missing that we can still change before next release Please comment if I am missing something, or correct me
* session: correctly set and unset ssl-verify flagsMarc-André Lureau2012-05-172-2/+6
| | | | If no cert-subject or pubkey is provided, we should unset the corresponding flags.
* record channel: reseting channel capsYonit Halperin2012-05-171-3/+9
|
* playback channel: reseting channel capsYonit Halperin2012-05-171-3/+9
|