summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* session: keep a reference on disconnectMarc-André Lureau2014-12-011-0/+2
| | | | | | It is idiomatic for client code to clean up its reference on channel disconnection. Keeping a reference during disconnect helps solving potential crashes if the session is unref'ed during callbacks.
* session: remove sticky disconnecting flagMarc-André Lureau2014-12-011-4/+3
| | | | | | This used to help prevent double-unref when channel were considered part of the session as long as they lived. Now it shouldn't be required anymore
* channel: deprecate spice_channel_destroy()Marc-André Lureau2014-12-013-6/+11
| | | | | | This function is somewhat useless, and dangerous since it is calling g_object_unref() behind your back (although this is mentioned in the doc, I consider this a bad practice).
* display: don't reschedule stream if disconnected from sessionMarc-André Lureau2014-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | Avoid the following critical when a channel is disconnected with a pending stream (the streams are cleared on channel reset, after coroutine exit) (process:17188): GSpice-CRITICAL **: spice_session_get_mm_time: assertion 'session != NULL' failed #0 0x00007ffff71c24e5 in spice_session_get_mm_time (session=0x0) at spice-session.c:1999 #1 0x00007ffff71d438c in display_stream_schedule (st=0xa33040) at channel-display.c:1014 #2 0x00007ffff71d4a09 in display_stream_render (st=0xa33040, st@entry=<error reading variable: value has been optimized out>) at channel-display.c:1165 #3 0x0000003e1944a553 in g_timeout_dispatch (source=0xad64e0, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4520 #4 0x0000003e19449aeb in g_main_context_dispatch (context=0x6a32b0) at gmain.c:3111 #5 0x0000003e19449aeb in g_main_context_dispatch (context=context@entry=0x6a32b0) at gmain.c:3710 #6 0x0000003e19449e88 in g_main_context_iterate (context=0x6a32b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781 #7 0x0000003e1944a1b2 in g_main_loop_run (loop=0x97e200) at gmain.c:3975 #8 0x0000003e1c9ebb35 in gtk_main () at gtkmain.c:1207 #9 0x0000000000430185 in main (argc=1, argv=0x7fffffffdcb8) at virt-viewer-main.c:119
* session: remove channels on disconnectMarc-André Lureau2014-12-013-10/+12
| | | | | | | | | | | A channel is considered to be part of a session as long as it is alive. However, this model is problematic, since library user may hold channel references, and thus the channel will remain in the session. Calling spice_session_disconnect() several time will end up calling spice_channel_destroy(), releasing references that aren't owned by the session. This usually causes crashes, in particular with language bindings that do not deal well with a library model where objects can't be referenced at will.
* session: move SpiceSessionPrivate out of headersMarc-André Lureau2014-12-012-82/+84
| | | | Make sure none of the SpiceSessionPrivate fields are accessed directly anymore
* gtk: do not require glib session private fieldsMarc-André Lureau2014-12-014-11/+4
| | | | | | | | | | | Use GObject object association for session helpers. GtkSession and DesktopIntegration are in the gtk library SpiceSession is in glib one. So far we had the SessionPriv structure shared between the two libraries, so they could fit their pointers there. But this is no longer possible when moving the private structure in .c. We could add more accessors, but they would need to be in public API, and this isn't supposed to be accessed by API users.
* usb: move device manager initialization to sessionMarc-André Lureau2014-12-012-33/+34
| | | | | Use session accessors to initialize the device manager. Add missing session parameter check (public API).
* webdav: move initialization to sessionMarc-André Lureau2014-12-013-19/+30
| | | | Use session accessors to initialize the webdav server
* Rename display_channels_count/n_display_channelsMarc-André Lureau2014-12-013-8/+8
|
* session: add and use internal accessorsMarc-André Lureau2014-12-016-17/+76
| | | | | Avoid dereferencing session private data directly, and use accessors instead.
* session: set session for migration when connectingMarc-André Lureau2014-12-012-1/+3
|
* session: rename migration_copy/for_migrationMarc-André Lureau2014-12-013-3/+3
|
* smartcard: use spice_session_is_for_migration()Marc-André Lureau2014-12-011-2/+2
|
* smartcard: do not initialize manager for migration sessionMarc-André Lureau2014-12-011-8/+9
| | | | The migration session is temporary and shouldn't interact with system.
* Add spice_session_is_for_migration()Marc-André Lureau2014-12-015-0/+23
|
* session: protect internal functions against invalid argsMarc-André Lureau2014-12-011-54/+76
| | | | | | Make sure calling an internal session function returns with an error when called with a NULL pointer. This will help channel code when it is removed from session before being destructed.
* audio: move spice_audio_get() to sessionMarc-André Lureau2014-12-012-31/+34
|
* audio: add accessor to check if audio is enabledMarc-André Lureau2014-12-013-9/+19
|
* audio: Avoid bad pipelines from gst_parse_launchVictor Toso2014-12-011-6/+14
| | | | | gst_parse_launch may return not NULL even when error is set. This can lead to data loss when playing or recording audio.
* audio: new-sample callback must return GST_FLOW_OKVictor Toso2014-12-011-2/+3
|
* build-sys: simplify autogen.shMarc-André Lureau2014-12-011-2/+3
|
* build-sys: fix out-of-tree autofooMarc-André Lureau2014-12-011-4/+7
|
* Release keyboard grab using keyboard shortcutPavel Grunt2014-11-302-7/+47
| | | | | | | | | | | This commit adds the ability to release the keyboard grab when the release keys (ctrl+alt) are pressed and released. It allows to use keyboard shortcuts (eg alt+tab, alt+f4) on the client. The keyboard is grabbed again when the release keys are pressed and released or when the mouse moves. https://bugs.freedesktop.org/show_bug.cgi?id=85331
* spice-widget: check whether the widget is realized in focus_in_event()Fabiano Fidêncio2014-11-271-0/+3
| | | | | | | | | | | | | | | | | | | Returning early on focus_in_event(), when widget is not realized, avoids segfault when running on Windows using GTK3. Program received signal SIGSEGV, Segmentation fault. _gdk_windows_has_impl <window=window@entry=0x0> at gdkwindow.c:584 <gdb> bt #0 _gdk_window_has_impl (window=window@entry=0x0) at gdkwindow.c:584 #1 0x70f02821 in gdk_win32_window_get_handle (window=0x0) at gdkwindow-win32.c:3459 #2 0x00c759ef in update_display (display=0x1b18440) at spice-widget.c:1297 #3 0x00c77280 in focus_in_event (widget=0x1b18440, focus=0x1b02b68) at spice-widget.c:1462 #4 0x665727f5 in ?? () from C:\Program Files\VirtViewer (GTK3)\bin\libgtk-3-0.dll #5 0x00000000 in ?? ()
* migration: delay switch host reconnectMarc-André Lureau2014-11-242-3/+6
| | | | | | | | | | | | The following critical happens on switch-host: (remote-viewer:4617): GSpice-CRITICAL **: channel_connect: assertion 'c->sock == NULL' failed The critical happens since the main channel reset code calls set_agent_connected(), which will yield to main loop, so reconnection can't happen after calling spice_channel_disconnect(), and must wait until the channel reset completes.
* migration: don't check socket errorMarc-André Lureau2014-11-211-0/+4
| | | | | | During migration, the original socket is closed before the coroutine finishes, so it's not guaranteed that c->sock will still be set when the channel is in an error state in spice_channel_iterate().
* coroutine: reference object when signalingMarc-André Lureau2014-11-211-1/+4
| | | | | | | Before the signal is actually emitted, the channel may be released. Let's keep a reference to the object during the function time, to prevent the object from being destroyed before calling g_signal_emit() or g_object_notify() in main context.
* migration: use spice_session_abort_migration() on errorMarc-André Lureau2014-11-211-2/+2
| | | | Use a more complete method for the job
* migration: remove unnecessary referenceMarc-André Lureau2014-11-211-2/+1
|
* migration: create the migration session earlierMarc-André Lureau2014-11-211-8/+15
| | | | | | The migration session creation may fail. Instead of delaying the session creation to the main_connect() callback, do it directly from the message handler context, to report failure early to server.
* migration: improve debug logMarc-André Lureau2014-11-212-1/+4
|
* migration: remove migration cleanup from disposeMarc-André Lureau2014-11-211-15/+9
| | | | | | The spice_session_disconnect() method now calls spice_session_abort_migration(), so it is not necessary to do migration cleanups in dispose anymore
* migration: set connecting state before fd requestMarc-André Lureau2014-11-211-5/+8
| | | | | | | | | | | | | | | | | | | | | | During migration, the main channel coroutine initiating the process is waiting for connection completion of all channels. migrate_channel_event_cb() yields back to the main channel coroutine once all channels have completed connection, or it will abort migration for unexpected channel events, such as SPICE_CHANNEL_CLOSED If the migration is cancelled before connection completes, but the channels state are still in the SPICE_CHANNEL_STATE_UNCONNECTED state, no events will be emitted in channel_disconnect(), and the source session main channel will remain frozen waiting for migration completion or failure. Currently, for client-fd channels, the channel state remains UNCONNECTED until the fd is provided. But if cancellation occurs, no channel events are emitted and the source session is stuck. Before requesting the fd, set the channel state to connecting, so it will emit an error if disconnect happens, and it will finish cancelling the migration in source session main channel.
* migration: fail with client provided fdMarc-André Lureau2014-11-213-5/+18
| | | | | | | Currently the fd request is done on the migration session, which is not connected with the client session, so the client has no way to provide fd for the migration. And the original and migration session ends up stuck. Failing early seems the best for now.
* migration: set session migration during connectMarc-André Lureau2014-11-213-14/+13
| | | | | Track the migration session earlier, so that disconnecting before migration finished will abort and release it.
* migration: add "connecting" stateMarc-André Lureau2014-11-212-0/+3
| | | | | Add a new migration state to track early migration step, when migration session is connecting to destination
* migration: abort migrate on disconnectMarc-André Lureau2014-11-211-0/+5
| | | | | If the session has an ongoing migration, but it is disconnected, abort it.
* migration: add a few more pre-conditions in migration codeMarc-André Lureau2014-11-212-0/+5
| | | | | Those preconditions help to figure out several issues related to migration.
* usb: stop processing usb events on errorMarc-André Lureau2014-11-211-0/+1
| | | | | If libusb returned an error in the event loop, stop further event handling. This avoid spinning in an error loop in error cases.
* audio: use weak references to channelMarc-André Lureau2014-11-212-91/+57
| | | | | | | | | | The audio channels are currently referenced and released on channel close events. However, this event may not happen if the channel never was connected. Keeping channels alive also prevent session from finishing. By not holding the ref, the channel can go to dispose when it is no longer needed, and the session can be disposed too.
* Add missing finalize chainingMarc-André Lureau2014-11-213-0/+9
| | | | | | Finalize should chain up to the finalize method of the parent class. Trivial fix.
* Remove obsolete TODO itemMarc-André Lureau2014-11-211-1/+0
| | | | | | | Tunnel are long obsoleted (did they ever work) Remove it from TODO list. Pushed unreviewed as trivial
* usb-device: Expose libusb deviceFabiano Fidêncio2014-11-194-0/+27
| | | | | | | | | As we only can filter USB devices by their Classes and sometimes it is not enough (eg: I do not want to have Keyboard and Mouse, but I want to have Joysticks, being all of them part of HID Class), let's expose the libusb device associated to the SpiceUsbDevice, so the applications can have access to whatever information they need, directly from the libusb device, to refine their filters.
* Really fix SndCodec leaks in handle_{playback,record}_startChristophe Fergeau2014-11-192-3/+2
| | | | | | | The leak fix from commit 6729c341120f was actually not doing anything at all as it was setting c->codec to NULL before trying to free it. It was also not fixing the exact same leak in the record channel. This commit addresses these 2 issues.
* Recheck clipboard size after modifying its dataChristophe Fergeau2014-11-191-7/+23
| | | | | | | | | | | | | | SpiceGtkSession::clipboard_received_cb() starts by checking if the clipboard is empty, or if the length of its data exceeds 'max-clipboard-size'. Later in that function, the data is modified, and can be shortened (removal of trailing '\0' or of '\r' for Windows -> linux copy and paste), or enlarged (addition of '\r' for linux -> Windows c&p). This commit adds another check that the clipboard length is still valid (non-0, and not bigger than 'max-clipboard-size') after making these transformations.
* Fix empty clipboard checkChristophe Fergeau2014-11-191-4/+4
| | | | | | | | | | SpiceGtkSession::clipboard_received_cb starts by checking if the length of the X selection data is not 0. However, right after this check, if gtk_selection_data_get_length() returned -1, it decides it got an empty clipboard, sets the selection length to 0, and does not return early. This commit reworks the len == 0 / len == -1 checks to make sure we always return early when we get no data from the clipboard.
* Draw server-side pointer when the session has the grabMarc-André Lureau2014-11-042-4/+8
| | | | | | | | | | If there are several SpiceDisplay widgets, only one will have the grab, but the pointer may need to be drawn on another of the displays. We thus need to track the grab status on SpiceSession, not just per-display. This solves the following bug: https://bugs.freedesktop.org/show_bug.cgi?id=38024
* gtk-session: add pointer-grabbed propertyMarc-André Lureau2014-11-042-0/+40
| | | | Returns TRUE if the pointer is currently grabbed by this session.
* Add missing G_GNUC_INTERNALMarc-André Lureau2014-11-041-0/+1
| | | | Trivial fix