Commit Graph

524 Commits

Author SHA1 Message Date
Marc-André Lureau
c0a2f9dfd5 file: add username support 2013-01-18 12:28:58 +01:00
Hans de Goede
008491a2d9 Make hotkey configuration functionality available from the cmdline (v2)
Changes in v2:
-Add --hotkeys documentation to the man-pages

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-12-21 10:54:27 +01:00
Hans de Goede
aecd80ec77 Add a virt_viewer_app_set_hotkeys() helper function
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-12-21 10:39:29 +01:00
Christophe Fergeau
0577c703fb Improve check for overridden grab key combination
remote-viewer can either use the default grab/ungrab handled by
spice-gtk, or override it and use the standard gtk+ accelerator
mechanism. However, the code currently assumes that if any accelerator
is set in remote-viewer, then the grab key has been overridden.
This commit makes sure the grab key is actually overridden before assuming
so.
2012-12-20 12:22:14 +01:00
Christophe Fergeau
d01097eed2 Don't leak SpiceGrabSequence in enable_accel_changed 2012-12-20 12:22:12 +01:00
Christophe Fergeau
cae0a491c6 Improve hotkeys controller behaviour
Disable default accelerators when setting bindings from the controller
in case the controller does not override them all. This ensures we don't
inherit from the bindings set in VirtViewerApp::constructor if the controller
doesn't set any bindings for a given action.
2012-12-20 11:59:30 +01:00
Marc-André Lureau
346f35c87b Use monitor geometry, not screen size
In a recent commit, 3bb6f5ec80, I
introduced a regression: going fullscreen would no longer match client
and guest resolution correctly.

A GdkScreen is not necessarily the physical screen monitor size.
Lookup the physical monitor size using
gdk_screen_get_monitor_geometry().

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=881020
2012-12-07 14:55:27 +01:00
Michal Privoznik
3b810b7768 session-spice: Cast CA string to gunit8 pointer
SpiceSession has 'ca' property which is type of GByteArray*.
However, when we read the property from file, we read it as
string. For conversion g_byte_array_new_take() is used which
takes given pointer as guint8* so we need to do the cast.
2012-12-05 16:29:11 +01:00
Michal Privoznik
5c9955df09 Sanitize syntax-check
make syntax-check is producing some errors about empty line at EOF
and missing #include <config.h> in src/virt-viewer-file.c

* src/virt-viewer-file.c: add #include <config.h>
* data/virt-viewer-debug.nsis.in: remove empty line at EOF
2012-12-05 16:28:21 +01:00
Doug Goldstein
0f6b286e7a Make .desktop file comply with spec
The .desktop file did not comply with the Desktop Entry spec as checked
with desktop-file-validate. Boolean keys are defined as taking only
'true' or 'false', the entry Terminal had False. MimeType is a string
list and therefore must be terminated with a ;
2012-12-05 12:18:10 +01:00
Marc-André Lureau
09b9add92f remote-viewer: learn to connect from file
v2:
- move some variables to inner-block as requested by reviewer
2012-11-27 20:09:59 +01:00
Marc-André Lureau
c218d43b48 spice: learn to connect from file 2012-11-27 20:09:59 +01:00
Marc-André Lureau
79bdf3b177 Add VirtViewerSession:file property
If VirtViewerSession:file is set, it should be used to define the
connection parameters. Also correct the mime type used in this case.

The mime type is needed to identify the kind of resources we are
adding to the recent list. The recent list can then be filtered and
various application handling that type may attempt to access that
resource.
2012-11-27 20:08:01 +01:00
Marc-André Lureau
a0bbb6878d Add VirtViewerFile
v2:
- use !! for boolean values setter
- switch from bytearray/base64 to plain string for CA (PEM)
- add file format comment
2012-11-27 20:07:10 +01:00
Marc-André Lureau
4bf7aabbf3 Move spice_hotkey_to_gtk_accelerator() to util
To be compatible with RHEVM, VirtViewerFile hotkey format will use the
Spice Controller format.
2012-11-27 20:07:10 +01:00
Marc-André Lureau
fe4014f023 recent: get mime type from session
Do not use spice mime type for all kind of sessions, but depending on
what is actually being used.
2012-11-27 20:07:07 +01:00
Marc-André Lureau
ddfcc61c87 session: add virt_viewer_session_mime_type() 2012-11-27 19:04:35 +01:00
Marc-André Lureau
9f5192f117 debug.nsis: remove superflous path 2012-11-27 12:37:29 +01:00
Marc-André Lureau
0dca975d64 display: only un-constrain display size once it is mapped
Wait until the widget is actually on screen before removing its
size constrain. This solves 50x50 window secondary window size
when connecting to a multi-monitor spice guest.
2012-11-27 12:36:27 +01:00
Marc-André Lureau
03c3e4d08e Add virt-viewer-debug.exe NSIS installer
This installer will provide with the tools and configuration needed to
debug virt-viewer & remote-viewer. It will install itself by default in
virt-viewer directory.
2012-11-23 16:05:57 +01:00
Michal Privoznik
7c00b1a803 debug-helper: include <config.h> 2012-11-21 17:35:54 +01:00
Michal Privoznik
e56c7a0507 AUTHORS: add Dave Allan
as he has supplied patch (commit 74b1b62510).
2012-11-21 17:35:54 +01:00
Michal Privoznik
68f2d1fced cfg.mk: Don't require bindtextdomain directly
With current implementation, all binaries that need it call
bindtextdomain but not directly. They call a helper function
instead.  This makes, however, syntax-check fail as it cannot
recognize it.

