Commit Graph

469 Commits

Author SHA1 Message Date
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
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
Christophe Fergeau
208010e5d8 Enable smartcard shortcuts when a software reader is present
At the moment, smartcard keyboard accelerators are always enabled when
specified, even if no software smartcard reader is in use. This commit only
enables the smartcard keyboard accelerators when a smartcard reader
has been found. This fixes rhbz#866944
2013-07-31 11:33:16 +01: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
Daniel P. Berrange
a542483b56 Fix two type cast problems
The g_array_free() return value is 'char *' rather than 'void *'
so must be explicitly cast to 'uint8 *'.

The accelerator menu callback data is a GtkMenu rather GtkWidget

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-31 11:32:57 +01:00
Marc-André Lureau
536c78c18b window: auto-add hot key combos to "Send key" menu
Auto-add hotkey combos to "Send key" menu. Because they are captured by
virt-viewer, there is currently no way to pass them to the guest.

https://bugzilla.redhat.com/show_bug.cgi?id=846006
2013-07-30 21:11:30 +02:00
Marc-André Lureau
e044fe2544 window: use dynamically generated menu
Remove the static Glade menu in favour of the one generated dynamically
already used for the toolbar.
2013-07-30 21:11:28 +02:00
Marc-André Lureau
a0d8844b56 window: use a menu item property for key combos
Allow to add dynamically generated key combos later on.

This also removes the extra combo lookup, which used to be problematic
due to translations etc.
2013-07-30 21:11:25 +02:00
Marc-André Lureau
90f35a8140 compat: add a few GDK_Key defines 2013-07-30 21:11:23 +02:00
Marc-André Lureau
8a05a5a02e file: add missing field comment 2013-07-30 21:11:14 +02:00
Marc-André Lureau
21de33bc5f Remove restore window location code
It turns out gdk on win32 already restores properly the window
size/positon when leaving fullscreen. On non-win32, the WM should
do the job.

This solves the first window having too small size after leaving fullscreen:
https://bugzilla.redhat.com/show_bug.cgi?id=978362
2013-07-30 21:10:03 +02:00
Marc-André Lureau
c34ec01b3d win32: fix first window un-shrinkable at start
The fix 0dca975d64 make the first window
unshrinkable right after start. Wait until the window is mapped and
remove the dirty-resizable state after (win32/gtk2).
2013-07-30 21:09:59 +02:00
Marc-André Lureau
e2dce44aa2 Make zoom-reset a global key binding 2013-07-30 21:09:30 +02:00
Marc-André Lureau
323d85d18a spice: if zoom-level is changed, resize guest, even in fullscreen 2013-07-30 21:09:16 +02:00
Marc-André Lureau
dc59eeb3b8 spice: factor out spice resize code from gtk signal handler
This will allow that part of the code to be called with a different
resize-guest setting.
2013-07-30 21:09:12 +02:00
Marc-André Lureau
e46a4d6759 Hide extra monitors that don't fit in auto-conf
Virt-viewer sometimes opens one too many windows if the guest is
configured with more monitors than the client (the spice monitor
configuration request and the current config aren't related, so there is
some race). Instead, let's hide extra monitors that wouldn't fit in
auto-conf.

https://bugzilla.redhat.com/show_bug.cgi?id=985898
2013-07-30 20:33:45 +02:00
Marc-André Lureau
00d523bdf8 Realize the display when it's added to the window
Make sure the widget get some dimensions, so if the display is enabled
before it is actually shown, it will have non-zero size
2013-07-30 20:33:42 +02:00
Marc-André Lureau
24c762b113 Initialize fullscreen_monitor to invalid value
This makes it easier to debug when a window has no associated monitor.
2013-07-30 20:28:31 +02:00
Marc-André Lureau
072e6957c2 Disable auto-conf when user toggle display
Let's get out of auto-conf mode whenever user tricks display visibility.
2013-07-30 20:28:27 +02:00
Marc-André Lureau
05333f0e93 Remove dead function 2013-07-30 20:26:35 +02:00
Ján Tomko
cf92350bf7 Unregister events and callbacks on dispose
Without these libvirtd reports an error on virt-viewer shutdown:
virNetSocketReadWire:1377 : End of file while reading data: Input/output
error
2013-07-29 11:17:10 +02:00
Christophe Fergeau
59ca6bd8a7 virt-viewer: Allow TLS-only SPICE connections
When trying to connect to a VM which uses SPICE with only a tls port
set:
<graphics type='spice' tlsPort='-1' autoport='no' listen='0' keymap='en-us'>
    <listen type='address' address='0'/>
