| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Make sure none of the SpiceSessionPrivate fields are accessed directly anymore
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Use session accessors to initialize the device manager.
Add missing session parameter check (public API).
|
|
|
|
| |
Use session accessors to initialize the webdav server
|
| |
|
|
|
|
|
| |
Avoid dereferencing session private data directly, and use accessors
instead.
|
| |
|
| |
|
| |
|
|
|
|
| |
The migration session is temporary and shouldn't interact with system.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
gst_parse_launch may return not NULL even when error is set.
This can lead to data loss when playing or recording audio.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ?? ()
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Use a more complete method for the job
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
The spice_session_disconnect() method now calls
spice_session_abort_migration(), so it is not necessary to do migration
cleanups in dispose anymore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Track the migration session earlier, so that disconnecting before
migration finished will abort and release it.
|
|
|
|
|
| |
Add a new migration state to track early migration step, when migration
session is connecting to destination
|
|
|
|
|
| |
If the session has an ongoing migration, but it is disconnected,
abort it.
|
|
|
|
|
| |
Those preconditions help to figure out several issues related to
migration.
|
|
|
|
|
| |
If libusb returned an error in the event loop, stop further event
handling. This avoid spinning in an error loop in error cases.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Finalize should chain up to the finalize method of the parent class.
Trivial fix.
|
|
|
|
|
|
|
| |
Tunnel are long obsoleted (did they ever work)
Remove it from TODO list.
Pushed unreviewed as trivial
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Returns TRUE if the pointer is currently grabbed by this session.
|
|
|
|
| |
Trivial fix
|