494 Commits

Author SHA1 Message Date
Marc-André Lureau
4648dc16e8 spice: improve fullscreen=auto-conf
Do keep client monitor position, do not align monitors automatically.
The align property is only available since v0.12.101.
2012-07-23 16:27:28 +02:00
Marc-André Lureau
8d9a9ca521 build: allow building with newer glibc-headers and -O0
Fix copied from libvirt, commit by Eric Blake.

    glibc 2.15 (on Fedora 17) coupled with explicit disabling of
    optimization during development dies a painful death:

    /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

    Work around this by only conditionally defining _FORTIFY_SOURCE,
    in the case where glibc can actually use it.  The trick is using
    AH_VERBATIM instead of AC_DEFINE.
2012-07-03 23:02:41 +02:00
Christophe Fergeau
4b310b03e9 Revert "Fix virt_viewer_app_activate return value"
This reverts commit 3ce6df7c309068f36e2602692da809a153ed5688. This
commit broke virt-viewer which expects this function to return -1
or 0 on error, and a positive value on success in
virt_viewer_initial_connect.
2012-06-15 10:03:21 +02:00
Christophe Fergeau
3ce6df7c30 Fix virt_viewer_app_activate return value
VirtViewerApp::activate is expected to return -1 on errors.
It calls the VirtViewerSession::open_* methods, which return FALSE
on error. However, VirtViewerApp::activate directly returns these
boolean instead of testing the returned value and properly returning
-1 on errors. This caused errors in these open methodes to be ignored.
2012-06-13 12:17:20 +02:00
Christophe Fergeau
afb278958e Fix various memory leaks
==25063== 59 bytes in 1 blocks are definitely lost in loss record 5,163 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356)
==25063==    by 0x41F40A: connected (remote-viewer-main.c:186)
==25063==    by 0x3DE400F663: g_closure_invoke (gclosure.c:777)
==25063==    by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547)
==25063==    by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296)
==25063==    by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389)
==25063==    by 0x41AA53: reemit_signal_VOID (virt-viewer-session-ovirt.c:211)
==25063==    by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840)
==25063==    by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
==25063==    by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389)

==25063== 14 bytes in 1 blocks are definitely lost in loss record 623 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82)
==25063==    by 0x3DE3882F1A: g_vasprintf (stdio2.h:199)
==25063==    by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509)
==25063==    by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535)
==25063==    by 0x40CBAE: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1538)
==25063==    by 0x40FB55: virt_viewer_app_free_connect_info (virt-viewer-app.c:1707)
==25063==    by 0x40FBE9: virt_viewer_app_dispose (virt-viewer-app.c:1291)
==25063==    by 0x3DE40144F7: g_object_unref (gobject.c:2981)
==25063==    by 0x40C31A: main (remote-viewer-main.c:336)

==25063== 10 bytes in 1 blocks are definitely lost in loss record 491 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82)
==25063==    by 0x3DE3882F1A: g_vasprintf (stdio2.h:199)
==25063==    by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509)
==25063==    by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535)
==25063==    by 0x40DE36: window_update_menu_displays_cb (virt-viewer-app.c:1640)
==25063==    by 0x3DE383833F: g_hash_table_foreach (ghash.c:1524)
==25063==    by 0x3DE400F663: g_closure_invoke (gclosure.c:777)
==25063==    by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547)
==25063==    by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296)
==25063==    by 0x3DE40287C1: g_signal_emit (gsignal.c:3352)
==25063==    by 0x5772F95: gtk_widget_show (gtkwidget.c:3225)

==25063== 8,431 (72 direct, 8,359 indirect) bytes in 1 blocks are definitely lost in loss record 9,468 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE38616B1: g_slice_alloc (gslice.c:1003)
==25063==    by 0x3DE3861C05: g_slice_alloc0 (gslice.c:1029)
==25063==    by 0x3DE402F96F: g_type_create_instance (gtype.c:1872)
==25063==    by 0x3DE40147A7: g_object_constructor (gobject.c:1849)
==25063==    by 0x3DE4016260: g_object_newv (gobject.c:1632)
==25063==    by 0x3DE40168AB: g_object_new (gobject.c:1542)
==25063==    by 0x40C4BD: virt_viewer_util_load_ui (virt-viewer-util.c:41)
==25063==    by 0x40C7EB: virt_viewer_auth_collect_credentials (virt-viewer-auth.c:43)
==25063==    by 0x41B391: authenticate_cb (virt-viewer-session-ovirt.c:430)
==25063==    by 0x3458C05E8F: ffi_call_unix64 (unix64.S:75)

