1. 12 Feb, 2015 1 commit
  2. 23 Jan, 2015 1 commit
  3. 30 Nov, 2014 1 commit
  4. 27 Nov, 2014 1 commit
    • Fabiano Fidêncio's avatar
      spice-widget: check whether the widget is realized in focus_in_event() · b0703419
      Fabiano Fidêncio authored
      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 ?? ()
      b0703419
  5. 04 Nov, 2014 1 commit
  6. 27 Oct, 2014 2 commits
  7. 13 Aug, 2014 1 commit
    • Christophe Fergeau's avatar
      Use G_OS_WIN32 #define everywhere · 441494a5
      Christophe Fergeau authored
      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.
      441494a5
  8. 23 Jul, 2014 2 commits
    • Fabiano Fidêncio's avatar
      Don't use _GET_PRIVATE all the time · 2c3cf155
      Fabiano Fidêncio authored
      Let's make use of the priv members in the structs, which are much much
      faster. Also, to keep the type-safety, the SPICE_IS_* macros were added
      in the public methods affected by this patch.
      
      Patch based on an old patch from Alexander Larsson (alexl@redhat.com).
      2c3cf155
    • Fabiano Fidêncio's avatar
      Prefer using g_malloc0()/g_free() · b9acafcd
      Fabiano Fidêncio authored
      As we already depend on GLib, let's use g_{malloc,new}0() instead of the
      standard malloc() or the spice_{malloc,new}*() and g_free() instead of
      the standard free() when possible.
      Memory allocated by other libraries using malloc() should still be freed
      by free().
      As a side effect of the changes, we are muting a few warnings caught by
      coverity.
      b9acafcd
  9. 15 Apr, 2014 1 commit
    • Christophe Fergeau's avatar
      Gather gtk+ compatibility code in a single file · c2356a71
      Christophe Fergeau authored
      There are gtk+ version checks in several source files to add
      compatibility implementations of gtk3 functions not available
      in gtk2. This commit gathers all of them in a gtk-compat.h header,
      similar to what is done for glib-compat.h
      c2356a71
  10. 03 Apr, 2014 1 commit
    • Jonathon Jongsma's avatar
      Ensure keyboard modifiers are synchronized properly · 9c75c7ee
      Jonathon Jongsma authored
      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.
      9c75c7ee
  11. 14 Mar, 2014 1 commit
  12. 13 Mar, 2014 1 commit
    • Christophe Fergeau's avatar
      Make sure config.h is included first in all .c files · b7c9343b
      Christophe Fergeau authored
      This is recommended by autoconf documentation
      http://nondot.org/sabre/Mirrored/autoconf-2.12/autoconf_3.html#SEC15
      and some #defines in config.h can change what happens in system headers,
      so config.h has to be included first.
      
      The only file which does not get this treatment is
      gtk/spice-client-gtk-module.c as this breaks the build on gtk+2:
      
      CC       SpiceClientGtk_la-spice-client-gtk-module.lo
      In file included from /usr/include/python2.7/pyconfig.h:6:0,
                       from /usr/include/python2.7/Python.h:8,
                       from /usr/include/pygtk-2.0/pygobject.h:5,
                       from spice-client-gtk-module.c:20:
      /usr/include/python2.7/pyconfig-64.h:1182:0: error: "_POSIX_C_SOURCE" redefined [-Werror]
       #define _POSIX_C_SOURCE 200112L
       ^
      In file included from /usr/include/limits.h:25:0,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/limits.h:168,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/syslimits.h:7,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/limits.h:34,
                       from /usr/lib64/glib-2.0/include/glibconfig.h:11,
                       from /usr/include/glib-2.0/glib/gtypes.h:34,
                       from /usr/include/glib-2.0/glib/galloca.h:34,
                       from /usr/include/glib-2.0/glib.h:32,
                       from /usr/include/glib-2.0/gobject/gbinding.h:30,
                       from /usr/include/glib-2.0/glib-object.h:25,
                       from ./glib-compat.h:24,
                       from ../config.h:201,
                       from spice-client-gtk-module.c:18:
      /usr/include/features.h:228:0: note: this is the location of the previous definition
       #  define _POSIX_C_SOURCE 200809L
       ^
      cc1: all warnings being treated as errors
      b7c9343b
  13. 10 Feb, 2014 1 commit
    • Christophe Fergeau's avatar
      Don't attempt to send 0 scancode when releasing keys · d28d6e11
      Christophe Fergeau authored
      When releasing all keys, we send a key release for scancode in the
      key_state array, including the very first element with scancode 0.
      send_key() complain when the scancode is 0, so make sure we don't call it
      for this first element.
      
      This fixes a
      (remote-viewer:25548): GSpice-CRITICAL **: send_key: assertion 'scancode != 0' failed
      warning when starting remote-viewer windowed, and then switching to another
      desktop client-side using ctrl+alt+arrow.
      d28d6e11
  14. 20 Nov, 2013 1 commit
  15. 07 Nov, 2013 1 commit
  16. 04 Nov, 2013 3 commits
  17. 26 Sep, 2013 1 commit
  18. 18 Sep, 2013 1 commit
    • Marc-André Lureau's avatar
      build-sys: fix bad cast on win64 · 085d9a78
      Marc-André Lureau authored
      spice-widget.c:814:50: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
               g_return_if_fail(SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)d->win_mouse_speed, 0));
      085d9a78
  19. 14 Jun, 2013 2 commits
    • Marc-André Lureau's avatar
      win32: don't block key up events · 5f67178c
      Marc-André Lureau authored
      The win32 ll keyboard hook avoid Windows and other application to
      receive global keyboard events. But some key combinations can't be
      filtered, such as Win+L. However, the windows lock screen doesn't catch
      that the Win key is released, when virt-viewer still holds the hook and
      filters it.
      
      So pressing Win+L quickly will lock the screen, but some key press in
      the password entry will still be handled as if the Win key was pressed,
      such as Win+P or Win+U and probably other, and prevents user from typing
      his password.
      
      The only working solution I could find is to just let go all the release
      key events in the hook. There doesn't seem any drawback with that.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=917986
      5f67178c
    • Marc-André Lureau's avatar
      widget: release keys on grab-broken · 0fb74ae1
      Marc-André Lureau authored
      This is similar to 8cbd5d74 and can be
      reproduced by pressing Win+l while the widget has the keyboard
      grab (pointer over the display).
      
      I have not reproduced implicit grab-broken event, I suppose they could
      happen if the grab is stolen from within the app. In any case, it's
      probably better to release the keys.
      
      This is related to:
      https://bugzilla.redhat.com/show_bug.cgi?id=917986
      0fb74ae1
  20. 16 May, 2013 1 commit
  21. 15 May, 2013 1 commit
    • Mattias Grönlund's avatar
      mingw: Fix non-working AltGr with some layouts · 6e180217
      Mattias Grönlund authored and Christophe Fergeau's avatar Christophe Fergeau committed
      Running virt-viewer-x64-0.5.6.msi, on Windows 7, connecting to QEMU using
      spice, AltGR key combinations fails (using Swedish keyboard layout both at
      server and client).
      
      I suspect that this is a variant of
      https://bugzilla.redhat.com/show_bug.cgi?id=904092.
      
      After some debugging, I realized that there is an extra VK_LCONTROL
      keypress sent by Windows. This extra VK_LCONTROL will then make the key
      e.g. AltGr-< actually be Control-AltGr-<, which is not interpreted as a |
      sign.
      
      So in spice-widget.c : keyboard_hook_cb(), I added SPICE_DEBUG lines which
      printed out the hooked->scanCode, and realized that this extra VK_LCONTROL
      has a very suspect scanCode with bit 9 set. If I instead press the left
      Ctrl key, it will also emit VK_LCONTROL, but with bit 9 cleared.
      
      So I just made sure that keyboard_hook_cb(), silently dropped these strange
      VK_LCONTROL events, which seems to work for me.
      6e180217
  22. 14 May, 2013 1 commit
  23. 11 May, 2013 4 commits
  24. 30 Apr, 2013 1 commit
    • Marc-André Lureau's avatar
      widget: don't grab mouse when switching to server mode · 68c4dbe0
      Marc-André Lureau authored
      spice-gtk used to try taking the grab when switching to server mode, so
      that the current mouse interaction (for example a drag), isn't
      interrupted if the agent dies. However, shutting down a VM will
      automatically try taking the grab when there is no tablet input, and
      agent exits.
      
      Some users are complaining about it (especially when they don't know the
      ungrab combination).
      
      Instead, let's try to keep the grab only if we have currently a mouse
      button pressed.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=873272
      68c4dbe0
  25. 09 Apr, 2013 2 commits
  26. 02 Apr, 2013 2 commits
  27. 15 Mar, 2013 3 commits
    • Hans de Goede's avatar
      spice-widget: Reconfiguring the grab is only needed on win32 · 91ceac03
      Hans de Goede authored
      Commit 8a7e72e3
      
       "widget: regrab when widget is reconfigured" adds an
      ungrab + grab call to the configure event handling code. Because:
      "On Windows, we need to update the cursor clip. Call ungrab&grab to update it."
      
      But on X11 this is not needed, see man XGrabPointer, which explains that
      the grab automatically adjusts to window resizing.
      
      Not only is it not needed it is also racy, causing spice-gtk based
      apps to log messages like:
      (remote-viewer:9935): GSpice-WARNING **: pointer grab failed 3
      
      This patch fixes this by disabling the ungrab + re-grab on non-win32.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      91ceac03
    • Hans de Goede's avatar
      spice-widget: Fix auto-grab on window size change · 8eed3c52
      Hans de Goede authored
      Commit 8a7e72e3
      
       "widget: regrab when widget is reconfigured" adds an
      ungrab + grab call to the configure event handling code. But it does this
      without checking if the mouse is grabbed at all, causing an unsolicited
      grab in certain scenarios, ie:
      
      1) User boots a vm
      2) Connects with remote-viewer
      3) Goes and do some web-browsing while the vm boots
      4) Mouse happens to hover over the remote-viewer window
      5) Guests changes resolution (ie X starts)
      6) The mouse is grabbed, and when the user tries to move it to
         click something in his web-browser this does not work.
      
      This patch fixes this by checking that the mouse is grabbed before doing
      the ungrab + re-grab which is needed to reconfigure the grab to the new window
      size / location.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      8eed3c52
    • Hans de Goede's avatar
      spice-widget: Ignore duplicate configure events · 604ab8ba
      Hans de Goede authored
      
      
      gtk seems to be sending us identical / repeated configure events quite
      regularly (atleast under X11), we don't care about re-configures with the
      same size + coordinates, so filter these out.
      
      Note this patch uses the SpiceDisplayPrivate mx and my members which
      were already defined to store the window position, but not yet used.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      604ab8ba
  28. 07 Feb, 2013 1 commit