Original patch proposed by Eric Blake <eblake@redhat.com>
2012-11-21 17:35:53 +01:00
Marc-André Lureau
30b5366e66 spice: the session is connected when main channel opened
The previous change in 399aae55aa rely
on correct session-connected signal. However, the spice backend
is emiting it too early, when the main channel is created, where
it should wait until it is connected instead.
2012-11-21 00:32:00 +01:00
Marc-André Lureau
399aae55aa "Unable to connect to the graphic server" error on guest shutdown
In virt_viewer_app_activate(), priv->connected is set to FALSE when
the connect/active is successfull. However, we rely on it to know
whether the virt_viewer_app_disconnected() is an error, so only set it
to FALSE when connection failed.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=875697
2012-11-20 12:59:56 +01:00
Marc-André Lureau
a4805a3bb8 build-sys: add min libvirt version requirement check 2012-11-16 18:19:16 +01:00
Christophe Fergeau
8a7aa6a1e1 Make sure png screenshots have a .png extensions
When falling back to saving to .png, the filename might not
end with .png. This commit appends the .png extension to the
screenshot filename if it's missing.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
f9935c832b Allow to save to other formats than png
Currently, the screenshots can only be saved to png. This commit
checks if the file extension is a known one, and will save to this
format if it is. Otherwise it will fallback to saving to png.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
45a791082e Set a default dir/name for screenshots
It makes sense for the screenshots to be saved in ~/Images,
especially as otherwise the filechooser will display
'recent documents' to which we cannot save. This commit also sets
the default screenshot name to 'Screenshot'.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
6d35a443da Fix spice-gtk check in configure.ac
The check that at least one of spice-gtk and gtk-vnc is present
uses a wrong variable name to check for spice-gtk presence, which
causes the check to think it's never present. This would make
gtk-vnc presence mandatory. This commit fixes the name of the
spice-gtk variable ($have_gtk_spice -> $have_spice_gtk).
2012-11-15 10:21:03 +01:00
Michal Privoznik
9983fe74dd Don't SIGSEGV if no transport is used.
One of previous commits (74b1b62510) allowed us to connect to
localhost directly if ssh transport was used. However, if there's
not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as
one of arguments. Change this to g_strcmp0 which does the same
service but is more friendly to NULL arguments.
2012-11-14 15:20:58 +01:00
Michal Privoznik
fa39c5335c Reconnect to libvirtd after connection breaks
Currently, if user wants to reconnect to a domain he can use
'-r' cmd line argument. This makes virt-viewer listen to
domain events. However, if connection to libvirtd breaks
somehow, we will receive no longer any event. Hence we must
reconnect to the libvirt.
2012-11-13 15:23:51 +01:00
Dave Allan
74b1b62510 Connect to localhost for display when transport is ssh
When connecting to a VM that does not have a 'listen' tag in its
graphcs element, we have to guess where to try to connect to the VM's
display.  The current default is the host specified in the connection
URI which is correct for most transports, however, the SSH transport
makes the display connection from the remote end, so in that case,
attempt to connect to localhost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-11-08 17:44:18 +01:00
Guido Günther
7083a07a92 Fail if neither vnc nor spice is detected
Since the viewer makes little sense otherwise.
2012-10-25 12:14:33 +02:00
Marc-André Lureau
8b06fb7319 Fix jenkins build failure
virt-viewer-util.c: In function 'virt_viewer_util_init':
virt-viewer-util.c:289: warning: implicit declaration of function 'setlocale'
virt-viewer-util.c:289: warning: nested extern declaration of 'setlocale'
virt-viewer-util.c:289: error: 'LC_ALL' undeclared (first use in this function)
virt-viewer-util.c:289: error: (Each undeclared identifier is reported only once
virt-viewer-util.c:289: error: for each function it appears in.)
2012-10-23 15:59:38 +02:00
Marc-André Lureau
93da043657 Use a mutex to check if VirtViewer running
We need to warn user that installer can't proceed if there is already
a running instance of VirtViewer or of the installer.

https://bugzilla.redhat.com/show_bug.cgi?id=864033
2012-10-23 14:49:23 +02:00
Marc-André Lureau
14a1d48745 Use a common early init() function
There is a number of things both virt-viewer and remote-viewer need to
do early during execution. Do it only in one place.
2012-10-23 14:49:23 +02:00
Marc-André Lureau
53c6549fb4 windows: add debug-helper
This is a simple program that will set some debug variable, and run
gdb and wait until it finished. This makes it possible to debug
"remote-viewer --spice-controller" easily, by setting the necessary
variables and keeping the parent process running (the activex whatches
its death)

To use it, replace the HKCU "Software\spice-space.org\spicex\client"
value "$INSTDIR\bin\remote-viewer.exe --spice-controller" with
"$INSTDIR\bin\debug-helper.exe remote-viewer.exe --spice-controller".
2012-10-23 14:49:18 +02:00
Marc-André Lureau
08db836b13 nsis: add deps.txt file in installer
This helps track package version that were used during the
build of Windows installer. It's not ideal, but make up the
lack of package management on windows
2012-10-23 11:17:05 +02:00
Marc-André Lureau
e5895ce49f nsis: update required files and libraries 2012-10-23 11:17:05 +02:00
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