==25063== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 3,962 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE38616B1: g_slice_alloc (gslice.c:1003)
==25063==    by 0x3DE38629F2: g_slist_append (gslist.c:222)
==25063==    by 0x41483C: virt_viewer_window_init (virt-viewer-window.c:323)
==25063==    by 0x3DE402FA05: g_type_create_instance (gtype.c:1892)
==25063==    by 0x3DE40147A7: g_object_constructor (gobject.c:1849)
==25063==    by 0x3DE4015D70: g_object_newv (gobject.c:1713)
==25063==    by 0x3DE401655F: g_object_new_valist (gobject.c:1830)
==25063==    by 0x3DE4016893: g_object_new (gobject.c:1545)
==25063==    by 0x40DA34: virt_viewer_app_window_new (virt-viewer-app.c:590)
==25063==    by 0x40E300: virt_viewer_app_constructor (virt-viewer-app.c:1336)

==30355== 4 bytes in 1 blocks are definitely lost in loss record 53 of 9,267
==30355==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==30355==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==30355==    by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356)
==30355==    by 0x3DE40360FC: value_copy_string (gvaluetypes.c:276)
==30355==    by 0x3DE40340CA: g_value_transform (gvalue.c:535)
==30355==    by 0x3FDAE621DD: gdk_screen_get_setting (gdkevents-x11.c:3022)
==30355==    by 0x3FDB3C7415: gtk_settings_get_property (gtksettings.c:1152)
==30355==    by 0x3DE4017A74: g_object_get_property (gobject.c:1289)
==30355==    by 0x414991: virt_viewer_window_disable_modifiers (virt-viewer-window.c:616)
==30355==    by 0x415922: virt_viewer_window_keyboard_grab (virt-viewer-window.c:931)
==30355==    by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840)
==30355==    by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
2012-06-13 12:17:16 +02:00
Christophe Fergeau
2201a5adf4 Don't leak SPICE ticket 2012-06-13 12:17:11 +02:00
Marc-André Lureau
0341125ca4 spice: use weak references to display channel
Fix switch-host migration with Spice.

spice-gtk doesn't like channels staying around when they should be
destroyed/finalized, ie removed from session.

spice-gtk should probably learned to handle better the case of non
cooperating clients, and be able to dissociate a channel from a
session without waiting for it to be disposed, but for now, the
relation is quite tight.
2012-05-17 19:12:35 +02:00
Daniel P. Berrange
163b685332 Avoid use of deprecated GTK3 pointer APIs
The gtk_widget_get_pointer() API is deprecated in GTK3 since it
is not aware of multiple pointers. Replace its usage in autoDrawer.c
with GdkDeviceManager and friends

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
v0.5.3
2012-05-15 15:46:37 +01:00
Daniel P. Berrange
20c2703a77 Adapt to avoid use of deprecated GTK3 style & size APIs
The GtkStyle API has been deprecated in favour of GtkStyleContext.
Update ovBox.c to use the latter if building with GtK3. Also replace
use of the gtk_widget_size_request API with gtk_widget_get_preferred_size.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-05-15 14:46:13 +01:00
Marc-André Lureau
ceb38d1c20 Release v0.5.3 2012-05-15 02:45:34 +02:00
Marc-André Lureau
cffee9c27d nsis: fix .nsis file paths
- look up for icons under the DESTDIR directory
- don't ship gstaudiofx, unneeded
- add missing libtasn
2012-05-15 02:45:21 +02:00
Marc-André Lureau
8e1a8b3242 dist: ship .ico in tarball
Some distros (a 4-letters) don't have icotool.
Let's ship the .ico in the tarball.

The build will fail if icoutil is not installed when
building from git or when the .ico is absent. The error
should be explicit.
2012-05-14 23:27:20 +02:00
Marc-André Lureau
88893e30bc nsis: IE policy to launch silentely remote-viewer
Add IE ElevationPolicy for the remote-viewer client.

http://msdn.microsoft.com/en-us/library/bb250462%28v=vs.85%29.aspx
2012-05-14 17:43:34 +02:00
Marc-André Lureau
57f259fae6 nsis: fix removal of start menu directory 2012-05-14 17:43:34 +02:00
Daniel P. Berrange
d0de667ec2 Avoid race condition when disposing of app
When disposing of the VirtViewerApp, we free the hash table
containing the windows. This causes each window to be freed,
which in turn causes the visibility callback to be invoked.
This can then get NULL pointers from the self->priv->windows
usage.

