484 Commits

Author SHA1 Message Date
Marc-André Lureau
dca7397f16 win32: there is no CONERR$, only CONOUT$ 2012-10-23 11:17:04 +02:00
Marc-André Lureau
3bb6f5ec80 spice: only autoresize once with screen size in fullscreen
It's currently not possible to configure guest with higher resolution
than native, as it will switch back to native, since the gtk widget
allocation will always end up being the size of the screen. We
special-case fullscreen mode, and only resize when entering
fullscreen. Furthermore, it avoids sending extra unnecessary resize
events to the guest whenever gtk+ call size allocate in various
stages, with different values.

https://bugzilla.redhat.com/show_bug.cgi?id=864929
2012-10-18 00:44:36 +02:00
Marc-André Lureau
435a542de2 spice: avoid rounding issues when scaling up display
Fix some unwanted guest resize due to rounding issues (at least when
scaling up)

We may want to save the original remote desktop size, instead of
always checking widget requisition. That way zooming shouldn't resize
guest at all, but it seems tricky to handle that special case vs user
window resize that should trigger guest resize.

https://bugzilla.redhat.com/show_bug.cgi?id=856678
2012-10-17 16:50:14 +02:00
Marc-André Lureau
143bc8a33f Do not resize window to minimum when toggling auto-resize
The virt_viewer_display_idle() will queue a resize event that will
result in display size requisition of 50x50. If we later resize the
window to 1x1 in virt_viewer_window_resize() we end up with a tiny
window.

It is legitimate not to force that 1x1 window resize when toggling the
option. After the rest of the logic in virt_viewer_window_resize(), if
the remote desktop ends up being resize, that will trigger another
virt_viewer_set_desktop_size() and finally change the window size
appropriately.

https://bugzilla.redhat.com/show_bug.cgi?id=856610
2012-10-16 20:41:47 +02:00
Daniel P. Berrange
dcbd306051 Add RPM magic to run autoreconf
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-12 19:29:00 +01:00
Daniel P. Berrange
c4bfbe104f Fix check for IPv6 any address
The string '::' is just one of many possible ways to express
the IPv6 "any" address. Others include  '::0', '0:0:0:0:0:0:0:0',
'0::0' and more. Instead of trying to do strcmp, actually try
parsing the address with GInetAddress and then simply use an
accessor to check what type it is

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-10 16:28:38 +01:00
Daniel P. Berrange
fe485f22de Allow user to set a window title for remote-viewer
Currently the remote viewer windows get the URI as their
title. Provide a --title STRING arg to remote-viewer to
let the user override the title with something more
meaningful to them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-09 17:25:19 +01:00
Christophe Fergeau
a4e588e3ea Don't free SPICE ticket twice
Commit 2201a5a was supposed to free a SPICE ticket leak, but it's
actually introducing a double-free as the SPICE ticket is
unconditionally freed at the end of
virt_viewer_session_spice_main_channel_event
2012-10-01 18:41:26 +02:00
Christophe Fergeau
d5bbe725d3 Append \n to message in virt_viewer_app_trace
Callers manually add a trailing \n when they call virt_viewer_app_trace,
but it's sometimes forgotten, leading to rhbz#822794. This commit
removes the \n from all callers (it was missing in a few of them)
and adds it in virt_viewer_app_trace.
2012-09-18 15:55:38 +02:00
Daniel P. Berrange
0f85fca802 Refresh translations
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-09-18 14:28:42 +01:00
Daniel P. Berrange
c36c848904 Update for 0.5.4 releae v0.5.4 2012-09-17 11:53:12 +01:00
Daniel P. Berrange
a732a94df3 Use a more specific regex to fix enum include paths
Simply doing a search replace on $(srcdir) doesn't work very
well in non-VPATH builds. Use a more specific regex that won't
generate false matches
2012-09-14 18:00:27 +01:00
Daniel P. Berrange
f8c6065330 Look in builddir for icons & strip build dir prefix from enum file includs 2012-09-14 17:35:31 +01:00
Daniel P. Berrange
879517fe46 Don't include generated icons in tar.gz and clean them up 2012-09-14 17:35:10 +01:00
Daniel P. Berrange
c8e0550a82 Convert to use Mingw64 toolchain for Windows biulds 2012-09-14 17:34:53 +01:00
Christophe Fergeau
c5d4570c11 Document -f=auto-conf in remote-viewer --help
virt-viewer does not support -f=auto-conf so this does not change the
option there.
Fixes rhbz#718001
2012-08-13 15:51:48 +02:00
Christophe Fergeau
3d43a9f455 Use real binary name in help message
Now that we have 2 distinct binaries, remote-viewer and virt-viewer,
'PACKAGE' can no longer be used in error messages as the name of the
binary. This causes a small inconsistency when running
'remote-viewer --foobar' as the error message would be:
'Unknown option --foobar
Run 'virt-viewer --help' to see a full list of available command line options'

