1. 05 Aug, 2016 1 commit
  2. 28 Jul, 2016 1 commit
    • Jonathon Jongsma's avatar
      Fix resizing problem with recent gtk versions · 21054f96
      Jonathon Jongsma authored
      When using client-side decorations, as well as in certain other
      situations (wayland, and windows in some cases), the window gradually
      resizes larger and larger.
      
      This is caused by a change in how gtk interprets the sizes passed to
      gtk_window_resize(), particularly when client-side decorations (CSD) are
      involved. For example, In the past this size was assumed to include the
      size of the CSD, but now it it assumes that the sizes only represent the
      size of the window's content, without any decorations. However,
      gtk_widget_get_preferred_size() (when called on a GtkWindow*), returns a
      size that includes the size of the CSD. So
      virt_viewer_window_queue_resize() was essentially growing the window by
      the size of the CSD every time it was called.
      
      To work around this issue, we need to calculate the preferred size of
      the window's child, not the size of the entire window (including CSD).
      Then we add the width of the window's border (just to be safe) and pass
      those values to gtk_window_resize().
      21054f96
  3. 12 Jul, 2016 2 commits
    • Daniel Berrange's avatar
      virt-viewer: ensure we close when seeing domain stop event · 5d535836
      Daniel Berrange authored
      Normally virt-viewer relies on the VNC/SPICE widget seeing
      an EOF on its underlying connection to detect when the
      session is closed.
      
      When tunnelling to a remote guest over SSH though, this
      EOF can be delayed for a very long time, leaving a dead
      session open.
      
      This can be seen with
      
         virt-viewer -c qemu+ssh://remotehost/system guestname
      
      when on the remote shell run
      
         virsh destroy guestname
      
      and notice that virt-viewer does not see the shutdown
      immediately.
      
      When we get a domain stopped event we know the session
      should be dead, so forceably close it, if not already
      closed.
      Signed-off-by: Daniel Berrange's avatarDaniel P. Berrange <[email protected]>
      (cherry picked from commit a62827d2)
      5d535836
    • Daniel Berrange's avatar
      virt-viewer: fix display of guest name in title for vnc · 3b5484b0
      Daniel Berrange authored
      The following commit broke the display of the guest name in
      the title for VNC displays:
      
        commit 61a1bc4d
        Author: Pavel Grunt <[email protected]>
        Date:   Wed Apr 15 13:50:35 2015 +0200
      
          session-vnc: Set window for display to avoid gtk-vnc v0.3.8 crash
      
          The VNC display widget of gtk-vnc v0.3.8 needs a window at the moment
      
      The problem is that this causes the window to be associated
      with the display before the guest name is available. Thus
      when ensure_window_for_display() runs, the window is already
      configured and so it never invokes the logic to set the title.
      
      The fix is to unconditionally update the title in the
      ensure_window_for_display() method, even if the window already
      exists.
      Signed-off-by: Daniel Berrange's avatarDaniel P. Berrange <[email protected]>
      (cherry picked from commit 35e489d5)
      3b5484b0
  4. 30 Jun, 2016 5 commits
  5. 29 Jun, 2016 3 commits
  6. 28 Jun, 2016 3 commits
    • Fabiano Fidêncio's avatar
      timed-revealer: Inherit from GtkEventBox · 612f4ffd
      Fabiano Fidêncio authored
      As suggested by Christophe, inheriting from GtkEventBox instead of
      having one instance of it as a member can help us to get rid of
      virt_viewer_timed_revealer_get_overlay_widget().
      Signed-off-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      Acked-by: default avatarChristophe Fergeau <[email protected]>
      612f4ffd
    • Christophe Fergeau's avatar
      timed-revealer: Don't release reference we don't own · 67667caf
      Christophe Fergeau authored
      VirtViewerTimedRevealer::evBox is created in
      virt_viewer_timed_revealer_new() and will be passed to
      gtk_container_add() through gtk_overlay_add_overlay(overlay,
      virt_viewer_timed_revealer_get_overlay_widget(priv->revealer))
      
      This means VirtViewerTimedRevealer does not own a reference on evBox,
      and that it should not try to release it in
      VirtViewerTimedRevealer::dispose()
      
      Backtrace for the crash:
       #0  0x00007ffff3e92c9d in g_type_check_instance_is_fundamentally_a () at /lib64/libgobject-2.0.so.0
       #1  0x00007ffff3e722a5 in g_object_unref () at /lib64/libgobject-2.0.so.0
       #2  0x000000000041ebe3 in virt_viewer_timed_revealer_dispose (object=0x1127320) at virt-viewer-timed-revealer.c:128
       #3  0x00007ffff3e723b6 in g_object_unref () at  /lib64/libgobject-2.0.so.0
       #4  0x000000000041c040 in virt_viewer_window_dispose  (object=0x981f70) at virt-viewer-window.c:191
       #5  0x00007ffff3e723b6 in g_object_unref () at  /lib64/libgobject-2.0.so.0
       #6  0x0000000000413a58 in virt_viewer_app_display_removed (nth=<optimized out>, self=0x680330) at virt-viewer-app.c:989
       #7  0x0000000000413a58 in virt_viewer_app_display_removed (session=<optimized out>, display=<optimized out>, self=0x680330) at virt-viewer-app.c:1000
       #8  0x00007ffff3e705e0 in g_cclosure_marshal_VOID__OBJECTv () at /lib64/libgobject-2.0.so.0  #9  0x00007ffff3e6d784 in _g_closure_invoke_va () at  /lib64/libgobject-2.0.so.0
       #10 0x00007ffff3e88cd9 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
       #11 0x00007ffff3e897eb in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
       #12 0x0000000000418973 in virt_viewer_session_remove_display (session=0x9c6de0, display=0x961a90) at virt-viewer-session.c:463
       #13 0x0000000000420934 in destroy_display (data=<optimized out>) at virt-viewer-session-spice.c:851
       #14 0x00007ffff3b6d0eb in g_ptr_array_foreach () at /lib64/libglib-2.0.so.0
       #15 0x00007ffff3b6d180 in ptr_array_free () at /lib64/libglib-2.0.so.0
       #16 0x000000000042072a in virt_viewer_session_spice_clear_displays (self=0x9c6de0) at virt-viewer-session-spice.c:94
       #17 0x000000000042240d in virt_viewer_session_spice_close (session=<optimized out>) at virt-viewer-session-spice.c:459
       #18 0x0000000000414be5 in virt_viewer_app_quit ([email protected]=0x680330) at virt-viewer-app.c:285
       #19 0x0000000000415500 in virt_viewer_app_maybe_quit (self=0x680330, [email protected]=0x981a90) at virt-viewer-app.c:481
       #20 0x000000000041c4ad in virt_viewer_window_delete (src=<optimized out>, dummy=<optimized out>, self=0x981a90) at virt-viewer-window.c:771
       #21 0x00007ffff61807f1 in _gtk_marshal_BOOLEAN__BOXEDv () at /lib64/libgtk-3.so.0
       #22 0x00007ffff3e6d784 in _g_closure_invoke_va () at /lib64/libgobject-2.0.so.0
       #23 0x00007ffff3e887b3 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
       #24 0x00007ffff3e8933f in g_signal_emit () at /lib64/libgobject-2.0.so.0
       #25 0x00007ffff62dde6c in gtk_widget_event_internal () at /lib64/libgtk-3.so.0
       #26 0x00007ffff617f5ef in gtk_main_do_event () at /lib64/libgtk-3.so.0
       #27 0x00007ffff5c7dd25 in _gdk_event_emit () at /lib64/libgdk-3.so.0
       #28 0x00007ffff5cae672 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
       #29 0x00007ffff3b9895a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
       #30 0x00007ffff3b98d10 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
       #31 0x00007ffff3b98dbc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
       #32 0x00007ffff41643cd in g_application_run () at /lib64/libgio-2.0.so.0
       #33 0x000000000040fc1a in main (argc=3, argv=0x7fffffffdec8) at virt-viewer-main.c:41
      Signed-off-by: default avatarChristophe Fergeau <[email protected]>
      Acked-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      67667caf
    • Christophe Fergeau's avatar
      timed-revealer: Fix "revealer" refcounting · 68c7073a
      Christophe Fergeau authored
      virt_viewer_timed_revealer_new calls gtk_container_add on the instance
      returned by gtk_revealer_new so VirtViewerTimedRevealer does not own any
      ref on this GtkRevealer instance. Unrefing it in _dispose() is thus wrong.
      Signed-off-by: default avatarChristophe Fergeau <[email protected]>
      Acked-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      68c7073a
  7. 24 Jun, 2016 2 commits
  8. 23 Jun, 2016 2 commits
  9. 22 Jun, 2016 4 commits
  10. 21 Jun, 2016 1 commit
    • Fabiano Fidêncio's avatar
      util: Fix resource path · cf269299
      Fabiano Fidêncio authored
      Since commit 1f6f1a48 the resource path for icons has been broken.
      The reason is that when moving the .ui files to $(srcdir)/resources/ui
      the define used for the resources was changed to reflect the new
      directory. However, this change wasn't needed by the icons and ended
      up with virt-viewer not displaying a few icons.
      
      Let's fix the issue by setting back the define to the previous one and
      then tweaking the virt_viewer_util_load_ui() to add "ui" to the resource
      path, for loading the ui files.
      Signed-off-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      Acked-by: default avatarEduardo Lima (Etrunko) <[email protected]>
      cf269299
  11. 20 Jun, 2016 9 commits
  12. 16 Jun, 2016 1 commit
  13. 04 Jun, 2016 2 commits
    • Michal Privoznik's avatar
      tests: Fix VPATH build · 9f302929
      Michal Privoznik authored
      So test-hotkeys include virt-viewer-app.h which includes
      virt-viewer-window.h which includes virt-viewer-display.h which
      in turn wants to include virt-viewer-enums.h. But, the enums
      header file is generated at build time into builddir not srcdir.
      Therefore it may happen if the two are distinct that compiler
      fails to find the enums file:
      
      In file included from ../../src/virt-viewer-window.h:29:0,
                       from ../../src/virt-viewer-app.h:28,
                       from ../../tests/test-hotkeys.c:27:
      ../../src/virt-viewer-display.h:28:31: fatal error: virt-viewer-enums.h: No such file or directory
       #include "virt-viewer-enums.h"
                                     ^
      compilation terminated.
      
      The fix is to include builddir into paths where header files are
      looked for.
      Signed-off-by: default avatarMichal Privoznik <[email protected]>
      Acked-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      9f302929
    • Michal Privoznik's avatar
      virt-viewer-display-vnc: Include virt-viewer-util.h · 5eb4a82b
      Michal Privoznik authored
      In function virt_viewer_display_vnc_new() we are calling
      virt_viewer_signal_connect_object() which is defined in
      virt-viewer-util module. However, the header file for the module
      is never included.
      
        CC       libvirt_viewer_la-virt-viewer-display-vnc.lo
      virt-viewer-display-vnc.c: In function 'virt_viewer_display_vnc_new':
      virt-viewer-display-vnc.c:251:5: warning: implicit declaration of function 'virt_viewer_signal_connect_object' [-Wimplicit-function-declaration]
           virt_viewer_signal_connect_object(app, "notify::enable-accel",
           ^
      virt-viewer-display-vnc.c:251:5: warning: nested extern declaration of 'virt_viewer_signal_connect_object' [-Wnested-externs]
      Signed-off-by: default avatarMichal Privoznik <[email protected]>
      Acked-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
      5eb4a82b
  14. 02 Jun, 2016 4 commits