Blank out priv->windows before unrefing the hashs and add
a check to ensure priv->windows is non-NULL.
2012-05-08 14:39:44 +01:00
Daniel P. Berrange
f34edd09cb Ensure windows are destroyed when display closes
When running virt-viewer with the --reconnect argument, when
the session closes, the VirtViewerWindow instances were being
freed, but not the GtkWindow itself. So the orphaned window
stayed around doing nothing. The GtkBuilder instance was also
leaked.

Fix these two leaks & also add some debugging to help future
troubleshooting
2012-05-04 17:22:44 +01:00
Daniel P. Berrange
d0d226ca8f Change 'OK' button to 'Close' button in USB device selection
The USB device selection applies immediately, so the dialog
should be using 'Close' instead of 'OK' for its primary button
2012-05-02 13:02:22 +01:00
Christophe Fergeau
90b3edc396 g_getenv returns a const string
When switching from getenv to g_getenv, 'doms' declaration
wasn't changed from char * to const char *, which causes
a gcc warning.
2012-04-27 15:20:53 +02:00
Daniel P. Berrange
4a604360c4 Replace getenv/setenv with g_getenv/g_setenv for Win32 portability 2012-04-26 10:08:31 +01:00
Daniel P. Berrange
7d32705779 Add debugging when performing fullscreen auto-configuration 2012-04-25 18:25:31 +01:00
Daniel P. Berrange
895bebd4ae Refresh translations from transifex 2012-04-25 15:52:24 +01:00
Daniel P. Berrange
06d62c4b02 Really fix debug output on glib >= 2.31 2012-04-25 15:31:05 +01:00
Daniel P. Berrange
5887eb07b8 Fix debug output on glib >= 2.31 2012-04-25 15:30:31 +01:00
Daniel P. Berrange
dfbc9d2e8f Set the remote-viewer binary application name
Currently the window titles for remote-view have 'remote-viewer'
appended them. This is based off the argv[0] name. We should be
setting the GLib application name though, so we can get a localized
'Remote Viewer' string in the titlebar
2012-04-23 11:04:10 +01:00
Daniel P. Berrange
7ab88ea179 Add support for raw IPv6 addresses in VNC & libvirt URIs
Support   vnc://[x:y:z:]:5901/  for raw IPv6 addresses in URIs,
and qemu+ssh://root@[x:y:x:]:22/ for raw IPv6 addresses in
libvirt URIs
2012-04-23 09:42:34 +01:00
Daniel P. Berrange
c1af3ab0cc Fix scaling of window to avoid integer truncation
Use round() instead of integer truncation when scaling the window,
to avoid floating point precision problems on i386
2012-04-19 16:18:31 +01:00
Daniel P. Berrange
be3ce01096 Add a desktop file for launching remote-viewer
Enable automagic handling of spice:// URLs in firefox by
registering a desktop handler for remote-viewer with the
SPICE URI scheme
2012-04-18 14:12:57 +01:00
Daniel P. Berrange
8ae777a5f7 Give remote-viewer priority over spicec for spice-xpi-client 2012-04-17 15:06:14 +01:00
Daniel P. Berrange
ad5d29da5e Add manpage docs for the --attach option 2012-04-17 12:42:39 +01:00
Daniel P. Berrange
812ca0d650 Fix manpage to s/--fullscreen/--full-screen/ 2012-04-17 12:40:49 +01:00
Christophe Fergeau
37171c465f Fix automatic usb redir through controller
remote-viewer is currently trying to use
SpiceUsbDeviceManager::auto-connect to control whether USB devices
should be automatically connected or not. However, this property
is more or less an internal spice-gtk property which is toggled
by SpiceGtkSession when the SPICE widget gets/loses focus.

SpiceGtkSession has an "auto-usbredir" property which can be used
by applications to enable/disable automatic usb redirection through
SPICE. Since this property is helpfully bound to
VirtViewerSession::auto-usbredir, use this when the controller
is told to enable/disable USB redirection.

Without this change, automatic USB redirection will always get reenabled
as soon as there's a focus change since SpiceGtkSession::auto-usbredir
defaults to be enabled in spice-gtk.
2012-04-17 10:11:09 +02:00
Daniel P. Berrange
521116f51b Ensure windres & icotool are present on Win32 builds
Builds are failing with an obscure error message