</graphics>
the connection will fail with
"Cannot determine the graphic address for the guest spice"

virt_viewer_extract_connect_info() indeed assumes that if no
non-TLS port is set, then this means we are trying to connect through
an already open socket, and otherwise the connection fails.
The presence of a TLS port is only checked when a non-TLS port is set.

This commit reworks that logic to start by extracting both the non-TLS
and TLS ports (only when using SPICE for the latter), and by only trying
to parse the socket to use if none of these 2 ports is set

This fixes rhbz#982840
2013-07-11 08:50:08 +02:00
Marc-André Lureau
008779488b vnc: implement release_cursor()
Error reported in:
https://bugzilla.redhat.com/show_bug.cgi?id=904094
2013-07-08 20:02:51 +02:00
Marc-André Lureau
307009954a app: always use maybe_quit()
Now that closing a window is like quiting, there is no reason to ask or
skip the confirm dialog depending on how you quit (menu/toolbar/window).

https://bugzilla.redhat.com/show_bug.cgi?id=905684
2013-07-08 20:02:51 +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
9da9305554 Use display fullscreen state instead of app state
This is a recent regression introduced by independant fullscreen windows
support, which reopened the bug "Resolution higher than native could not
be set in fullscreen"

https://bugzilla.redhat.com/show_bug.cgi?id=864929
2013-07-05 13:24:01 +02:00
Marc-André Lureau
933c39e80a window: set display fullscreen state 2013-07-05 13:24:01 +02:00
Marc-André Lureau
8e3ffc932c display: add fullscreen property
Now that fullscreen state is no longer global to application, we need to
have the current state per display
2013-07-05 13:21:09 +02:00
Marc-André Lureau
eeadf5bc53 Remove debugging leftover 2013-07-05 13:20:00 +02:00
Christophe Fergeau
9ca68938da Use -H instead of -h for the short --hotkeys
-h conflicts with the short version of --help.

Fixes rhbz#980846
2013-07-03 21:18:41 +02:00
Marc-André Lureau
9cad9ae00c Fix build --without-spice-gtk 2013-06-28 16:47:27 +02:00
Guido Günther
fda35e6976 Use format string
to fix

virt-viewer.c: In function 'virt_viewer_connect':
virt-viewer.c:686:13: error: format not a string literal and no format arguments [-Werror=format-security]
             g_warning(error->message);
2013-06-26 10:13:08 +02:00
Christophe Fergeau
7c0967fc8c ovirt: Set host subject if needed
For some VMs, setting host subject on SpiceSession is needed to
be able to connect to it using SPICE/SSL. Until recently, this
was not exposed in oVirt REST API/libgovirt. Since
oVirt 3.2/libgovirt 0.1.0, the host subject is available, this
patch makes use of it.
This should fix connection to oVirt VMs that were migrated to a
different host than the one they were started on.
2013-06-11 15:54:37 +02:00
Marc-André Lureau
df30f9730d Support Spice controller "auto-display-res" flag
The controller "auto-display-res" flag should be use to reconfigure
guest to match client configuration. This is what the
--fullscreen=auto-conf option is already made for.

https://bugzilla.redhat.com/show_bug.cgi?id=967154
2013-05-27 15:29:45 +02:00
Marc-André Lureau
f0f52f9406 Use a more descriptive FileDescription
This field is used to invite the user to close running instances, when
updating the installation with an MSI. "A remote desktop client" isn't
specific enough, use a VirtViewer specific description.
2013-05-23 17:31:05 +02:00
Marc-André Lureau
d9035d0535 app: move display on client monitors with --full-screen
There used to be a check to fullscreen the only visible display on
current monitor, by checking the number of visible monitors. Now that
fullscreen is independant for each display, and goes on current monitor,
it's useless.

However, this code path is still used for the app --full-screen, at
startup time. And it is still nicer to open the display on respective
client monitors, rather than all on current monitor.
2013-05-22 21:36:15 +02:00