Commit Graph

34 Commits

Author SHA1 Message Date
Jonathon Jongsma
5c0ed8a99f Session: add vfunc to check auth retry capability
The spice session implementation can retry authentication on its own,
whereas the vnc session needs to tear down the session and re-connect in
order to retry a failed authentication. Add API to determine this so
that we can clean up some code related to authentication failures.
2015-06-19 14:39:48 -05:00
Marc-André Lureau
526757b01f Add virt_viewer_session_can_share_folder()
Functions name says it all, it is only implement for Spice, checking
for webdav channel presence.
2015-03-05 21:31:31 +01:00
Marc-André Lureau
6f057f24dd Add a few session properties for share folder
See properties comments for details.
2015-03-04 16:39:14 +01:00
Jonathon Jongsma
f0d662994f Don't try to re-configure displays when there are none
virt_viewer_session_on_monitor_geometry_changed() gets called
immediately upon agent connection, but sometimes this is before any
displays have been received. Simply return early when this is the case.
2014-10-27 10:37:31 -05:00
Jonathon Jongsma
8fa5e004ec Shift top-left display to origin
When using a custom fullscreen display configuration, it's possible to
specify that e.g. a single screen should be fullscreen on client
monitor #4. Since we send down absolute positions and disable alignment
when all windows are in fullscreen, we can send configurations with a
very large offset to the top-left corner. This could result in the guest
trying to create a screen that was much larger than necessary. For
example when sending a configuration of 1280x1024+4240+0, the guest
would need to allocate a screen of size 5520x1024, which might fail if
video memory was too low. To avoid this issue, we shift all displays
so that the minimum X coordinate for all screens is at x=0, and the
minimum y coordinate is at y=0.
2014-10-27 10:37:31 -05:00
Jonathon Jongsma
221d5f5cd4 Move monitor alignment function to util header 2014-10-24 09:14:09 -05:00
Fabiano Fidêncio
e85ae4c27c Force displays to update geometry when agent connects
We have to force displays to update geometry when the agent connects to
ensure the client will have the guest with the right resolution when the
guest has rebooted or the agent has crashed.

https://bugzilla.redhat.com/sho_bug.cgi?id=1021841
2014-08-19 18:11:48 +02:00
Marc-André Lureau
225dff3cb0 app: report disconnection error details
It may be useful to provide more detailed reason for disconnection.

https://bugzilla.redhat.com/show_bug.cgi?id=1115986
2014-07-08 16:36:52 +02:00
Christophe Fergeau
14f3041930 Don't use C99 for loops
Declaring a local variable as part as a for loop
such as 'for (unsigned int i; i < N; i++)' is a C99 specific feature.
Running configure with --enable-compile-warnings=minimal does not add
-std=c99 to the compile flags, so it's better if the codebase does not
require C99 support from the compiler.
2014-06-26 21:22:18 +02:00
Jonathon Jongsma
03bf8d3051 Create a sparse array for monitor-geometry-changed
It's possible to have only display N enabled without having all of the displays
before it. I experienced this a couple times with a windows guest where display
1 would show up before display 0 and we'd hit a warning that nth is not less
than nmonitors. So find the highest display ID and then create an array of that
size, leaving missing displays initialized to 0
2013-11-27 10:35:22 -06:00
Jonathon Jongsma
33614f86db Do all display alignment in virt-viewer
Don't rely on spice-gtk to do any alignment of displays.  This patch sets the
disable-display-align property on the SpiceMainChannel, and makes the
VirtViewerSession in charge of doing all alignment. This means that every
display has to tell the VirtViewerSession when its "virtual monitor" has changed
configuration (and wants to reconfigure its display on the guest), rather than
sending it directly to the Main Channel.  The session will then align the
displays (if necessary), and the spice session will send down new configuration
for all displays at once. This solves a couple of problems:

