| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Yonit Halperin described the flow, that I followed:
(1) when client_migrate_info is called SPICE_MSG_MAIN_MIGRATE_BEGIN is
sent to the client.
Then, the client should link to the target server (SpiceLinkMess),
i.e., connect all the channels, but it shouldn't poll from the target,
only from the source. You can refer to RedClient::Migrate class. The
connection id in the link message should be the id of the connection
to the source server.
(2) The client sends to the source server
SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR)
(3) When migration completes SPICE_MSG_MAIN_MIGRATE_(END|CANCEL) is
sent to the client.
(3.1) In case of SPICE_MSG_MAIN_MIGRATE_CANCEL, the client closes the
connections to the target.
(3.2) In case of SPICE_MSG_MAIN_MIGRATE_END, the client should reset
all the data that is related to the connection to the source and
complete the transition to the target server (without sending
ATTACH_CHANNELS, and without guest display initialization via agent).
Then, the client sends SPICE_MSG_MAIN_MIGRATE_END to the target.
|
| |
|
| |
|
|
|
|
|
| |
This new private method is to reset the channel to its initial state,
used by semi-seamless migration
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
There are only 2 callers, both of which want it to do a different thing,
making the callers do this directly allows us to remove
spice_channel_send_msg(); and gets rid of the weirdness where we've a
function which can be called in both co-routine and system context.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This is a preparation patch for removing spice_channel_send_msg().
Note that this means that buffered writes won't get checked until they are
actually send by the co-routine.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
| |
Just a small cleanup patch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This has a number of advantages:
-It significantly simplifies the code
-It avoids memcpy-ing all the write data one more time
-It avoids malloc / realloc / free of the xmit buffer
(this gets replaced by gslice alloc / free for the queue elements)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes 1 line, and fixes 2 bugs in this one line:
1) We keep the xmit_buffer around for reuse (re-filling) later, so checking
if we've a xmit_buffer to determine wether we should do a write is wrong,
instead we should check if the xmit_buffer has data in it.
2) If the write blocks, and we switch to another co-routine context, this
context may queue more writes, we check for this and throw away the
buffer we've been consuming when this happens, since the other context
will then have allocated a new buffer. But when this happens, we do *not*
consume the new buffer. So the queued data will not get transmitted
until the co-routine gets woken up by either another write, or by
receiving data to read.
This patch fixes this by changing the if to a while.
Note that the code in question gets completely removed by the next patch in
this series. As I noticed this while rewriting the code in question, still
I decided to do a separate patch to fix this to:
1) Document this issue in the old code
2) Otherwise the move from the if to the while will happen in the new code
which may confuse readers of that patch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All callers of spice_msg_out[_send_internal] unref the message immediately
after calling spice_msg_out[_send_internal]. This patch changes the
semantics so that spice_msg_out[_send_internal] takes ownership and it
is responsible for unref-ing the passed in SpiceMsgOut.
This is a preparation patch for changing the buffered write code
to use a queue of SpiceMsgOut-s, rather then memcpy the message contents
into an intermediate buffer.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
| |
This is a preparation patch for making spice_msg_out_send() take ownership
of the passed in msg.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
| |
smartcard_message_complete_in_flight should never get called if there
is no message in flight (priv->in_flight_message != NULL).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
| |
The private wait_interruptible channel variable is not used anywhere,
except in one test, which is useless since it never gets set.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
| |
Otherwise accel will be applied twice, once by the client and then once
more by the guest. Unfortunately there seems to be no gdk / gtk API for this
so this patch uses direct libX11 calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
| |
On Windows, the received key when pressing left shift is VK_SHIFT 0x10
|
| |
|
| |
|
|
|
|
|
|
| |
With gtk3 gdk_cursor_unref = g_object_unref. But not with older
version. Let's be consitent with the rest of the code and use
cursor_unref().
|
|
|
|
| |
Probably broken since the manually edited defs files have been removed
|
|
|
|
|
|
|
|
|
| |
We already have update_mouse_pointer and update_mouse_grab, so having
a mouse_update function without specifying what "part" of the mouse handling
it exactly updates is confusing, rename it to update_mouse_mode to reflect
what it does and to match the other names.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some background on this patch, we currently behave
as follows in server mouse mode:
1) When spicy first connects, a frozen guest cursor is shown
(no mouse events are send to the guest) and the client cursor
is set to the standard right pointer,
2) When one clicks on / inside the spice-widget, the mouse is
grabbed, the client cursor is hidden and the guest pointer
becomes alive (gets events).
3) On ungrab we move back to state 1)
Which is fine, but the code implementing it is somewhat convoluted.
We have update_mouse_pointer(), which does more then just update the mouse
pointer, it also calls try_mouse_grab(), and we've update_mouse_grab(),
which calls update_mouse_pointer() rather then try_mouse_grab().
* I. lets look at what we currently have in update_mouse_pointer(): *
case SPICE_MOUSE_MODE_SERVER:
if (!d->mouse_grab_active) {
if (gdk_window_get_cursor(window) != NULL)
gdk_window_set_cursor(window, NULL);
} else {
try_mouse_grab(display);
}
break;
Now lets invert the test to make it more readable:
case SPICE_MOUSE_MODE_SERVER:
if (d->mouse_grab_active) {
try_mouse_grab(display);
} else {
if (gdk_window_get_cursor(window) != NULL)
gdk_window_set_cursor(window, NULL);
}
break;
Hmm, so if we're grabbing the mouse, we try to grab the mouse
-> does not make sense, esp not since try_mouse_grab() has:
if (d->mouse_grab_active)
return;
So we can drop the else block.
But why the if? Well that would be because when we're grabbing
the windows should have a blank cursor. But where does that get set?
The blank cursor gets set in do_pointer_grab(), by specifying a blank
cursor as the cursor to show as long as the grab is active.
Since that cursor will be active as long as we're grabbing, so we can
drop the if (!d->mouse_grab_active) check as well.
And with the mouse_grab_active check gone, we no longer need to call
update_mouse_pointer() from try_mouse_ungrab().
* II. lets look at update_mouse_grab() *
So currently when the mouse should be grabbed according to the
mouse-grab and disable-inputs properties, update_mouse_grab() calls
update_mouse_pointer(), which as discussed above does nothing with the grab,
as the code path calling try_mouse_grab() is dead code. The right thing to do
would of course be to have update_mouse_grab() call try_mouse_grab() in this
case.
But, that would mean that as soon as the property is changed the cursor will
get torn away from whereever it is and get grabbed, which may not always
be desirable. To fix this this patch also moves the mouse_have_pointer
and keyboard_have_focus checks from mouse_update() to try_mouse_grab()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
foo
|
|
|
|
|
|
| |
Patch based on Mageia, provided by Olav Vitters.
https://bugzilla.freedesktop.org/show_bug.cgi?id=43457
|
| |
|
|
|
|
| |
Only when the widget has the focus and the pointer is over the widget
|
| |
|
| |
|
|
|
|
| |
This fixes the dynamic mode changing when running/quitting the agent.
|
|
|
|
|
|
|
|
|
| |
The hide cursor event happen when the widget is not yet
realized. Forcing realize may fail if the widget is not yet embedded
for example. Instead, let's update the cursor whenever there is a
draw().
v2: do not call gdk_window_set_cursor() with the same cursor
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Without this additional grab, the pointer grab was effective for the
whole application
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Mageia is using linker flags and miss symbols when linking.
The error can be reproduced with:
make LDFLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags"
Based on patch by Christophe Fergeau.
https://bugs.freedesktop.org/show_bug.cgi?id=43416
|
|
|
|
|
|
|
|
|
| |
We already emit a signal for this, either the app using spice-client-glib
listens to this signals and does something with it, or it is not interested
in this happening, at which point logging a g_warning for it is not really
useful.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If for example the user plugs in a new device, then gets the policykit agent
authentication dialog and then unplugs the device, spice-gtk will cancel
the acl-helper request, which in turn will dismiss the policykit agent
authentication dialog. Which is all a nice and smooth user experience,
except that when this happens spicy throws a dialog with an error
that the open was cancelled. Since a cancel usually is done deliberately
(such as on the user unpluging the device) no error dialog should be thrown
for it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally opening the USB device without first calling the helper will fail,
except when the process using spice-gtk is running as root.
So the current code which first tries to open the USB device before calling
the helper is optimizing for an exception rather then for the default code
path. More over it also causes libusb to print the following errors to stderr:
libusb:error [op_open] libusb couldn't open USB device /dev/bus/usb/002/017: Permission denied.
libusb:error [op_open] libusb requires write access to USB device nodes.
So this patch changes things to first call the helper and only then try
to open the device node.
This patch also modifies the helper to not call policykit when called by
a root process, since the set_facl which it will do, if policykit says it
is ok, is a no-op for root anyways. Instead it directly returns a success
status without doing anything when called by a root process.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
| |
Patch based on Mageia, provided by Olav Vitters.
https://bugs.freedesktop.org/show_bug.cgi?id=43456
|