The connection file created by oVirt contains the trusted CA.
When https://gitlab.gnome.org/GNOME/gtk-vnc/-/merge_requests/24 is
merged, we can pass this CA certificate to gtk-vnc to have it trusted.
This can replace manually putting the cacert.pem into ~/.pki/CA/
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
The command depends on POSIX-compatible shell being the default shell on
the remote side of SSH, but that might not be the case. To make sure
the command gets parsed correctly this commit encloses it in extra
single quotes (to avoid it being parsed by the remote shell) and passes
that string as a parameter to `sh -c`.
Signed-off-by: Martin Kletzander <nert.pinx@gmail.com>
When using the result of find_program, meson may expand
it to include both an interpretor path and the script
path. If we then add the interpretor path too, we fail.
Using 'full_path()' ensures we get only the script path.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This also includes an update of the translatable strings
from running `ninja -C _build virt-viewer-pot`.
Signed-off-by: Michael Weghorn <m.weghorn@posteo.de>
We now display the current ISO as subtitle on the HeaderBar. On the
glade UI file, we get rid of the GtkAlignment object that was used to
put some space between the tree view and dialog buttons. The "Select
ISO" label is gone too.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
With the possibility of having ISO images in storage domains of DATA
type, we need to store the id of the object as well as its name. This is
not the case with ISO storage domains, which only hold the name of the
image. This patch makes it possible to use deal with both types
transparently for the user.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1835640
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This function only existed to make use of glib compat, now that we
require a version of glib that already exports the symbol, the call is
not required anymore.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
The '-r' shortcut was alread used for '--reconnect' in virt-viewer.
The --auto-resize arg is a fairly niche use case so doesn't really
need a shortcut.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This is implemented by switching from GTK accelerators to using the
display's grab sequence handling when a modifier-only hotkey is
configured.
Signed-off-by: Paul Donohue <git@PaulSD.com>
Previously, virt_viewer_update_smartcard_accels() and
virt_viewer_update_usbredir_accels() needed to be called after
configuring hotkeys and before any smartcard/usbredir devices were
connected in order to properly configure the hotkeys. However, those
were not called if hotkeys were configured via the config file.
In addition, the code did not support reconfiguring hotkeys after
devices were connected, which could cause future problems, eg. if a GUI
is added to support reconfiguring hotkeys.
Signed-off-by: Paul Donohue <git@PaulSD.com>
This is mostly just code de-duplication and cleanup. The only
functional change is that the case-sensitive accel support from the
command-line hotkey handling now also applies to the config file.
Signed-off-by: Paul Donohue <git@PaulSD.com>
"win.<action>" and "app.<action>" were mixed up in a few places.
Smartcard actions use "app" and other actions use "win".
Signed-off-by: Paul Donohue <git@PaulSD.com>
Since glib >= 2.69 we get warnings:
../src/ovirt-foreign-menu.c: In function 'ovirt_foreign_menu_next_async_step':
../src/ovirt-foreign-menu.c:319:13: error: Not available before 2.60 [-Werror]
319 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~~~
../src/ovirt-foreign-menu.c:345:13: error: Not available before 2.60 [-Werror]
345 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~~~
../src/ovirt-foreign-menu.c:351:13: error: Not available before 2.60 [-Werror]
351 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~~~
../src/ovirt-foreign-menu.c:357:13: error: Not available before 2.60 [-Werror]
357 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
GLib is right to warn about this, since it does not know that we
provided our own back-compat definition of the macro. For now we have to
temporarily purge glib's macro entirely in order to get rid of the
warning that is bogus for our usage.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
The desktop-width / desktop-height properties are set to have a min
valid value of 320x200, and this also matches the minimum window
dimensions reported to GTK.
In practice when a guest restarts, spice can report width/height
values smaller than this
(virt-viewer:9359): GLib-GObject-WARNING **: 12:57:05.556: value "64" of type 'gint' is invalid or out of range for property 'desktop-width' of type 'gint'
(virt-viewer:9359): GLib-GObject-WARNING **: 12:57:05.556: value "64" of type 'gint' is invalid or out of range for property 'desktop-height' of type 'gint'
There is not an obvious need to enforce this minimum on the properties,
as the window dimension sizing will do the right thing regardless.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
When the last window is closed we optionally show a confirmation dialog
to check if user wants to quit. If the user cancels, we need to ensure
the display menu state gets set back to checked.
We called g_action_change_state correctly, but a later call to
g_simple_action_set_state used the "visible" variable which was not
correctly reset back to TRUE upon cancel.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
If authentication fails we reshow the same authentication dialog box
again. Rather than leaving the previous incorrect information in the
text entry boxes we need to clear them.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
My clang version 11.0.0 (Fedora 11.0.0-2.fc33) complains:
../src/virt-viewer-app.c:610:9: error: variable 'keymaps' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (keymap_string) {
^~~~~~~~~~~~~
../src/virt-viewer-app.c:614:10: note: uninitialized use occurs here
if (!keymaps || g_strv_length(keymaps) == 0) {
^~~~~~~
../src/virt-viewer-app.c:610:5: note: remove the 'if' if its condition is always true
if (keymap_string) {
^~~~~~~~~~~~~~~~~~~
../src/virt-viewer-app.c:595:27: note: initialize the variable 'keymaps' to silence this warning
gchar **key, **keymaps, **valkey, **valuekeys = NULL;
^
= NULL
1 error generated.
Initialize the variable to fix the uninitialized use.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
The gtk_accelerator_parse code is case sensitive when resolving key
names, however, the spice_hotkey_to_gtk_accelerator method converts
everything to uppercase. The latter allows the user to provide "f"
as the key and get it converted to "F" which matches a GDK key name.
The latter breaks for most other keys though, eg "comma" is required
to be all lowercase and "Menu" must have the initial capital.
To cope with this we try the gtk_accelerator_parse call twice, once
with the spice munged key name for back compat, and once with the
exact user specified key name.
https://gitlab.com/virt-viewer/virt-viewer/-/issues/30
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
GTK-VNC has native support for remote desktop resize, provided that we
always give the widget the full available allocation. This requires that
we turn off VirtViewerDisplay's code for keeping aspect ratio, and
instead enable GTK-VNC's equivalent.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
When the VirtViewerDisplay class resizes the child display widget, it
attempts to preserve the remote desktop aspect ratio. This is useful in
general, if the display widget can't do this itself. The implication,
however, is that VirtViewerDisplay also has to take ownership of the
remote framebuffer resize functionality.
It is thus useful to disable VirtViewerDisplay's aspect ratio
preservation when the display widget can do this natively, as it can
then also do desktop resizes natively.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Currently the GActionMap is registered during the application
startup. This takes place after the command line args are processed,
so prevents the CLI processing from using actions.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Normally we will honour the server requested behaviour for cursor,
either letting the server render it directly, or locally rendering
a cursor that the server provided us.
There are times, however, where the server does the wrong thing. For
example it might tell us to render an empty cursor, leaving the user
with no visible cursor at all. In this case it can be helpful to ignore
what the server requests, and always display the default local cursor.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
SPICE provides a number of VM actions, but they are only supported if
the QMP tunnel is available. VNC doesn't currently support any, but
in future it will support some.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This ensures that the application exits when the user presses Ctrl-C
while an auth dialog is open.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>