Commit Graph

1172 Commits

Author SHA1 Message Date
Michael Scherle
5e775d548d video codec selection 2024-08-08 11:06:12 +02:00
Pino Toscano
6b7c11fc27 Typo fixes
- "allow to" -> "allow one to"
- "arguemnt" -> "argument"
- "bewteen" -> "between"
- "conncetion" -> "connection"
- "connnect" -> "connect"
- "differantiate" -> "differentiate"
- "fo" -> "to"
- "non-existant" -> "non-existent"
- "prefered" -> "preferred"
- "quiting" -> "quitting"
- "reseting" -> "resetting"
- "seemless" -> "seamless"
- "unconditionnaly" -> "unconditionally"

Thanks to codespell.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2023-09-26 07:30:20 +02:00
Jean-Louis Dupond
de864c1414 Read oVirt CA and pass it to gtk-vnc
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>
2023-06-09 15:18:24 +02:00
Eduardo Lima (Etrunko)
b2a50c1fe1 session-vnc: Plug leak in error path
Reported in rhbz#2019858

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2023-05-03 12:41:02 -03:00
Alberto Mattea
f374f7a02d Add support for usb-redirect-on-connect in vv-files
Mirror the --spice-usbredir-redirect-on-connect command line option

Signed-off-by: Alberto Mattea <alberto@mattea.info>
2023-03-08 15:08:23 +01:00
Martin Kletzander
0a6155ca13 src: Fix ssh tunnel with non-POSIX remote shells
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>
2023-01-27 10:51:00 +01:00
Daniel P. Berrangé
dec15f96a0 build: use full_path() for referencing programs
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>
2023-01-26 17:50:34 +00:00
Daniel P. Berrangé
c7a75aa3c2 meson: set variables for each program in build-aux dir
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01:00
Daniel P. Berrangé
b379d28678 meson: replace 'gui_app' with 'windows_subsystem'
The former is deprecated since 0.56

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01:00
Michael Weghorn
6ba2a461db Add tooltips and a11y names to items in virt-viewer.ui
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>
2022-07-28 11:23:00 +02:00
Stefan Schindler
b43bd3d91d Use less memory
Signed-off-by: Stefan Schindler <dns2utf8@estada.ch>
2021-12-19 22:36:15 +01:00
dns2utf8
b8e2998c55 Update src/virt-viewer-app.c
Signed-off-by: Stefan Schindler <dns2utf8@estada.ch>
2021-12-19 15:26:38 +01:00
Eduardo Lima (Etrunko)
40eec08817 iso-dialog: Use GtkHeaderBar
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>
2021-09-15 11:28:45 -03:00
Eduardo Lima (Etrunko)
d451d6e4a4 Add Change CD button to toolbar
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2021-09-15 11:28:45 -03:00
Eduardo Lima (Etrunko)
c3c3a1faf6 ovirt-foreign-menu: Support changing ISO from Data StorageDomain
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>
2021-09-15 11:18:03 -03:00
Eduardo Lima (Etrunko)
24ce0d9c3b ovirt-foreign-menu: Remove unecessary strv_contains() function
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>
2021-09-15 11:18:03 -03:00
Eduardo Lima (Etrunko)
be0dd059ac Update libgovirt requirements
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2021-09-15 11:18:03 -03:00
Daniel P. Berrangé
a8c781e85c Delete '-r' shortcut for --auto-resize
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>
2021-09-07 13:01:04 +01:00
Paul Donohue
f0cc7103be src: Support modifier-only hotkey for release-cursor
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>
2021-07-30 10:03:02 +00:00
Paul Donohue
26f5f2a3f2 src: Fix smartcard and USB dynamic hotkey configuration
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>
2021-07-30 10:03:02 +00:00
Paul Donohue
0a997601ab src: Unify hotkey setup from command line and config file
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>
2021-07-30 10:03:02 +00:00
Paul Donohue
af644ec423 src: Move virt_viewer_app_get_enable_accel() and virt_viewer_app_set_enable_accel()
No functional changes.  This is only to reduce clutter in the next few
commits.

Signed-off-by: Paul Donohue <git@PaulSD.com>
2021-07-30 10:03:02 +00:00
Paul Donohue
87d8c80ba2 src: Add usb-device-reset hotkey support to config file
Signed-off-by: Paul Donohue <git@PaulSD.com>
2021-07-30 10:03:02 +00:00
Paul Donohue
dde79e637a src: Fix hotkey GTK actions
"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>
2021-07-30 10:03:02 +00:00
Paul Donohue
4175930194 src: Release keyboard grab in addition to mouse grab when using spice
This requires spice-gtk 0.40 or later:
ea81b97f74

