[Spice-devel] [PATCH] [spice-gtk] keyboard: wrong defined macro for WIN32
On windows client, there's no effect for guest when enabling CAPS_LOCK/NUM_LOCK/SCROLL_LOCK on (because of the delay, guest may take the effect for several seconds). There's a wrong defined macro, then modifiers is ALWAYS 0, and the keyboard state of guest is synchronized with the state client by spice_gtk_session_sync_keyboard_modifiers_for_channel(...). --- gtk/spice-gtk-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c index db5c53c..1905a25 100644 --- a/gtk/spice-gtk-session.c +++ b/gtk/spice-gtk-session.c @@ -140,7 +140,7 @@ static guint32 get_keyboard_lock_modifiers(void) if (keyboard_state.led_mask 0x04) { modifiers |= SPICE_INPUTS_SCROLL_LOCK; } -#elif defined(win32) +#elif defined(WIN32) if (GetKeyState(VK_CAPITAL) 1) { modifiers |= SPICE_INPUTS_CAPS_LOCK; } -- 1.9.3 -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [spice-gtk] keyboard: wrong defined macro for WIN32
Hi - Original Message - On windows client, there's no effect for guest when enabling CAPS_LOCK/NUM_LOCK/SCROLL_LOCK on (because of the delay, guest may take the effect for several seconds). There's a wrong defined macro, then modifiers is ALWAYS 0, and the keyboard state of guest is synchronized with the state client by spice_gtk_session_sync_keyboard_modifiers_for_channel(...). This is a recent regression since v0.25-1-g9c75c7e (not yet released) Thanks for finding out! ack ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [spice-gtk] keyboard: wrong defined macro for WIN32
Yeah, I have tracked the commit log, and the reconstruction of this part is a good job of Jonathon ^_^ On Wed, Aug 13, 2014 at 4:57 PM, Marc-André Lureau mlur...@redhat.com wrote: Hi - Original Message - On windows client, there's no effect for guest when enabling CAPS_LOCK/NUM_LOCK/SCROLL_LOCK on (because of the delay, guest may take the effect for several seconds). There's a wrong defined macro, then modifiers is ALWAYS 0, and the keyboard state of guest is synchronized with the state client by spice_gtk_session_sync_keyboard_modifiers_for_channel(...). This is a recent regression since v0.25-1-g9c75c7e (not yet released) Thanks for finding out! ack -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH v2 1/2] Ensure keyboard modifiers are synchronized properly
Hi, I just noticed spice_gtk_session_sync_keyboard_modifiers() is not actually exported, and not documented etc. Imho, it's not really helping to put in public API, I would rather move declaration to spice-gtk-session-priv.h. What do you think? On Thu, Apr 3, 2014 at 12:38 AM, Marc-André Lureau mlur...@redhat.com wrote: looks good, ack - Original Message - In certain circumstances, the keyboard modifiers get out-of-sync between the guest and the client. This is easy to reproduce with the following steps: - launch virt-viewer with a guest that is not running - start the guest - while guest is booting, enable CAPS LOCK on the client - after guest finishes booting, it will set its modifiers to a default value (e.g. numlock on, capslock off) - now capslock is OFF in the guest, but ON in the client - toggle caps lock - now capslock is ON in the guest, but OFF in the client This moves the responsibility for synchronizing client and guest modifiers into SpiceGtkSession. It can't be handled easily within the SpiceDisplay widget since there can be multiple display widgets for each inputs channel. A new function (spice_gtk_session_sync_keyboard_modifiers()) was added so that synchronization can be triggered manually if desired. But it also registers a signal handler for the InputsChannel::inputs-modifiers signal to detect when the guest has changed its modifiers. The signal handler simply overrides the guests modifiers and sets them back to the value from the client. --- gtk/spice-gtk-session.c | 97 + gtk/spice-gtk-session.h | 1 + gtk/spice-widget.c | 91 +- 3 files changed, 100 insertions(+), 89 deletions(-) diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c index a9ce025..f0f7edf 100644 --- a/gtk/spice-gtk-session.c +++ b/gtk/spice-gtk-session.c @@ -17,6 +17,22 @@ */ #include config.h +#if HAVE_X11_XKBLIB_H +#include X11/XKBlib.h +#include gdk/gdkx.h +#endif +#ifdef GDK_WINDOWING_X11 +#include X11/Xlib.h +#include gdk/gdkx.h +#endif +#ifdef WIN32 +#include windows.h +#include gdk/gdkwin32.h +#ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */ +#define MAPVK_VK_TO_VSC 0 +#endif +#endif + #include gtk/gtk.h #include spice/vd_agent.h #include desktop-integration.h @@ -97,6 +113,70 @@ enum { PROP_AUTO_USBREDIR, }; +static guint32 get_keyboard_lock_modifiers(void) +{ +guint32 modifiers = 0; +#if HAVE_X11_XKBLIB_H +Display *x_display = NULL; +XKeyboardState keyboard_state; + +GdkScreen *screen = gdk_screen_get_default(); +if (!GDK_IS_X11_DISPLAY(gdk_screen_get_display(screen))) { +SPICE_DEBUG(FIXME: gtk backend is not X11); +return 0; +} + +x_display = GDK_SCREEN_XDISPLAY(screen); +XGetKeyboardControl(x_display, keyboard_state); + +if (keyboard_state.led_mask 0x01) { +modifiers |= SPICE_INPUTS_CAPS_LOCK; +} +if (keyboard_state.led_mask 0x02) { +modifiers |= SPICE_INPUTS_NUM_LOCK; +} +if (keyboard_state.led_mask 0x04) { +modifiers |= SPICE_INPUTS_SCROLL_LOCK; +} +#elif defined(win32) +if (GetKeyState(VK_CAPITAL) 1) { +modifiers |= SPICE_INPUTS_CAPS_LOCK; +} +if (GetKeyState(VK_NUMLOCK) 1) { +modifiers |= SPICE_INPUTS_NUM_LOCK; +} +if (GetKeyState(VK_SCROLL) 1) { +modifiers |= SPICE_INPUTS_SCROLL_LOCK; +} +#else +g_warning(get_keyboard_lock_modifiers not implemented); +#endif // HAVE_X11_XKBLIB_H +return modifiers; +} + +static void spice_gtk_session_sync_keyboard_modifiers_for_channel(SpiceGtkSession *self, + SpiceInputsChannel* inputs) +{ +gint guest_modifiers = 0, client_modifiers = 0; + +g_return_if_fail(SPICE_IS_INPUTS_CHANNEL(inputs)); + +g_object_get(inputs, key-modifiers, guest_modifiers, NULL); + +client_modifiers = get_keyboard_lock_modifiers(); +g_debug(%s: input:%p client_modifiers:0x%x, guest_modifiers:0x%x, +G_STRFUNC, inputs, client_modifiers, guest_modifiers); + +if (client_modifiers != guest_modifiers) +spice_inputs_set_key_locks(inputs, client_modifiers); +} + +static void guest_modifiers_changed(SpiceInputsChannel *inputs, gpointer data) +{ +SpiceGtkSession *self = data; +spice_gtk_session_sync_keyboard_modifiers_for_channel(self, inputs); +} + static void spice_gtk_session_init(SpiceGtkSession *self) { SpiceGtkSessionPrivate *s; @@ -872,6 +952,11 @@ static void channel_new(SpiceSession *session, SpiceChannel *channel, g_signal_connect(channel, main-clipboard-selection-release, G_CALLBACK(clipboard_release),
[Spice-devel] spice with qxl on xen linux domU's, probably problem with sse2 instrutions and/or other unknow things
For 2 years or more I'm trying to get spice full features fully working with xen but I found a qxl problem with linux domUs that I'm unable to debug. With the last tests I was able to see a backtrace in the xorg log (though perhaps not track the direct cause) and a different behavior with a patch regarding the emulation of some cpu instructions. In attachment there are lspci output of debian Sid domU and Xorg log. I did a minimal installation with xorg and flubox and launched manually it with startx (.xinit have: systemd --user exec startfluxbox) Same problem with xorg that use 100% cpu and black screen on spice client also on other tests I did in past with fedora ubuntu and debian domUs using DE of default install (mainly gnome). After this xen patch domU crash and seems I'm unable to take a backtrace or useful data about: http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=3af450fd2d9403f208d3ac6459716f027b8597ad My tentative of take a backtrace gave this output: gdbsx -a 2 64 ... (gdb) target remote localhost: Remote debugging using localhost: [Switching to Remote target] 0x in ?? () (gdb) c Continuing. Program received signal SIGINT, Interrupt. 0x00ff in ?? () (gdb) bt full #0 0x00ff in ?? () No symbol table info available. Cannot access memory at address 0x6d2966c0 *Someone can tell me how to debug this problem (xorg loop with qxl driver in use and/or xen domU's crash) for take all needed informations to solves it please?* Thanks for any reply and sorry for my bad english. [ 1225.726] X.Org X Server 1.16.0 Release Date: 2014-07-16 [ 1225.731] X Protocol Version 11, Revision 0 [ 1225.733] Build Operating System: Linux 3.14-1-amd64 x86_64 Debian [ 1225.735] Current Operating System: Linux sidtest 3.14-2-amd64 #1 SMP Debian 3.14.15-2 (2014-08-09) x86_64 [ 1225.736] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.14-2-amd64 root=UUID=d534f862-1227-4151-bbf0-435085decdd1 ro console=tty0 quiet [ 1225.742] Build Date: 17 July 2014 10:22:36PM [ 1225.744] xorg-server 2:1.16.0-1 (http://www.debian.org/support) [ 1225.750] Current version of pixman: 0.32.6 [ 1225.756]Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. [ 1225.757] Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 1225.776] (==) Log file: /var/log/Xorg.0.log, Time: Wed Aug 13 14:31:31 2014 [ 1225.784] (==) Using system config directory /usr/share/X11/xorg.conf.d [ 1225.786] (==) No Layout section. Using the first Screen section. [ 1225.786] (==) No screen section available. Using defaults. [ 1225.786] (**) |--Screen Default Screen Section (0) [ 1225.786] (**) | |--Monitor default monitor [ 1225.786] (==) No monitor specified for screen Default Screen Section. Using a default monitor configuration. [ 1225.786] (==) Automatically adding devices [ 1225.786] (==) Automatically enabling devices [ 1225.786] (==) Automatically adding GPU devices [ 1225.789] (WW) The directory /usr/share/fonts/X11/cyrillic does not exist. [ 1225.789]Entry deleted from font path. [ 1225.791] (==) FontPath set to: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/75dpi/:unscaled, /usr/share/fonts/X11/Type1, /usr/share/fonts/X11/100dpi, /usr/share/fonts/X11/75dpi, built-ins [ 1225.791] (==) ModulePath set to /usr/lib/xorg/modules [ 1225.791] (II) The server relies on udev to provide the list of input devices. If no devices become available, reconfigure udev or disable AutoAddDevices. [ 1225.791] (II) Loader magic: 0x7f78e82b5d80 [ 1225.791] (II) Module ABI versions: [ 1225.791]X.Org ANSI C Emulation: 0.4 [ 1225.791]X.Org Video Driver: 18.0 [ 1225.791]X.Org XInput driver : 21.0 [ 1225.791]X.Org Server Extension : 8.0 [ 1225.806] (--) PCI:*(0:0:4:0) 1b36:0100:1af4:1100 rev 4, Mem @ 0xf000/67108864, 0xf400/67108864, 0xf905/8192, I/O @ 0xc220/32, BIOS @ 0x/65536 [ 1225.807] (II) LoadModule: glx [ 1225.807] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so [ 1225.885] (II) Module glx: vendor=X.Org Foundation [ 1225.885]compiled for 1.16.0, module version = 1.0.0 [ 1225.885]ABI class: X.Org Server Extension, version 8.0 [ 1225.885] (==) AIGLX enabled [ 1225.885] (==) Matched qxl as autoconfigured driver 0 [ 1225.885] (==) Matched modesetting as autoconfigured driver 1 [ 1225.885] (==) Matched fbdev as autoconfigured driver 2 [ 1225.885] (==) Matched vesa as autoconfigured driver 3 [ 1225.885] (==) Assigned the driver to the xf86ConfigLayout [ 1225.885] (II) LoadModule: qxl [ 1225.885] (II) Loading /usr/lib/xorg/modules/drivers/qxl_drv.so [ 1225.886] (II) Module qxl: vendor=X.Org Foundation [
[Spice-devel] [spice-gtk] Use G_OS_WIN32 #define everywhere
Currently some parts of the windows specific code is checking for the WIN32 define, and other parts are checking G_OS_WIN32. This commit uses G_OS_WIN32 everywhere for consistency. --- gtk/channel-display.c | 8 gtk/decode-jpeg.c | 2 +- gtk/spice-gtk-session.c | 6 -- gtk/spice-widget.c | 27 ++- gtk/spicy.c | 20 ++-- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 20dfe55..1e1312c 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -81,7 +81,7 @@ struct _SpiceDisplayChannelPrivate { GArray *monitors; guint monitors_max; gbooleanenable_adaptive_streaming; -#ifdef WIN32 +#ifdef G_OS_WIN32 HDC dc; #endif }; @@ -575,7 +575,7 @@ static SpiceImageSurfacesOps image_surfaces_ops = { .get = surfaces_get }; -#if defined(WIN32) +#if defined(G_OS_WIN32) static HDC create_compatible_dc(void) { HDC dc = CreateCompatibleDC(NULL); @@ -615,7 +615,7 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel) c-image_cache.ops = image_cache_ops; c-palette_cache.ops = palette_cache_ops; c-image_surfaces.ops = image_surfaces_ops; -#if defined(WIN32) +#if defined(G_OS_WIN32) c-dc = create_compatible_dc(); #endif c-monitors_max = 1; @@ -1143,7 +1143,7 @@ static gboolean display_stream_render(display_stream *st) st-surface-canvas-ops-put_image( st-surface-canvas, -#ifdef WIN32 +#ifdef G_OS_WIN32 SPICE_DISPLAY_CHANNEL(st-channel)-priv-dc, #endif dest, data, diff --git a/gtk/decode-jpeg.c b/gtk/decode-jpeg.c index db54a31..697d0de 100644 --- a/gtk/decode-jpeg.c +++ b/gtk/decode-jpeg.c @@ -19,7 +19,7 @@ #include decode.h -#ifdef WIN32 +#ifdef G_OS_WIN32 /* We need some hacks to avoid warnings from the jpeg headers, ex: */ /* #define HAVE_BOOLEAN */ #define XMD_H diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c index abd39c7..8dd05f4 100644 --- a/gtk/spice-gtk-session.c +++ b/gtk/spice-gtk-session.c @@ -17,6 +17,8 @@ */ #include config.h +#include glib.h + #if HAVE_X11_XKBLIB_H #include X11/XKBlib.h #include gdk/gdkx.h @@ -25,7 +27,7 @@ #include X11/Xlib.h #include gdk/gdkx.h #endif -#ifdef WIN32 +#ifdef G_OS_WIN32 #include windows.h #include gdk/gdkwin32.h #ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */ @@ -140,7 +142,7 @@ static guint32 get_keyboard_lock_modifiers(void) if (keyboard_state.led_mask 0x04) { modifiers |= SPICE_INPUTS_SCROLL_LOCK; } -#elif defined(WIN32) +#elif defined(G_OS_WIN32) if (GetKeyState(VK_CAPITAL) 1) { modifiers |= SPICE_INPUTS_CAPS_LOCK; } diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index b6bb0a9..1220030 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -18,6 +18,7 @@ #include config.h #include math.h +#include glib.h #if HAVE_X11_XKBLIB_H #include X11/XKBlib.h @@ -27,7 +28,7 @@ #include X11/Xlib.h #include gdk/gdkx.h #endif -#ifdef WIN32 +#ifdef G_OS_WIN32 #include windows.h #include gdk/gdkwin32.h #ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */ @@ -99,7 +100,7 @@ enum { static guint signals[SPICE_DISPLAY_LAST_SIGNAL]; -#ifdef WIN32 +#ifdef G_OS_WIN32 static HWND win32_window = NULL; #endif @@ -639,7 +640,7 @@ void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq) d-activeseq = g_new0(gboolean, d-grabseq-nkeysyms); } -#ifdef WIN32 +#ifdef G_OS_WIN32 static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM lparam) { if (win32_window code == HC_ACTION wparam != WM_KEYUP) { @@ -721,7 +722,7 @@ static void try_keyboard_grab(SpiceDisplay *display) SPICE_DEBUG(grab keyboard); gtk_widget_grab_focus(widget); -#ifdef WIN32 +#ifdef G_OS_WIN32 if (d-keyboard_hook == NULL) d-keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_hook_cb, GetModuleHandle(NULL), 0); @@ -748,7 +749,7 @@ static void try_keyboard_ungrab(SpiceDisplay *display) SPICE_DEBUG(ungrab keyboard); gdk_keyboard_ungrab(GDK_CURRENT_TIME); -#ifdef WIN32 +#ifdef G_OS_WIN32 if (d-keyboard_hook != NULL) { UnhookWindowsHookEx(d-keyboard_hook); d-keyboard_hook = NULL; @@ -811,7 +812,7 @@ static void set_mouse_accel(SpiceDisplay *display, gboolean enabled) #endif } -#ifdef WIN32 +#ifdef G_OS_WIN32 static gboolean win32_clip_cursor(void) { RECT window, workarea, rect; @@ -865,7 +866,7 @@ static GdkGrabStatus do_pointer_grab(SpiceDisplay *display) if (!gtk_widget_get_realized(GTK_WIDGET(display))) goto end; -#ifdef WIN32 +#ifdef G_OS_WIN32 if (!win32_clip_cursor()) goto end; #endif @@ -961,7 +962,7 @@ static void
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters in name
On Tue, Aug 12, 2014 at 06:52:00PM +0800, Cody Chan wrote: I submitted a patch several months ago about this issue, here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html I check it again, and find that the value of g_key_file_to_data(keyfile,...) is always utf-8, for the value of g_uri_list_extract_uris() is utf8 urlencode. So the display problem is caused by vd_agent, but how it displays depends on the language of system, the following two screenshots show the difference: http://int64ago-tmp.qiniudn.com/guest-Chinese.png http://int64ago-tmp.qiniudn.com/guest-English.png --- vdagent/file_xfer.cpp | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vdagent/file_xfer.cpp b/vdagent/file_xfer.cpp index e402eb2..96b7394 100644 --- a/vdagent/file_xfer.cpp +++ b/vdagent/file_xfer.cpp @@ -46,6 +46,7 @@ void FileXfer::handle_start(VDAgentFileXferStartMessage* start, uint64_t file_size; HANDLE handle; AsUser as_user; +int wlen; status-id = start-id; status-result = VD_AGENT_FILE_XFER_STATUS_ERROR; @@ -81,7 +82,20 @@ void FileXfer::handle_start(VDAgentFileXferStartMessage* start, strcat(file_path, \\); strcat(file_path, file_name); -handle = CreateFileA(file_path, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL); +if((wlen = MultiByteToWideChar(CP_UTF8, 0, file_path, -1, NULL, 0)) == 0){ +vd_printf(failed getting WideChar length of %s, file_path); +return; +} +TCHAR *wfile_path = new TCHAR[wlen]; +if (MultiByteToWideChar(CP_UTF8, 0, file_path, -1, wfile_path, wlen) == 0){ +vd_printf(failed converting file_path:%s to WindChar, file_path); +if (wfile_path) +delete[] wfile_path; delete[] NULL; is a noop so the explicit check for wfile__path is not needed. I'll fix this before pushing this patch. ACK :) Thanks! Christophe pgpYV8sohYi8M.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH] spice_gtk_session_sync_keyboard_modifiers() is internal
This function was not exported, and it's not really useful as public API, so move the declaration to the private header. --- gtk/spice-gtk-session-priv.h | 1 + gtk/spice-gtk-session.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/spice-gtk-session-priv.h b/gtk/spice-gtk-session-priv.h index aba6fe9..48482b6 100644 --- a/gtk/spice-gtk-session-priv.h +++ b/gtk/spice-gtk-session-priv.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS void spice_gtk_session_request_auto_usbredir(SpiceGtkSession *self, gboolean state); gboolean spice_gtk_session_get_read_only(SpiceGtkSession *self); +void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self); G_END_DECLS diff --git a/gtk/spice-gtk-session.h b/gtk/spice-gtk-session.h index fbcc353..3b4eac6 100644 --- a/gtk/spice-gtk-session.h +++ b/gtk/spice-gtk-session.h @@ -59,7 +59,6 @@ GType spice_gtk_session_get_type(void); SpiceGtkSession *spice_gtk_session_get(SpiceSession *session); void spice_gtk_session_copy_to_guest(SpiceGtkSession *self); void spice_gtk_session_paste_from_guest(SpiceGtkSession *self); -void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self); G_END_DECLS -- 1.9.3 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters
Hi Cody, On Tue, Aug 12, 2014 at 11:40:58AM +0200, Christophe Fergeau wrote: On Mon, Aug 11, 2014 at 07:58:44PM +0800, Cody Chan wrote: I submitted a patch several months ago about this issue, here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html I check it again, and find that the value of g_key_file_to_data(keyfile,...) is always utf-8, for the value of g_uri_list_extract_uris() is utf8 urlencode. So the display problem is caused by vd_agent, but how it displays depends on the language of system, the following two screenshots show the difference: http://int64ago-tmp.qiniudn.com/guest-Chinese.png http://int64ago-tmp.qiniudn.com/guest-English.png I've tried to apply your patches to the upstream git repository, but your mailer seems to have corrupted them. Could you try to send them using git send-email, or if this is not working for you, could you use git format-patch and send them as an attachment? This would be very helpful, thanks! Christophe pgpS1usMrMZob.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] spice_gtk_session_sync_keyboard_modifiers() is internal
Hey! On Wed, Aug 13, 2014 at 4:21 PM, Jonathon Jongsma jjong...@redhat.com wrote: This function was not exported, and it's not really useful as public API, so move the declaration to the private header. --- gtk/spice-gtk-session-priv.h | 1 + gtk/spice-gtk-session.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/spice-gtk-session-priv.h b/gtk/spice-gtk-session-priv.h index aba6fe9..48482b6 100644 --- a/gtk/spice-gtk-session-priv.h +++ b/gtk/spice-gtk-session-priv.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS void spice_gtk_session_request_auto_usbredir(SpiceGtkSession *self, gboolean state); gboolean spice_gtk_session_get_read_only(SpiceGtkSession *self); +void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self); G_END_DECLS diff --git a/gtk/spice-gtk-session.h b/gtk/spice-gtk-session.h index fbcc353..3b4eac6 100644 --- a/gtk/spice-gtk-session.h +++ b/gtk/spice-gtk-session.h @@ -59,7 +59,6 @@ GType spice_gtk_session_get_type(void); SpiceGtkSession *spice_gtk_session_get(SpiceSession *session); void spice_gtk_session_copy_to_guest(SpiceGtkSession *self); void spice_gtk_session_paste_from_guest(SpiceGtkSession *self); -void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self); G_END_DECLS -- 1.9.3 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel Once we are not exposing the function, what about adding a G_GNUC_INTERNAL in the function declaration? (in the .c file) ACK with this change. -- Fabiano Fidêncio ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk] Use G_OS_WIN32 #define everywhere
Sounds good to me. ACK. On Wed, 2014-08-13 at 16:13 +0200, Christophe Fergeau wrote: Currently some parts of the windows specific code is checking for the WIN32 define, and other parts are checking G_OS_WIN32. This commit uses G_OS_WIN32 everywhere for consistency. --- gtk/channel-display.c | 8 gtk/decode-jpeg.c | 2 +- gtk/spice-gtk-session.c | 6 -- gtk/spice-widget.c | 27 ++- gtk/spicy.c | 20 ++-- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 20dfe55..1e1312c 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -81,7 +81,7 @@ struct _SpiceDisplayChannelPrivate { GArray *monitors; guint monitors_max; gbooleanenable_adaptive_streaming; -#ifdef WIN32 +#ifdef G_OS_WIN32 HDC dc; #endif }; @@ -575,7 +575,7 @@ static SpiceImageSurfacesOps image_surfaces_ops = { .get = surfaces_get }; -#if defined(WIN32) +#if defined(G_OS_WIN32) static HDC create_compatible_dc(void) { HDC dc = CreateCompatibleDC(NULL); @@ -615,7 +615,7 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel) c-image_cache.ops = image_cache_ops; c-palette_cache.ops = palette_cache_ops; c-image_surfaces.ops = image_surfaces_ops; -#if defined(WIN32) +#if defined(G_OS_WIN32) c-dc = create_compatible_dc(); #endif c-monitors_max = 1; @@ -1143,7 +1143,7 @@ static gboolean display_stream_render(display_stream *st) st-surface-canvas-ops-put_image( st-surface-canvas, -#ifdef WIN32 +#ifdef G_OS_WIN32 SPICE_DISPLAY_CHANNEL(st-channel)-priv-dc, #endif dest, data, diff --git a/gtk/decode-jpeg.c b/gtk/decode-jpeg.c index db54a31..697d0de 100644 --- a/gtk/decode-jpeg.c +++ b/gtk/decode-jpeg.c @@ -19,7 +19,7 @@ #include decode.h -#ifdef WIN32 +#ifdef G_OS_WIN32 /* We need some hacks to avoid warnings from the jpeg headers, ex: */ /* #define HAVE_BOOLEAN */ #define XMD_H diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c index abd39c7..8dd05f4 100644 --- a/gtk/spice-gtk-session.c +++ b/gtk/spice-gtk-session.c @@ -17,6 +17,8 @@ */ #include config.h +#include glib.h + #if HAVE_X11_XKBLIB_H #include X11/XKBlib.h #include gdk/gdkx.h @@ -25,7 +27,7 @@ #include X11/Xlib.h #include gdk/gdkx.h #endif -#ifdef WIN32 +#ifdef G_OS_WIN32 #include windows.h #include gdk/gdkwin32.h #ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */ @@ -140,7 +142,7 @@ static guint32 get_keyboard_lock_modifiers(void) if (keyboard_state.led_mask 0x04) { modifiers |= SPICE_INPUTS_SCROLL_LOCK; } -#elif defined(WIN32) +#elif defined(G_OS_WIN32) if (GetKeyState(VK_CAPITAL) 1) { modifiers |= SPICE_INPUTS_CAPS_LOCK; } diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index b6bb0a9..1220030 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -18,6 +18,7 @@ #include config.h #include math.h +#include glib.h #if HAVE_X11_XKBLIB_H #include X11/XKBlib.h @@ -27,7 +28,7 @@ #include X11/Xlib.h #include gdk/gdkx.h #endif -#ifdef WIN32 +#ifdef G_OS_WIN32 #include windows.h #include gdk/gdkwin32.h #ifndef MAPVK_VK_TO_VSC /* may be undefined in older mingw-headers */ @@ -99,7 +100,7 @@ enum { static guint signals[SPICE_DISPLAY_LAST_SIGNAL]; -#ifdef WIN32 +#ifdef G_OS_WIN32 static HWND win32_window = NULL; #endif @@ -639,7 +640,7 @@ void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq) d-activeseq = g_new0(gboolean, d-grabseq-nkeysyms); } -#ifdef WIN32 +#ifdef G_OS_WIN32 static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM lparam) { if (win32_window code == HC_ACTION wparam != WM_KEYUP) { @@ -721,7 +722,7 @@ static void try_keyboard_grab(SpiceDisplay *display) SPICE_DEBUG(grab keyboard); gtk_widget_grab_focus(widget); -#ifdef WIN32 +#ifdef G_OS_WIN32 if (d-keyboard_hook == NULL) d-keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_hook_cb, GetModuleHandle(NULL), 0); @@ -748,7 +749,7 @@ static void try_keyboard_ungrab(SpiceDisplay *display) SPICE_DEBUG(ungrab keyboard); gdk_keyboard_ungrab(GDK_CURRENT_TIME); -#ifdef WIN32 +#ifdef G_OS_WIN32 if (d-keyboard_hook != NULL) { UnhookWindowsHookEx(d-keyboard_hook); d-keyboard_hook = NULL; @@ -811,7 +812,7 @@ static void set_mouse_accel(SpiceDisplay *display, gboolean enabled) #endif } -#ifdef WIN32 +#ifdef G_OS_WIN32 static gboolean win32_clip_cursor(void) { RECT window, workarea, rect; @@ -865,7 +866,7 @@ static
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters
The attach is the patch. On Wed, Aug 13, 2014 at 10:47 PM, Cody Chan int64...@gmail.com wrote: But you ACKed this: http://lists.freedesktop.org/archives/spice-devel/2014-August/017209.html and this's my final version, doesn't it work? On Wed, Aug 13, 2014 at 10:27 PM, Christophe Fergeau cferg...@redhat.com wrote: Hi Cody, On Tue, Aug 12, 2014 at 11:40:58AM +0200, Christophe Fergeau wrote: On Mon, Aug 11, 2014 at 07:58:44PM +0800, Cody Chan wrote: I submitted a patch several months ago about this issue, here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html I check it again, and find that the value of g_key_file_to_data(keyfile,...) is always utf-8, for the value of g_uri_list_extract_uris() is utf8 urlencode. So the display problem is caused by vd_agent, but how it displays depends on the language of system, the following two screenshots show the difference: http://int64ago-tmp.qiniudn.com/guest-Chinese.png http://int64ago-tmp.qiniudn.com/guest-English.png I've tried to apply your patches to the upstream git repository, but your mailer seems to have corrupted them. Could you try to send them using git send-email, or if this is not working for you, could you use git format-patch and send them as an attachment? This would be very helpful, thanks! Christophe -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV 0001-fix-bug-display-error-when-dragging-file-with-CJK-ch.patch Description: Binary data ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters
On Wed, Aug 13, 2014 at 10:47:14PM +0800, Cody Chan wrote: But you ACKed this: http://lists.freedesktop.org/archives/spice-devel/2014-August/017209.html and this's my final version, doesn't it work? Since you said you tested this patch and it works for you, I'm trusting your tests, I haven't tried that code yet, but I feel comfortable enough to ACK it. Christophe On Wed, Aug 13, 2014 at 10:27 PM, Christophe Fergeau cferg...@redhat.com wrote: Hi Cody, On Tue, Aug 12, 2014 at 11:40:58AM +0200, Christophe Fergeau wrote: On Mon, Aug 11, 2014 at 07:58:44PM +0800, Cody Chan wrote: I submitted a patch several months ago about this issue, here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html I check it again, and find that the value of g_key_file_to_data(keyfile,...) is always utf-8, for the value of g_uri_list_extract_uris() is utf8 urlencode. So the display problem is caused by vd_agent, but how it displays depends on the language of system, the following two screenshots show the difference: http://int64ago-tmp.qiniudn.com/guest-Chinese.png http://int64ago-tmp.qiniudn.com/guest-English.png I've tried to apply your patches to the upstream git repository, but your mailer seems to have corrupted them. Could you try to send them using git send-email, or if this is not working for you, could you use git format-patch and send them as an attachment? This would be very helpful, thanks! Christophe -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel pgp8ZpgpfDfNo.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters
On Wed, Aug 13, 2014 at 11:13 PM, Christophe Fergeau cferg...@redhat.com wrote: On Wed, Aug 13, 2014 at 10:47:14PM +0800, Cody Chan wrote: But you ACKed this: http://lists.freedesktop.org/archives/spice-devel/2014-August/017209.html and this's my final version, doesn't it work? Since you said you tested this patch and it works for you, I'm trusting your tests, I haven't tried that code yet, but I feel comfortable enough to ACK it. Christophe Of course, I test it carefully, doesn't it work? I mean if it's ok to patch to upstream. Any way, I gave the patch as attachment just now, and I'm so sorry for my unskilled work. Thx you again, you've really encouraged me. On Wed, Aug 13, 2014 at 10:27 PM, Christophe Fergeau cferg...@redhat.com wrote: Hi Cody, On Tue, Aug 12, 2014 at 11:40:58AM +0200, Christophe Fergeau wrote: On Mon, Aug 11, 2014 at 07:58:44PM +0800, Cody Chan wrote: I submitted a patch several months ago about this issue, here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html I check it again, and find that the value of g_key_file_to_data(keyfile,...) is always utf-8, for the value of g_uri_list_extract_uris() is utf8 urlencode. So the display problem is caused by vd_agent, but how it displays depends on the language of system, the following two screenshots show the difference: http://int64ago-tmp.qiniudn.com/guest-Chinese.png http://int64ago-tmp.qiniudn.com/guest-English.png I've tried to apply your patches to the upstream git repository, but your mailer seems to have corrupted them. Could you try to send them using git send-email, or if this is not working for you, could you use git format-patch and send them as an attachment? This would be very helpful, thanks! Christophe -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] [vd_agent] fix bug: display error when dragging file with CJK characters
On Wed, Aug 13, 2014 at 11:21:11PM +0800, Cody Chan wrote: On Wed, Aug 13, 2014 at 11:13 PM, Christophe Fergeau cferg...@redhat.com wrote: On Wed, Aug 13, 2014 at 10:47:14PM +0800, Cody Chan wrote: But you ACKed this: http://lists.freedesktop.org/archives/spice-devel/2014-August/017209.html and this's my final version, doesn't it work? Since you said you tested this patch and it works for you, I'm trusting your tests, I haven't tried that code yet, but I feel comfortable enough to ACK it. Christophe Of course, I test it carefully, doesn't it work? I mean if it's ok to patch to upstream. Oh I'm sorry I misunderstood your previous email, I indeed have replied to the wrong patch, I did not understand this is why you said I ACK'ed this other patch :) It's all good now, and I'm confident your patch works :) Any way, I gave the patch as attachment just now, and I'm so sorry for my unskilled work. Thx you again, you've really encouraged me. Well, thanks for diagnosing this bug in the first place, and for sending and testing several iterations of this patch very quickly! Christophe pgpZgqiX3ZE42.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk] Fix 'loose' typo
--- Hey, I've pushed this already as this is a trivial change. Christophe gtk/channel-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 7a299a4..f33b0fd 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -2482,7 +2482,7 @@ void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint select * spice_main_clipboard_release: * @channel: * - * Release the clipboard (for example, when the client looses the + * Release the clipboard (for example, when the client loses the * clipboard grab): Inform the guest no clipboard data is available. * * Deprecated: 0.6: use spice_main_clipboard_selection_release() instead. @@ -2497,7 +2497,7 @@ void spice_main_clipboard_release(SpiceMainChannel *channel) * @channel: * @selection: one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_* * - * Release the clipboard (for example, when the client looses the + * Release the clipboard (for example, when the client loses the * clipboard grab): Inform the guest no clipboard data is available. * * Since: 0.6 -- 1.9.3 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] spice related qemu crash
On 08/12/2014 05:10 AM, Christophe Fergeau wrote: On Mon, Aug 11, 2014 at 03:34:07PM -0400, David Mansfield wrote: Hi All, I have a qemu 1.6.2 (SRPM from F20 recompiled on Centos 7) which crashed with the following in the qemu log. Not sure exactly what the timing of the messages are here, since the messages are not all timestamped: Is this reproducible by any chance? I assume not? Not exactly reproducible but reproduced ;-) Slightly different error message (I think this one comes from the line below the previous one). ((null):21622): SpiceWorker-Warning **: red_worker.c:1277:validate_surface: condition `surface_id = worker-n_surfaces' reached Any bells ringing? Thanks, David ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel