Commit Graph

737 Commits

Author SHA1 Message Date
Christophe Fergeau
2f890cf2f5 Hide all windows on disconnection
When starting remote-viewer without argument, we are showing a
window where the user can enter connection details. We then
go on to try and connect to the URI the user specified, and if
the connection fails, we disconnect from the remote server, and then
we show again the connection window so that the user can correct the
URI if he entered it wrong.
However, when this happens, the window for the previous connection
will still be visible even if connection failed. To avoid this,
this commit makes sure we hide all windows when we get a disconnection
event.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
2013-11-13 11:29:05 +01:00
Christophe Fergeau
06b2c38246 Reshow connection dialog on errors
remote-viewer behaviour is currently inconsistent in the connection dialog:
if the user enters a valid URI, but then remote-viewer fails to connect
to it, then we'll show again the connection dialog through a call
to virt_viewer_app_start() in remote_viewer_deactivated(). If instead we
enter an invalid URI in the connection dialog, then remote-viewer will
report an error and quit.

This commit makes sure in the latter case, we report the error and show
again the connection dialog. The user can press 'Cancel' in the
connection dialog to get out of remote-viewer as in this case, we
return directly FALSE rather than going through the cleanup: label
and looping.
2013-11-13 11:29:05 +01:00
Christophe Fergeau
30bb4019fd Handle virt_viewer_app_start() errors
remote_viewer_deactivated() can be calling virt_viewer_app_start()
without checking whether it returns TRUE or FALSE. It returns FALSE
when it was not successful (when it failed to parse the URI to connect
to for example, or whe the user presses Cancel in the connection dialog).

This means that if the user starts remote-viewer, enters a valid URI
in the connection dialog to which it cannot connect to
(spice://example.com:999) and then presses Cancel in the connection
dialog that appears after the connection  failure, then remote-viewer
will be sitting there with an empty window doing nothing.

This commit ensures we chain to the parent class when
virt_viewer_app_start() returns FALSE, which causes remote-viewer to
exit.
2013-11-13 11:29:05 +01:00
Christophe Fergeau
b19a246c5c Fix window title after failed connection
When using the connection dialog, if the user picks an invalid
URI first causing a failed connection, and then picks/enters a valid
URI, remote-viewer window title will be set to the first invalid URI,
not to the second one which was entered.

As the user may have specified a window title to use on the command
line (-t option), we need to be careful not to override that when
setting the window title on the second attempt.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
2013-11-13 11:29:05 +01:00
Christophe Fergeau
24877bc546 build-sys: Use gtk+ 3.0 by default
virt-viewer currenty builds with gtk+ 2.0 by default. Nowadays, gtk+ 2.0 is
legacy, and this default is inconsistent with spice-gtk which defaults to
gtk+ 3.0. This commit switches the default to gtk+ 3.0
2013-11-13 11:15:46 +01:00
Jonathon Jongsma
2ec0387adc Disconnect fullscreen map-event handler when leaving fullscreen
When we enter fullscreen mode before the window is shown, we set up a signal
handler to enter fullscreen mode when the window is mapped.  If we then leave
fullscreen mode before the window is mapped, we don't disconnect this handler,
so it will still enter fullscreen mode when it is shown.

Fixes rhbz #1009513
2013-11-13 11:10:07 +01:00
Jonathon Jongsma
bd914bdea2 Drop basic fullscreen mode
Remove the distinction between --full-screen and --full-screen=auto-conf.  Just
make --full-screen behave like auto-conf did.  There's really no advantage to
having two slightly different fullscreen startup modes.
2013-11-13 11:10:06 +01:00
Marc-André Lureau
8565501b1e Unify configured hotkey behaviour
Whether the hotkeys are set through command line, controller or file, we
should get the same keybinding result (clear unspecified, and enable
global bindings)

However, when started from command line arguments, without --hotkey
argument, it will have basic non-global default bindings.

https://bugzilla.redhat.com/show_bug.cgi?id=1023447
2013-11-07 19:43:39 +01:00
Marc-André Lureau
ac2440611a file: learn to set secure-attention hotkey 2013-11-07 19:43:39 +01:00
Marc-André Lureau
679bb4468e Rename internal toggle-fullscreen menu accel name
This avoid confusion with other fullscreen state property
2013-11-07 19:43:39 +01:00
Marc-André Lureau
a53e7c12a1 file: factor a bit setting accelerators code 2013-11-07 19:43:39 +01:00
Christophe Fergeau
73a4e9993d ovirt: Only set SPICE CA cert if it's non NULL
We currently reuse the oVirt CA cert for SPICE connection as well,
but it may not be set. When this happens, we don't want to try to use
it.
2013-10-30 10:52:53 +01:00
Christophe Fergeau
daa499f27e ovirt: Don't automatically download CA certificate
The CA certificate to use to authenticate the various hosts in
an oVirt instance can be fetched from https://ovirt.example.com/ca.crt.
However, the gio API we are using does not seem to be checking the
server-side certificate of ovirt.example.com before connecting to it,
which could lead to man-in-the-middle attacks. Now that the CA
certificate to use can be specified from the command line using
--ovirt-ca-file, we can remove this automatic fetching of the CA
certificate.
2013-10-30 10:52:53 +01:00
Christophe Fergeau
9eb3747f1f ovirt: Honour oVirt command line options
libgovirt 0.3.0 and newer can be passed from the commandline a CA
certificate to use during SSL communications. This commit adds support
for this option to remote-viewer.
2013-10-30 10:52:53 +01:00
Christophe Fergeau
8df64ae4ec ovirt: Remove use of deprecated APIs
ovirt_proxy_fetch_vms/ovirt_proxy_lookup_vm have been deprecated
in govirt 0.3.0
2013-10-30 10:52:53 +01:00
Christophe Fergeau
69ffdb50b9 Clean-up spaces before/after URI in connection dialog
When starting remote-viewer with no argument, a connection dialog
is shown. If the URI the user types in this dialog as trailing
or leading spaces, then connection will fail because remote-viewer
will keep them as if they were significant.
This commit makes sure we remove spaces at the beginning/end of
the URI before trying to use it.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024199
2013-10-29 15:12:17 +01:00
Christophe Fergeau
39feb118b5 Fix 'quiting' typo in VirtViewerApp private member 2013-10-29 15:12:17 +01:00
Christophe Fergeau
a108fee51b Fix typo in manpage
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=823916
2013-10-29 15:12:17 +01:00
Jonathon Jongsma
6219e569d4 Make 'Send' menu items with defined accels work in fullscreen 2013-10-18 18:29:26 +02:00
Jonathon Jongsma
34bbb275a6 Set Spice display to fullscreen if owning window is pending fullscreen
When you call virt_viewer_window_enter_fullscreen() on a hidden window, it
didn't actually change its fullscreen state.  Instead, it sets up a map-event
handler to enter fullscreen after it is shown. When _set_display() is called on
a window that is pending fullscreen status, it initially sets the fullscreen
state of the display to FALSE, which can cause an unwanted resize to be sent
down to the guest. This patch changes the behavior to set its fullscreen state
to TRUE even before the window is shown.
2013-10-18 18:29:26 +02:00
Jonathon Jongsma
9945ffde5b Don't freeze property notifications when adding new displays
Freezing property notifications prevents VirtViewerDisplaySpice from
synchronizing its fullscreen/auto-resize state with the base class until after
the notifications are thawed.  During the time that notifications were frozen,
an allocation happens. The action we take on an allocation event depends on the
current state of the auto_resize variable, so this can result in an unwanted
resize.
2013-10-18 18:29:25 +02:00
Jonathon Jongsma
45fb7f02d7 VirtViewerDisplaySpice: use enum type for auto_resize
Instead of storing the auto_resize member as an integer, use the enum, it makes
it slightly easier for debugging. Also, explicitly initialize the value.
2013-10-18 18:29:25 +02:00
Jonathon Jongsma
b93338235a Avoid extra zoom-level property notifications
When setting a display's zoom level to the same level as the current setting,
return early so that we don't notify about a property change
2013-10-18 18:29:25 +02:00
Jonathon Jongsma
5fc5a2c897 Don't disable fullscreen if kiosk mode is off
This conflicts with the --full-screen switch, because if kiosk mode is disabled,
it sets disables fullscreen mode, which overrides the earlier call to enable
fullscreen.
2013-10-18 18:29:25 +02:00
Christophe Fergeau
697b4929ac Make 'Cancel' the default action in exit dialog
In the 'Do you want to close the session dialog?', the default focus
is currently on the 'Do not ask me again' checkbox.
The purpose of this dialog is to make sure that the user does not
inadvertantly exit remote-viewer, this commit changes the default
action in this dialog to be 'cancel' rather than switching the
'Do not ask me again 'checkbox.
2013-10-16 19:13:43 +02:00
Christophe Fergeau
bffbd2a7e7 vnc: Clear all displays before creating dummy display
If VirtViewerSessionVnc::disconnected is called because of an
authentication failure, we get:

(remote-viewer:29588): gtk-vnc-DEBUG: vncdisplay.c Disconnected from VNC server

(remote-viewer:29588): Gtk-WARNING **: Attempting to add a widget with type
VncDisplay to a container of type VirtViewerDisplayVnc, but the widget is
already inside a container of type VirtViewerDisplayVnc, please use
gtk_widget_reparent()

 #0  0x0000003136e50499 in g_logv (log_domain=0x3f2e13e143 "Gtk",
     log_level=G_LOG_LEVEL_WARNING, format=<optimized out>,
     args=args@entry=0x7fffffffd210) at gmessages.c:989
 #1  0x0000003136e505ef in g_log (log_domain=<optimized out>, log_level=<optimized out>,
     format=<optimized out>) at gmessages.c:1025
 #2  0x00000000004230eb in virt_viewer_display_vnc_new (vnc=0x8a8250)
     at virt-viewer-display-vnc.c:169
 #3  0x0000000000422191 in virt_viewer_session_vnc_disconnected (vnc=0x8a8250,
     session=0x86bf00) at virt-viewer-session-vnc.c:113
 #4  0x00000031372104c7 in _g_closure_invoke_va (closure=closure@entry=0x8ad2b0,
     return_value=return_value@entry=0x0, instance=instance@entry=0x8a8250,
     args=args@entry=0x7fffffffd530, n_params=0, param_types=0x0) at gclosure.c:840
 #5  0x0000003137229749 in g_signal_emit_valist (instance=0x8a8250,
     signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd530)
     at gsignal.c:3238
 #6  0x000000313722a3af in g_signal_emit (instance=<optimized out>,
     signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
 #7  0x00007ffff7dbeb5a in on_disconnected (conn=0x8b5aa0, opaque=0x8a8250)
     at vncdisplay.c:1563
 #8  0x00000031372104c7 in _g_closure_invoke_va (closure=closure@entry=0x7d55f0,
     return_value=return_value@entry=0x0, instance=instance@entry=0x8b5aa0,
     args=args@entry=0x7fffffffd820, n_params=0, param_types=0x0) at gclosure.c:840
 #9  0x0000003137229749 in g_signal_emit_valist (instance=0x8b5aa0,
     signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd820)
     at gsignal.c:3238
 #10 0x000000313722a3af in g_signal_emit (instance=<optimized out>,
     signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
 #11 0x00007ffff7b97308 in do_vnc_connection_emit_main_context (opaque=0x7fffe3c91f40)
     at vncconnection.c:578
 #12 0x0000003136e49256 in g_main_dispatch (context=0x681840) at gmain.c:3065
 #13 g_main_context_dispatch (context=context@entry=0x681840) at gmain.c:3641
 #14 0x0000003136e495d8 in g_main_context_iterate (context=0x681840,
     block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
     at gmain.c:3712
 #15 0x0000003136e499ea in g_main_loop_run (loop=0x830430) at gmain.c:3906
 #16 0x0000003f2dfa8f75 in gtk_main () at gtkmain.c:1158
 #17 0x0000000000429bf3 in main (argc=1, argv=0x7fffffffdcd8) at remote-viewer-main.c:179

This commit calls virt_viewer_session_clear_displays() before creating a dummy VNC display with
virt_viewer_display_vnc_new(), which avoids this warning.
2013-10-16 19:13:43 +02:00
Marc-André Lureau
b80e7f0f2d hotkeys: send modifiers before non-modifier key
This fixes the "send menu" for hotkeys set with non-modifiers keys. The
current order of press events is wrong, as it sends first non-modifiers
keys, and in general ctrl+t will work, t+ctrl will not.

https://bugzilla.redhat.com/show_bug.cgi?id=846006
2013-09-26 16:51:25 +02:00
Christophe Fergeau
6a5fdf5a24 spec: Enable ovirt support on RHEL7 as well 2013-09-13 15:38:31 +02:00
Christophe Fergeau
865bb8769d spec: Group %define spice together
The rhel and fedora %define for enabling spice were separated, we
can group them for better readability.
2013-09-13 15:38:31 +02:00
Christophe Fergeau
6ca035dd4c spec: Build with gtk+3 on rhel7+ 2013-09-13 15:38:30 +02:00
Jonathon Jongsma
6cc70f4fe4 Update hotkeys documentation in manpage
Describe the expected behavior of the hotkey bindings in a bit more detail.
2013-09-10 08:06:15 +02:00
Jonathon Jongsma
d574197a70 Add ability to use 'End' key in hotkeys
ctrl_key_to_gtk_key() capitalizes all key names not explicitly specified in the
translation table.  So 'end' becomes 'END', which is not a valid key name
according to GTK+.  Un-comment out the 'end' item from the table and set it to
the properly capitalized key name ("End").