This commit makes sure we use argv[0] for this message.
Fixes rhbz#814150
2012-08-10 15:50:46 +02:00
Marc-André Lureau
e88f5a52cf Show status page by default if display not ready
Switch back to status page if display is not ready.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
98ac529c0a Make status widget visible immediately
GtkNotebook will use the currently visible widget as default page.
If we don't show status widget before we append the display, the
current page will be on display. Quoting Gtk+ documentation:

"Note that due to historical reasons, GtkNotebook refuses to switch to
a page unless the child widget is visible. Therefore, it is
recommended to show child widgets before adding them to a notebook."
2012-07-23 16:27:33 +02:00
Marc-André Lureau
527a7182d6 vnc: when session is disconnected, make the display as non-ready 2012-07-23 16:27:33 +02:00
Marc-André Lureau
5de6af3095 Simplify display flag handling 2012-07-23 16:27:33 +02:00
Marc-André Lureau
85d5658b63 Add VirtViewerSession::session-display-updated
Rebuild menu when agent is connected. Only when the agent is running
may a display be enabled/disabled.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
8006302fef Make the display submenu insensitive if display can't be selected 2012-07-23 16:27:33 +02:00
Marc-André Lureau
57bf1e9090 spice: factor out main channel lookup code 2012-07-23 16:27:33 +02:00
Marc-André Lureau
6f9c7a624e Add VirtViewerDisplay::selectable property
This property will be set when the display can be selected to be
"enabled" and shown (this can involve creating/connecting an
additional guest monitor, and may need guest agent cooperation for
example).
2012-07-23 16:27:33 +02:00
Marc-André Lureau
37c30a4569 Add virt_viewer_window_get_display()
Getter used in following changes.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
0d58d9c729 Hook up handling of Monitors
Rely on spice-gtk display channel monitors property to manage
displays. The same display channel may now provide several monitors,
the SpiceDisplay widget must be told which monitor to display
2012-07-23 16:27:33 +02:00
Marc-André Lureau
c8d20b35bd Bump glib > 2.22, add compat file
We use API from 2.22, and some from further version. Add
virt-glib-compat.h fallback file for those.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
db7c5b20b0 Use SpiceDisplay:ready property instead of channel mark
The display can now check several conditions before the display can be
shown, use that instead of display mark, which was not high-level
enough.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
f3097fcca9 Number display starting from 1 2012-07-23 16:27:32 +02:00
Marc-André Lureau
90b67222d1 Prevent from adding the same display several time in the session
In virt_viewer_session_spice_display_monitors(), we (re)add the
display unconditionnaly every time we receive a new MonitorConfig.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
2a085766f1 Add a DISABLED display hint
This flag will help to track whether the display has been
removed/closed and whether it really has a valid display.

Ready in contrast, is used to "hide" temporarily the display (when
starting or redrawing the display, to avoid artifacts)
2012-07-23 16:27:32 +02:00
Marc-André Lureau
0897382b45 Use virt_viewer_connect_object() for display
When display is released, detach signal automatically.

Fix various crash related to not cleaning up signal handlers properly,
due to no longer 1-1 only relation between display widget and channel.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
cab1ab0e57 Rebuild display menu when a window is added or removed 2012-07-23 16:27:32 +02:00
Marc-André Lureau
9c15005026 Mark a menu string as translatable 2012-07-23 16:27:32 +02:00
Marc-André Lureau
02b326f80b Run-time check values before doing bad computation 2012-07-23 16:27:32 +02:00
Marc-André Lureau
560767b573 Turn display:show-hint into flags type 2012-07-23 16:27:32 +02:00
Marc-André Lureau
3b70561666 Destroy dialog immediately after run
If the parent is already destroyed, it looks like the dialog is
destroyed too. This avoids a crash when calling app_quit().
2012-07-23 16:27:32 +02:00
Marc-André Lureau
7cf00ea8d2 build: generate enums type boilerplate 2012-07-23 16:27:32 +02:00
Marc-André Lureau
c6c335799d spice: disconnect signal handlers when either object is destroyed
Use virt_viewer_signal_connect_object(), a copy of telepathy
utility function tp_g_signal_connect_object(). This function
will take care of removing signal handler if any of emitter or
attached object are destroyed.

The following patches will have this condition met, since there is no
longer 1-1 relation between channel and display. The channels can
continue to be around when some of the display are removed.
2012-07-23 16:27:32 +02:00
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