make[3]: Entering directory `/var/lib/builder/source-root/virt-viewer/build/icons'
  GEN    virt-viewer.ico
/bin/sh: -c: command not found
make[3]: *** [virt-viewer.ico] Error 127

This is because configure.ac does not enforce that icotool
is present on Win32.

* configure.ac: Mandate windres & icotool on Win32
2012-04-05 12:07:09 +01:00
Daniel P. Berrange
9a5d978f46 Require F17 for spice in RPM builds 2012-04-05 10:17:01 +01:00
Daniel P. Berrange
35a6112ef5 Exclude windows-cmdline-wrapper.c from some syntax check rules 2012-04-05 09:27:46 +01:00
Daniel P. Berrange
bbbf9414db Add Yonit to authors file 2012-04-05 09:27:34 +01:00
Daniel P. Berrange
2bd7c82ded Fix some syntax violations in git.mk 2012-04-05 09:27:24 +01:00
Zeeshan Ali (Khattak)
6109d5257d Minor simplification/optimization of VirtViewerDisplay 2012-04-05 09:24:59 +01:00
Daniel P. Berrange
dc22bb1221 Fix typo in variable names for Win32 command helper 2012-04-04 10:41:32 +01:00
Daniel P. Berrange
831ebf5dab Fix close of VNC displays
When clicking the close button on a virt-viewer window with
a VNC session open, while the VNC session terminates, the
window does not go away.

The problem is that the virt_viewer_session_vnc_disconnected
method never gets invoked. The close button triggers a call
to virt_viewer_session_clear_displays which unrefs the
VirtViewerDisplayVnc instance. This in turn triggers a call
to gtk_container_destroy, which destroys all widgets it
contains, ie the VncDisplay * object.

With the VncDisplay object in its dispose phase, no signals
will ever be emitted, thus the 'vnc-disconnected' signal
never gets seen.

The design issue is that VirtViewerDisplayVnc is assuming
it owns the VncDisplay, whereas in fact the real owner is
the VirtViewerSessionVnc object.

The solution is to introduce a new virt_viewer_display_close
method which can be used to de-parent the widget before
VirtViewerDisplay is unref'd.

The VirtViewerSessionVnc object also needs to hold a full ref
on the VncDisplay object, not merely a floating reference

* virt-viewer-display-spice.c, virt-viewer-display.c,
  virt-viewer-display.h: Add virt_viewer_display_close
* virt-viewer-display-vnc.c: Deparent VNC widget in
  virt_viewer_display_close impl
* virt-viewer-session-vnc.c: Improve logging
* virt-viewer-session.c: Call virt_viewer_display_close
  before unrefing display
* virt-viewer-window.c: Improve logging

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-04 10:41:32 +01:00
Christophe Fergeau
e76beedf1f Propagate USB redirection controller messages 2012-04-04 10:32:28 +02:00
Yonit Halperin
63feed3d4e Add support for the SPICE properties disable-effects & color-depth
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-03 18:48:34 +01:00
Christophe Fergeau
95e42b9cec build-sys: fix Windows specific LDFLAGS on non-mingw 2012-04-03 14:07:21 +02:00
Marc-André Lureau
edf1715a2e nsis: fix a few missing icons 2012-04-03 00:06:19 +02:00
Marc-André Lureau
2a72130eb0 nsis: add the remote-viewer cmdline wrapper 2012-04-02 23:56:50 +02:00
Marc-André Lureau
db1b308a63 remote-viewer: make it a GUI/windows application with hybrid console
If the application can attach to its parent console, redirect
input/output. So that will work nicely with the command line wrapper.
2012-04-02 23:56:50 +02:00
Marc-André Lureau
55477f9f20 Add a Windows command line wrapper
Add a small command line wrapper, to be able to call GUI/windows application from the console
2012-04-02 23:56:49 +02:00
Marc-André Lureau
a48856f10e Disable mnemonics via gtk-enable-mnemonics settings
This has 2 advantages, and I can't figure any drawback:
- it fixes the issue of mnemonic hints being draw when pressing Alt
  key (character underlined), even when they were disabled.
- it simplifies the code :)
2012-04-01 20:09:16 +02:00
Marc-André Lureau
261b692657 Disable menu items that would fail when there is no display 2012-04-01 20:09:16 +02:00
Marc-André Lureau
ffb17ce387 build-sys: simplify autogen.sh
It should support NOCONFIGURE=1 ./autogen.sh && mingw32-configure
2012-04-01 20:09:16 +02:00
Marc-André Lureau
81c2c3bfec build-sys: use git.mk to generate gitignore
This makefile is just fantastic, it forces you into good practices,
support various build targets (my windows builddir ignore the right
files etc..)

The more I use it, the more I like it.
2012-03-30 14:48:13 +02:00