This allows users to specify e.g. "ctrl+alt+end" as a hotkey for
sending the secure attention sequence.
2013-09-10 08:06:13 +02:00
Jonathon Jongsma
7b4adadf75 Add ability to send Secure attention sequence via keyboard
On Windows, the OS doesn't allow applications to handle Ctrl+Alt+Del, because
it's handled by the OS at a much lower level. Although we have a menu item to
send this sequence to the guest, it's not possible to send via the keyboard (in
the windows client). So add an alternative key sequence (defaulting to
Ctrl+Alt+End) to send this sequence to the guest.
2013-09-10 08:06:09 +02:00
Marc-André Lureau
67ed4dff98 kiosk: explicit resize window to fullscreen size
Allow to run the client in kiosk mode with window-manager-less
environment.

This was a conditional workaroud on win32. I am making it
non-conditional to make fullscreen work on non-wm environment. Hence
I don't see the need to refer explicitely to the bug workaround, since
it is no longer something that should be removed, even when bgo 652049
is fixed.
2013-08-20 20:46:43 +02:00
Marc-André Lureau
1cbacd462e kiosk: don't open extra monitors
In kiosk mode, we don't want new monitors windows that wouldn't fit on
the client monitors to come up.
2013-08-20 20:46:43 +02:00
Marc-André Lureau
8a90721d64 kiosk: warn and prevent if app want to quit or window to hide
These condition shouldn't happen, they are here for debugging
purposes (ie file a bug if it happens).
2013-08-20 20:46:43 +02:00
Marc-André Lureau
91928798e4 kiosk: add --kiosk-quit option
In kiosk mode, it's useful to keep the app alive, even if the remote
session ended for example. Ie, we want to prevent the app from quiting
itself, even if the remote end closed, lost network, or crashed etc.
2013-08-20 20:46:25 +02:00
Marc-André Lureau
b7e153950e kiosk: teach a window to become kiosk-mode
Remove the toolbar, disable modifiers.
2013-08-20 13:44:05 +02:00
Marc-André Lureau
4759171289 kiosk: keep a reference on the toolbar
We are going to change the container content dynamically, so we need a
strong reference.
2013-08-20 13:44:05 +02:00
Marc-André Lureau
312da84df7 kiosk: use less verbose window/display status
We want extra windows to remain blank after connection.

For example, if the remote has a single monitor, and client has more, we
don't want extra client monitors to say "Connected to graphic server"
all the time on other monitors. Instead, we leave them empty/black in
kiosk mode.
2013-08-20 13:44:05 +02:00
Marc-André Lureau
90f5bf7ac7 kiosk: open a window on each client monitor
Open a window on each client monitor in fullscreen. If the remote
display has less monitors than the client, the extra client monitors
will still be used to prevent the user from accessing the windows or
desktop below, and also to show some status messages when necessary.
2013-08-20 13:44:04 +02:00
Marc-André Lureau
34eab7b91e kiosk: add app kiosk option, pass it down to window
See man page update for details.
2013-08-20 13:44:04 +02:00
Marc-André Lureau
cd7b5761af Return existing window in app_window_new()
Since the returned window is weak, it can already returns existing
windows (instead of creating one and failing to insert).

This allows the following set_kiosk() function to create a main window
before the app constructor is called.
2013-08-20 13:44:04 +02:00
Marc-André Lureau
563067341c Define the min/max zoom levels, so all values are sync 2013-08-20 13:43:52 +02:00
Marc-André Lureau
980de2d331 Try to share more GOption code between r-v and v-v 2013-08-20 13:39:46 +02:00
Marc-André Lureau
b8d114ef1d remote-viewer: remove -d direct option
remote-viewer currently doesn't provide automatic ssh tunnels, and even if
it would, that would be explicit in the url given to remote-viewer (such
as spice+ssh://...)

https://bugzilla.redhat.com/show_bug.cgi?id=991261
2013-08-14 22:30:12 +02:00
Marc-André Lureau
692129ab44 man: add application/x-virt-viewer file format description
https://bugzilla.redhat.com/show_bug.cgi?id=970825
2013-08-08 16:57:49 +02:00
Marc-André Lureau
62f12d4c15 spice: show an error dialog if password is invalid
Error message should show up when input the wrong password for spice
guests as vnc guests.

https://bugzilla.redhat.com/show_bug.cgi?id=990883
2013-08-08 16:57:49 +02:00
Daniel P. Berrange
e2962caed3 Update NEWS for 0.5.7 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-31 14:51:44 +01:00
Daniel P. Berrange
533342db14 Update min spice-gtk dep to 0.20
The spice_smartcard_manager_get_readers method was only added
in spice-gtk 0.20.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-31 11:54:33 +01:00