If we don't clear the glz dictionnary, this might lead to
corrupted/invalid dictionnary and invalid memory allocation due
unbounded increase of dictionnary size
cursor_set() didn't un-hide correctly by setting "show_cursor" to
NULL.
The code is simplified a bit in server mode case, where the new cursor
will be invalidated and shown during cursor move only, instead of
twice (checked no regression with dual-head server mode)
First notify about disconnection before resetting the channel data.
An audio recording task might expect the channel to be in a ready
state otherwise, for example.
https://bugzilla.redhat.com/show_bug.cgi?id=810247
Instead of allocating unbounded memory and doing extra copy on the
stack, let's just improve our helper function to send messages in
various pieces.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=809145
People using autogen.sh are likely to be building from git, so may
get updates to vala files at any time. Checking for the presence of
controller.vala.stamp to decide whether vala should be enabled or not
is not very accurate since it doesn't reflect if a .vala file needs
to be regenerated or not.
It's better to always pass --enable-vala to configure, it's always
possible to disable it by using --disable-vala as an autogen.sh argument.
Before this patch we were assuming that the GdkEventMotion value we receive
are always whole (integer) numbers, which is not the case with GTK-3.0.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Often (when not resized by the user) even though scaling is enabled, we are
not actually scaling. In this case it is not necessary to scale the
mouse coordinates, and sometimes it is even harmful.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This fixes the pointer being "trapped" in the center of the screen in
server-side mouse mode. It also correctly inform the client that the
pointer/keyboard is no longer grabbed so it can adjust its UI state
accordingly (remote the "press ctrl+alt to ungrab" messages etc).
I can reproduce only with RHEVM22 host, and a RHEL6 guest, when
switching consoles.
When the display channel is destroyed, we disconnect all signals
handlers, but we don't remove the reference on the primary surface
data, and that can lead to crashes in a later expose event, reusing
the canvas surface (ex, if scaling is disabled). Call
primary_destroy() when disconnecting the channel from the widget.
We now keep the primary surface during channel reset (right after
disconnect for example), so the primary surface can be eventually
recycled, and the widget still holds a valid reference until the
signal is received. The primary surface is ultimately destroyed during
finalize, or if the new primary surface size doesn't match.
Program received signal SIGSEGV, Segmentation fault.
__memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2130
2130 lddqu -68(%rsi), %xmm0
Missing separate debuginfos, use: debuginfo-install gtk2-engines-2.20.2-2.fc15.x86_64 libusb1-1.0.9-0.3.rc1.fc16.x86_64 p11-kit-0.6-1.fc16.x86_64
(gdb) bt
at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2130
srclen=<optimized out>, srcinc=4096, destinc=68, height=<optimized out>,
half_order=0) at /usr/include/bits/string3.h:52
dest_bits_per_pixel=32, req_yoffset=<optimized out>, req_xoffset=0,
image=0x7fffffffb9a0, req=<optimized out>, dpy=0x64a630) at PutImage.c:821
req_height=<optimized out>, req_width=<optimized out>, y=<optimized out>,
x=0, req_yoffset=<optimized out>, req_xoffset=0, image=0x7fffffffb9a0,
gc=0xa817e0, d=33554452, dpy=0x64a630) at PutImage.c:870
req_xoffset=0, req_yoffset=<optimized out>, x=0, y=26, req_width=17,
req_height=20, dest_bits_per_pixel=32, dest_scanline_pad=32)
at PutImage.c:908
image=0x7fffffffb9a0, req_xoffset=0, req_yoffset=0, x=0, y=26,
req_width=17, req_height=20) at PutImage.c:1027
image=<optimized out>, src_x=0, src_y=0, width=17, height=20, dst_x=0,
dst_y=26) at cairo-xlib-surface.c:1357
---Type <return> to continue, or q <return> to quit---c
height=20, width=17, dst_y=26, dst_x=0, src_y=<optimized out>,
src_x=<optimized out>, pattern=0x7fffffffc6b0, op=CAIRO_OPERATOR_OVER,
surface=0xb9a650) at cairo-xlib-surface.c:2403
dst_y=26, dst_x=0, mask_y=0, mask_x=0, src_y=26, src_x=0,
abstract_dst=0xb9a650, mask_pattern=0x0, src_pattern=0x7fffffffc6b0,
op=CAIRO_OPERATOR_OVER) at cairo-xlib-surface.c:2452
src_pattern=0x7fffffffc6b0, mask_pattern=0x0, abstract_dst=0xb9a650,
src_x=0, src_y=26, mask_x=0, mask_y=0, dst_x=0, dst_y=26, width=17,
height=20, clip_region=0x0) at cairo-xlib-surface.c:2415
src=0x7fffffffc6b0, mask=0x0, dst=0xb9a650, src_x=0, src_y=26, mask_x=0,
mask_y=0, dst_x=0, dst_y=26, width=17, height=20, clip_region=0x0)
at cairo-surface.c:1802
traps=0x7fffffffbee0, src=0x7fffffffc6b0, op=CAIRO_OPERATOR_OVER,
dst=0xb9a650) at cairo-surface-fallback.c:762
op=CAIRO_OPERATOR_OVER, dst=0xb9a650, traps=0x7fffffffbee0,
antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0x0, extents=0x7fffffffc600)
at cairo-surface-fallback.c:812
---Type <return> to continue, or q <return> to quit---bt
op=CAIRO_OPERATOR_OVER, source=0x7fffffffc6b0, clip=0x0)
at cairo-surface-fallback.c:935
source=0x7fffffffc6b0, op=CAIRO_OPERATOR_OVER, surface=0xb9a650)
at cairo-surface.c:2027
source=0x7fffffffc6b0, clip=0x7fffffffc7b0) at cairo-surface.c:1993
at cairo-gstate.c:1049
at spice-widget-cairo.c:104
expose=0x7fffffffceb0) at spice-widget-cairo.c:133
expose=0x7fffffffceb0) at spice-widget.c:885
return_value=0x7fffffffca60, n_param_values=<optimized out>,
param_values=0x7fffffffcad0, invocation_hint=<optimized out>,
marshal_data=<optimized out>) at gtkmarshalers.c:86
return_value=0x7fffffffca60, n_param_values=2,
param_values=0x7fffffffcad0, invocation_hint=<optimized out>)
---Type <return> to continue, or q <return> to quit---c
at gclosure.c:777
detail=0, instance=<optimized out>, emission_return=0x7fffffffccb0,
instance_and_params=0x7fffffffcad0) at gsignal.c:3584
signal_id=<optimized out>, detail=0, var_args=<optimized out>)
at gsignal.c:3305
signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3351
event=0x7fffffffceb0) at gtkwidget.c:4999
Since the gnome HIG-ifying of usb-device-widget.c, the vbox contains
alignments, which in turn contain a toggle_button, so calling
gtk_toggle_button_set_active directly on the vbox-containers childdren is
wrong.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
With this iteration, all the spice_codegen.py/proto/marshaller
generation has been moved to spice-common.
The spice-common directory will ship spice-protocol, since it's needed
there too to build libspice-common.
Again, make distcheck passes. Build with mingw & fedora linux.
The following seems to happen:
- cursor-hide (for all cursor/display channels)
- cursor-set (for all cursor/display channels)
All cursor/display channels receive cursor-set events when the cursor
is changed, however, only current display cursor should be drawn in
server-mode. How to know which display?
So it will wait until cursor-move to draw it in server-mode on the
right display.
In the case of client-mode cursor, it doesn't matter since it will
depend on which client display the pointer is, so it can be changed
immediately.
Hide symbol from API to fix pygobject.
Also vapigen chokes on "record" typename
SpiceClientGtk-3.0.gir:32.55-32.55: error: The type name `Gtk.BoxClass' could not be found <type name="Gtk.BoxClass" c:type="GtkBoxClass"/>
This seems to be a bug in symbol lookup in vapigen. Using a struct
typedef solves it.
When the cursor shape is changed, all the cursor channels are
updated. The current code assumed that the "set" of the shape should
show the cursor, but it should stay hidden instead.
Also, when the cursor is hidden, we must invalidate its current
region to redraw display.
Fix: https://bugzilla.redhat.com/show_bug.cgi?id=804308
We used to gtk_grab_add() after mouse grab to limit the mouse events
to the display. But it isn't necessary if the display has its own
window, since gdk_pointer_grab() will be limited to it.
Note the widget has the keyboard focus & is focused, so this doesn't
affect keyboard events.
However, this allows application to keep global accelerators
functionning if they want to (like virt-viewer with custom key
bindings).
The windows are destroyed during non-semi-seamless migrations, but the
gtk session and connected handlers remains. When a property changes
again on it, it will signal a destroyed window and lead to a crash.
The signal handler should be disconnected when the window is
destroyed. Since we have N numbers of handlers, it's easier to use
spice_signal_connect_object() helper to handle this for us by turning
spice_window structure into a basic GObject.
That GObject code could be improved, but that wasn't the goal of this
patch.
The main channel only relied on
VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH to set color depth when
connecting to a guest. However, that doesn't seem to be
enough. Instead send given color depth with monitor configuration.
Fix --spice-color-depth option not "apparently" working.
It used to be below, then was moved on top of all, but now it's
defined in config.h. Hopefully below config.h is the right
place. config.h should never have direct includes anyway.
Mostly so that they don't turn into errors when building from source:
-Wno-missing-field-initializers:
Because this has to be close to the most stupid warning gcc has ever produced
-Wno-deprecated-declarations
Because we use some deprecated functions to avoid #ifdef hell while maintaining
compat with older gtk / glib versions
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Currently trying to view a usbredir enabled vm from virt-manager causes
virt-manager to crash. This crash is caused by the following happening:
-virt-manager sets up the session, including connecting all the channels
-a spice-gtk internal code path calls spice_usb_device_manager_get()
-spice_usb_device_manager_get calls channel_new on all already connected
usb channels
-channel_new does:
spice_usbredir_channel_set_context(SPICE_USBREDIR_CHANNEL(channel),
self->priv->context);
-But self->priv->context has not been set yet (so is NULL) -> segfault!
This patch fixes this by moving the iterating over already connected
usb channels to after the setting of self->priv->context. Note this means
that the channels will no longer get checked when there is no USB_REDIR
support. That is not a problem since spice_usb_device_manager_initable_init
will return FALSE in that case anyways.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/usr/i686-w64-mingw32/sys-root/mingw/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
The code generator for the python binding generates code which
throws away const-ness on strings. Disable the -Wwrite-strings
warning to avoid failing on this auto-generated code.