1. It allows the session to send down absolute coordinates only in the case
   where *all* windows are fullscreen (so that we can still support
   vertically-stacked displays, etc).  But it auto-aligns displays if only a
   subset of the displays are in fullscreen mode. This solves the problem of
   overlapping regions on different displays when one monitor is in fullscreen
   because only one monitor's configuration was updated and the others were not
   aligned.
2. Allows us to always align based on the current position of each display. This
   contrasts with the earlier behavior where the position used for alignment was
   the window's position at the time when it was last resized. This caused
   displays to be arranged in a seemingly non-deterministic manner if one window
   was moved and then another window was resized (causing a display
   re-configuration).

Solves rhbz#1002156
2013-11-27 10:35:22 -06:00
Christophe Fergeau
307b0d001d Add VirtViewerSession::software-smartcard-reader property
This property will be set to TRUE when a software smartcard reader
is available, and FALSE otherwise. This property can only be TRUE
when using SPICE and when smartcard support is enabled, and when
both smartcard certificates and smartcard db directory are set.
2013-07-31 11:33:16 +01:00
Marc-André Lureau
05333f0e93 Remove dead function 2013-07-30 20:26:35 +02:00
Hans de Goede
999b734865 usbredir: Don't depend on channel ordering
Before this patch-set virt-viewer was calling spice_session_has_channel_type(
session, SPICE_CHANNEL_USBREDIR) from the session-initialized signal handler,

So as soon as the display channel gets added to the session, the check was
done. This causes the check to return FALSE for usbredir capable vms if
the usbredir channel(s) get added to the session after the display channed.

This patch refactors things to not depend on channel creation order.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-07-06 09:03:30 +02:00
Marc-André Lureau
13f493200c Allow app_initial_connect() to raise an error 2013-03-08 16:54:01 +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
ddfcc61c87 session: add virt_viewer_session_mime_type() 2012-11-27 19:04:35 +01: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
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
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
Marc-André Lureau
7d3dbb57b0 remote-viewer: add a simple connection dialog
If the user doesn't provide URI, let's show a simple dialog to enter it.

Also save & list recently used URLs in that dialog.
2012-03-29 02:28:51 +02:00
Marc-André Lureau
cf8e5b029c spice: implement --fullscreen=auto-conf
- auto-conf is an optionnal argument to --fullscreen:
it will set the guest display configuration to match the client
display configuration, by sending the client monitors size and
position to capable guests.
2012-03-21 16:20:37 +01:00
Marc-André Lureau
6c916253ee Add smartcard-{insert,remove} and release-cursor virtual methods 2012-02-22 16:44:11 +01:00
Daniel P. Berrange
a52b9f3182 Extract tlsPort for SPICE and use it to enable secure connections 2012-02-14 14:53:59 +00:00
Daniel P. Berrange
a893d5ef61 Update copyright headers 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
e1283a9a60 Convert TABS to spaces & reindent everywhere 2012-02-06 12:40:09 +00:00
Hans de Goede
c67a8cfdbe Only make the USB device selection sensitive when the vm is USB capable 2012-02-06 12:30:27 +00:00
Hans de Goede
b272e08541 Add a menu entry for USB device selection 2012-02-06 12:30:08 +00:00
Guannan Ren
8a6cb8c012 Register a new signal session-cancelled 2012-01-31 14:35:17 +00:00
Guannan Ren
c61981540d Tune the first argument in calls to g_type_class_add_private() 2012-01-31 14:34:47 +00:00
Marc-André Lureau
dfb26d59b0 Enable spice auto-usbredir 2012-01-31 13:20:26 +00:00
Marc-André Lureau
0084b1cfaa Add error dialog for USB redirection failure 2012-01-31 13:20:26 +00:00
Marc-André Lureau
629ddc1b5d Add virt_viewer_session_open_uri 2012-01-30 17:10:18 +00:00
Daniel P. Berrange
1def55556f Split pull part of VirtViewerDisplay out into VirtViewerSession
To facilitate introduction of multi-head support, pull some of
the VirtViewerDisplay class out into a new VirtViewerSession
class.
2011-07-11 20:03:32 +01:00