Signed-off-by: Paul Donohue <git@PaulSD.com>
2021-07-30 10:03:02 +00:00
Daniel P. Berrangé
2e6adf9b85 src: avoid warnings from use of G_GNUC_FALLTHROUGH
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>
2021-07-27 16:50:04 +01:00
Daniel P. Berrangé
70fe65f188 Fix creation of window when using single QXL card with 2 heads
With a single QXL card with > 1 head, initially only the first head
is active. As a result virt-viewer will not create the windows when
it first connects. They have to be created explicitly when user
requests to activate the window.

Fixes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/46
Fixes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/37
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-06-28 18:47:02 +01:00
Daniel P. Berrangé
5367a7b123 src: relax minimum desktop width/height
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>
2021-05-26 17:32:19 +01:00
Daniel P. Berrangé
aa6b4b40b8 src: update action sensitivity when creating window
If we don't explicitly set action sensitivity after associating a
display with the window, the actions will end up with the wrong
state. This exhibits itself as send key actions being marked
disabled despite being connected,

Related: https://gitlab.com/virt-viewer/virt-viewer/-/issues/37
Closes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/41
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-26 17:32:08 +01:00
Daniel P. Berrangé
4820d05c82 src: correctly set display state when cancelling quit request
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>
2021-05-05 12:40:52 +00:00
Daniel P. Berrangé
73f567ea94 src: ensure auth entry fields are cleared
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>
2021-05-05 12:00:29 +01:00
Ján Tomko
9e36a59c80 src: initialize keymaps variable
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>
2021-04-23 15:59:49 +02:00
Daniel P. Berrangé
16714e97a5 src: fix case sensitive accelerator parsing
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>
2021-04-19 14:54:37 +01:00
Daniel P. Berrangé
30e6f4cd03 src: update for renamed GTK-VNC zoom API
The API was renamed before GTK-VNC 1.2.0 release.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-14 11:39:26 +01:00
Daniel P. Berrangé
47c22dc23b src: enable remote desktop resize with VNC
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>
2021-04-08 15:08:07 +01:00
Daniel P. Berrangé
20f5b18b6a src: add prop to control forced aspect ratio
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>
2021-04-08 15:08:07 +01:00
Daniel P. Berrangé
e9e2ebb796 src: add --auto-resize <always|never> CLI arg
This is used to control whether resizing of the remote framebuffer
is permitted.

Fixes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/20
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-08 15:08:06 +01:00
Daniel P. Berrangé
707f74b9c4 src: add menu to control whether framebuffer resize is attempted
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-08 15:07:08 +01:00
Daniel P. Berrangé
512efe70c6 src: initialize actions during instance init
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>
2021-04-08 15:07:08 +01:00
Daniel P. Berrangé
83db5b3c64 src: remove unused property constant
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-08 15:07:08 +01:00
Daniel P. Berrangé
3125e8f507 src: fix version check for power control
The next gtk-vnc will be 1.2.0, not 2.0.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-08 15:07:08 +01:00
Daniel P. Berrangé
15fbaa3fb4 src: introduce "--cursor auto|local" command line
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>
2021-04-08 12:52:59 +00:00
Daniel P. Berrangé
ada810c088 src: support power control actions with VNC
VNC can support graceful shutdown, hard reset and hard power off.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-23 17:59:29 +00:00
Daniel P. Berrangé
f42a1a7eaa src: conditionally enable VM action UIs
We only want to enable VM actions that are supported by
the session.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-23 17:59:29 +00:00
Daniel P. Berrangé
897543880c src: wire up reporting of whether VM actions are supported in SPICE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-23 17:59:29 +00:00
Daniel P. Berrangé
27aa853981 src: add method to test whether a VM action is supported
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>
2021-03-23 17:59:29 +00:00
Daniel P. Berrangé
6db5b71419 src: hide password/username auth widgets if not required
When a password is sufficiently, we should not even show the username
field, and vica-verca.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00
Daniel P. Berrangé
1d11dd55da src: cancel auth dialog when closing session
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>
2021-03-18 11:26:37 +00:00
Daniel P. Berrangé
247d91d889 src: switch auth dialog to use a GTK UI template
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00
Daniel P. Berrangé
d59f550d21 src: improve spacing between password box and buttons in auth dialog
The standard layout uses 6 pixels spacing between controls.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00