Compare commits

...

1650 Commits

Author SHA1 Message Date
Marius Vollmer
107f60c168 data: Add x-scheme-handler/vnc to desktop file
Signed-off-by: Marius Vollmer <marius.vollmer@gmail.com>
2025-03-03 16:22:35 +02:00
Daniel P. Berrangé
1676cd8807 Fix handling of the --debug flag with glib >= 2.80
With glib 2.80 it will only examine G_MESSAGES_DEBUG env once for the
lifetime of the process. As a result our --debug flag has ceased to have
any effect.

This re-implements debugging using g_log_set_handler which works with
all glib versions, but requires us to implement timestamping ourselves.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-19 17:45:19 +00:00
Andika Triwidada
b6436a552a Translated using Weblate (Indonesian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Andika Triwidada <andika@gmail.com>
2025-02-07 13:26:09 +01:00
Remus-Gabriel Chelu
7f8944b933 Translated using Weblate (Romanian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ro/

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2025-02-07 13:26:09 +01:00
Léane GRASSER
4f8b479fb3 Translated using Weblate (French)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fr/

Signed-off-by: Léane GRASSER <leane.grasser@proton.me>
2025-02-07 13:26:09 +01:00
Marc-André Lureau
7dcc363da2 build-sys: skip mimedb update if missing
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-30 15:11:14 +04:00
Daniel P. Berrangé
f666425950 ci: refresh with latest 'lcitool manifest'
* Switch to using libvirt+minimal instead of libvirt project,
   for shorter build times
 * Actually do a git build job in CentOS Stream & AlmaLinux
 * Drop AlmaLinux 8
 * Update to latest Alpine versions

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-10-29 17:43:56 +00:00
Daniel P. Berrangé
82dbca46b6 ci: refresh with latest lcitool manifest
This updates the distros:

 * Add Alpine 3.18, 3.19, Edge, CentOS Stream 9, Fedora 39, 40,
   Ubuntu 24.04, AlmaLinux 8, 9, Debian 11, 12
 * Remove CentOS Stream 8, Fedora 37, 38, Ubuntu 20.04,
   Debian 10, Fedora 35, 36
 * Rename OpenSUSE 15.3 to 15

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-29 17:13:04 +00:00
Daniel P. Berrangé
41949dba74 ci: add 'libc' package to lcitool project def
On Alpine, 'musl-dev' won't get pulled in by default, even if gcc is
asked for, and thus C programs won't link.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-29 17:13:04 +00:00
Daniel P. Berrangé
4e08a54479 ci: import lcitool project package list definitions
The project package lists previously held in libvirt-ci.git are
being moved into their respective project git repos.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-29 17:13:04 +00:00
Pavel Borecki
8e1aea40d2 Translated using Weblate (Czech)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2024-03-01 23:36:07 +01:00
eirik song
887a4a30c4 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_Hans/

Signed-off-by: eirik song <eirik.song@gmail.com>

Added translation using Weblate (Chinese (Simplified))

Signed-off-by: eirik song <eirik.song@gmail.com>

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: eirik song <eirik.song@gmail.com>
2024-03-01 23:36:07 +01:00
Weblate
0f44b80d1e Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2024-03-01 23:36:07 +01:00
Arif Budiman
26ce13f296 Translated using Weblate (Indonesian)
Currently translated at 64.2% (117 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Arif Budiman <arifpedia@gmail.com>
2024-03-01 23:36:06 +01:00
Remus-Gabriel Chelu
cdb1e45c94 Added translation using Weblate (Romanian)
Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2024-03-01 23:36:06 +01:00
Alejandro Lizama
db33b1401b Translated using Weblate (Spanish)
Currently translated at 80.2% (146 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/es/

Signed-off-by: Alejandro Lizama <alejandro.lizama@gmail.com>
2024-03-01 23:36:06 +01:00
Michael Weghorn
4676c57486 Make app-id and desktop file name match
The application uses an application-id of
"org.virt-manager.virt-viewer" (see function
remote_viewer_new in src/remote-viewer.c).

So far, there was a mismatch between this
application-id and the desktop file name,
resulting e.g. in no proper window icon being
used when running the app on KDE Plasma Wayland.

Adjust the name of the desktop and appdata
files to match the application-id as expected.

Also update the translatable strings using this
command:

    ninja -C _build virt-viewer-pot

Fixes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/135
Signed-off-by: Michael Weghorn <m.weghorn@posteo.de>
2024-02-13 15:48:54 +01:00
Daniel P. Berrangé
ee49623348 check for incompatible libgovirt version
The virt-viewer code currently only works with librest 0.7
/ libgovirt < 0.3.9.

Check for this condition in meson to prevent later compile
time errors.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-12-08 10:09:08 +00:00
Oğuz Ersen
46997b9928 Translated using Weblate (Turkish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguz@ersen.moe>
2023-11-06 17:48:10 +01:00
Luna Jernberg
6bacfeb37a Translated using Weblate (Swedish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Luna Jernberg <bittin@reimu.nl>
2023-11-06 17:48:10 +01:00
Temuri Doghonadze
3b37bec03f Translated using Weblate (Georgian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ka/

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2023-11-06 17:48:10 +01:00
Jan Kuparinen
ef33a2e2d9 Translated using Weblate (Finnish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2023-11-06 17:48:10 +01:00
김인수
3f1294a27f Translated using Weblate (Korean)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
2023-11-06 17:48:10 +01:00
Pino Toscano
e3d2651157 Translated using Weblate (Italian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2023-11-06 17:48:10 +01:00
Yuri Chornoivan
b11a26a958 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2023-11-06 17:48:10 +01:00
Piotr Drąg
b1f93c54ce Translated using Weblate (Polish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2023-11-06 17:48:10 +01:00
Weblate
bd1fa28468 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2023-11-06 17:48:09 +01:00
Pino Toscano
25457fe13e po: update pot file
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2023-09-26 11:36:50 +02:00
Pino Toscano
4868bfe072 po: add all C sources to POTFILES
This way there is less risk that a message is not extracted for
translation.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2023-09-26 11:36:22 +02:00
Pavel Borecki
286a951ae0 Translated using Weblate (Czech)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2023-09-26 11:09:57 +02:00
Pino Toscano
968b4456bd Add codespell configuration
Add a configuration file for codespell; it is tweaked to work on the
current codebase, i.e. skipping non-sources.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2023-09-26 07:30:28 +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
Kowalski Dragon (kowalski7cc)
10b111c39b
Add content_rating to appdata
Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
2023-09-20 14:37:01 +02:00
Kowalski Dragon (kowalski7cc)
44db1933f7
Add launchable desktop file and virt-viewer binary
Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
2023-09-20 14:36:55 +02:00
Emilio Herrera
50e793d8de Translated using Weblate (Spanish)
Currently translated at 75.2% (137 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/es/

Signed-off-by: Emilio Herrera <ehespinosa57@gmail.com>
2023-08-06 16:21:01 +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
Fabio Tomat
db3b070fbe Translated using Weblate (Friulian)
Currently translated at 38.4% (70 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fur/

Signed-off-by: Fabio Tomat <f.t.public@gmail.com>

Added translation using Weblate (Friulian)

Signed-off-by: Fabio Tomat <f.t.public@gmail.com>
2023-05-04 19:06:54 +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
Daniel P. Berrangé
97ed170b5e rpm: convert license to SPDX format
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-04-26 17:47:19 +01: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
Ettore Atalan
f7900e4ed8 Translated using Weblate (German)
Currently translated at 95.0% (173 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>

Translated using Weblate (German)

Currently translated at 94.5% (172 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>
2022-12-06 10:19:55 +01:00
Daniel P. Berrangé
1e99e5e4f4 ci: refresh with latest lcitool manifest
This refresh switches the CI for contributors to be triggered by merge
requests. Pushing to a branch in a fork will no longer run CI pipelines,
in order to avoid consuming CI minutes. To regain the original behaviour
contributors can opt-in to a pipeline on push

   git push <remote> -o ci.variable=RUN_PIPELINE=1

This variable can also be set globally on the repository, though this is
not recommended. Upstream repo pushes to branches will run CI.

The use of containers has changed in this update, with only the upstream
repo creating containers, in order to avoid consuming contributors'
limited storage quotas. A fork with existing container images may delete
them. Containers will be rebuilt upstream when pushing commits with CI
changes to the default branch. Any other scenario with CI changes will
simply install build pre-requisite packages in a throaway environment,
using the ci/buildenv/ scripts. These scripts may also be used on a
contributor's local machines.

With pipelines triggered by merge requests, it is also now possible to
workaround the inability of contributors to run pipelines if they have
run out of CI quota. A project member can trigger a pipeline from the
merge request, which will run in context of upstream, however, note
this should only be done after reviewing the code for any malicious
CI changes.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-30 10:10:21 -04:00
Daniel P. Berrangé
17a6ed6907 gitlab: fix deps for 'codestyle' job
The container jobs only exist if there was a dockerfile change in the
pipeline, so the dep from the 'codestyle' job needs to be marked as
optional

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-22 17:06:29 +01:00
Pino Toscano
a49395a100 Translated using Weblate (Italian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2022-08-11 11:32:29 +02:00
Jan Kuparinen
f498a29949 Translated using Weblate (Finnish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2022-08-11 11:32:29 +02:00
Kisaragi Hiu
91a17011e1 Translated using Weblate (Chinese (Traditional) (zh_TW))
Currently translated at 61.5% (112 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_TW/

Signed-off-by: Kisaragi Hiu <mail@kisaragi-hiu.com>
2022-08-11 11:32:29 +02:00
Gogo Gogsi
b5e3404147 Added translation using Weblate (Croatian)
Signed-off-by: Gogo Gogsi <linux.hr@protonmail.com>
2022-08-11 11:32:29 +02:00
Ettore Atalan
d7fbf71f59 Translated using Weblate (German)
Currently translated at 92.8% (169 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>
2022-08-11 11:32:29 +02:00
Temuri Doghonadze
8be87f4d5e Translated using Weblate (Georgian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ka/

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2022-08-11 11:32:29 +02:00
Pavel Borecki
3c22a0e2c0 Translated using Weblate (Czech)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2022-08-11 11:32:29 +02:00
Yuri Chornoivan
2de9623833 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2022-08-11 11:32:29 +02:00
Oğuz Ersen
b964fce9ae Translated using Weblate (Turkish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguz@ersen.moe>
2022-08-11 11:32:29 +02:00
Göran Uddeborg
a0d6fee5bb Translated using Weblate (Swedish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-08-11 11:32:29 +02:00
김인수
f0ef1913df Translated using Weblate (Korean)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
2022-08-11 11:32:29 +02:00
Piotr Drąg
2d43a1e97d Translated using Weblate (Polish)
Currently translated at 100.0% (182 of 182 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2022-08-11 11:32:29 +02:00
Daniel P. Berrangé
29cb2b8813 meson: convert remaining source_root/build_root usage
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01:00
Daniel P. Berrangé
0b23827784 meson: use 'get_variable' instead of 'get_pkgconfig_variable'
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01:00
Daniel P. Berrangé
6bdb5981da meson: use 'full_path' instead of 'path'
The 'path' method is deprecated since 0.55

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01:00
Daniel P. Berrangé
b1fccecae8 meson: add 'check' param to all 'run_command' calls
Latest meson makes this parameter mandatory.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:26 +01: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
Daniel P. Berrangé
734e6ed700 ci: mark all bleeding edge distro jobs as allow failure
The non-released bleeding edge distros have frequent packaging problems
that make it impossible to have reliable CI. Make them all optional
non-gating jobs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:17:25 +01:00
Daniel P. Berrangé
43f5626c03 ci: refresh with latest lcitool manifest
Some distros are upgraded

 * Fedora 34 dropped, Fedora 36 added
 * Ubuntu 18.04 dropped, Ubuntu 22.04 added

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-11 10:16:25 +01:00
Weblate
a862283ba3 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-07-28 12:41:29 +02: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
Oğuz Ersen
2100805ca8 Translated using Weblate (Turkish)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguz@ersen.moe>
2022-06-06 15:18:37 +02:00
Joachim Philipp
f7654958d2 Translated using Weblate (German)
Currently translated at 89.2% (157 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Joachim Philipp <joachim.philipp@gmail.com>
2022-06-03 16:18:36 +02:00
Pavel Borecki
b65bbb8426 Translated using Weblate (Czech)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2022-06-03 16:18:36 +02:00
Eduardo Lima
b99ac373de Translated using Weblate (Spanish)
Currently translated at 72.1% (127 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/es/

Signed-off-by: Eduardo Lima <elima@redhat.com>
2022-06-03 16:18:35 +02:00
Daniel P. Berrangé
98d9f202ef data: remove bogus param for meson i18n.merge_file
The positional parameter used to be treated as 'input', but since we
already set 'input' explicitly it is redundant. With latest meson
versions it now generates an error

data/meson.build:4:7: ERROR: Function does not take positional arguments.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-27 11:27:46 +01:00
Daniel P. Berrangé
7ee760ea80 ci: refresh to pull in missing gettext package
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-27 11:27:46 +01:00
Daniel P. Berrangé
8cd7451192 ci: refresh from lcitool manifest
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-27 11:27:45 +01:00
Temuri Doghonadze
f3cf0e14b1 Translated using Weblate (Georgian)
Currently translated at 99.4% (175 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ka/

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>

Added translation using Weblate (Georgian)

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2022-01-13 09:16:27 +01:00
Göran Uddeborg
b49489020b Translated using Weblate (Swedish)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-01-13 09:16:27 +01:00
Yasuhiko Kamata
04ddb4a8e0 Translated using Weblate (Japanese)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ja/

Signed-off-by: Yasuhiko Kamata <belphegor@belbel.or.jp>
2022-01-13 09:16:26 +01:00
Ettore Atalan
c3c1afa415 Translated using Weblate (German)
Currently translated at 80.6% (142 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>
2022-01-13 09:16:26 +01:00
Pavel Borecki
c91acc3f8a Translated using Weblate (Czech)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2022-01-13 09:16:26 +01: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
Daniel P. Berrangé
50d3aebc0c Remove trailing whitespace from RPM specfile
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-30 11:50:19 +00:00
Jan Kuparinen
ca7767201a Translated using Weblate (Finnish)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-11-23 15:16:07 +01:00
Oğuz Ersen
1b254747c1 Translated using Weblate (Turkish)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>
2021-11-23 15:16:07 +01:00
simmon
13385a62d3 Translated using Weblate (Korean)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-11-23 15:16:07 +01:00
Pino Toscano
b5b8a94ea9 Translated using Weblate (Italian)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2021-11-23 15:16:07 +01:00
Piotr Drąg
91541d790e Translated using Weblate (Polish)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2021-11-23 15:16:06 +01:00
Daniel P. Berrangé
8d8923d259 Bump version to 11.0 and update NEWS for release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-18 19:08:30 +00:00
Daniel P. Berrangé
ff5995b2fd rpm: switch to autosetup for applying patches
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-18 19:08:30 +00:00
Daniel P. Berrangé
beee9167cc rpm: add missing vte dependancy
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-18 19:08:30 +00:00
Yuri Chornoivan
1d2b572fe7 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (176 of 176 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2021-11-18 19:58:29 +01:00
Weblate
61b22bfb0d Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2021-11-18 19:58:29 +01:00
Ettore Atalan
fc256e8916 Translated using Weblate (German)
Currently translated at 79.2% (141 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>

Translated using Weblate (German)

Currently translated at 76.9% (137 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/de/

Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>
2021-11-18 19:58:29 +01:00
Andika Triwidada
96fc838f56 Translated using Weblate (Indonesian)
Currently translated at 62.9% (112 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Andika Triwidada <andika@gmail.com>
2021-11-18 19:58:28 +01:00
Daniel P. Berrangé
8502424b88 Refresh pot file
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-18 18:30:07 +00: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
Pavel Borecki
cbbd7b5a93 Translated using Weblate (Czech)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2021-09-15 12:09:31 +02:00
Daniel P. Berrangé
2504431c8a ci: remove obsolete refresh script
We now use lcitool's manifest feature to generate files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-10 13:34:07 +01:00
Daniel P. Berrangé
a0f00dfe2b ci: re-generate containers/gitlab config from manifest
This uses the command "lcitool manifest ci/manifest.yml" to re-generate
all existing dockerfiles and gitlab CI config.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-10 13:34:07 +01:00
Daniel P. Berrangé
959b52f659 ci: define a CI manifest file
This is to be used with the command "lcitool manifest ci/manifest.yml"
to re-generate all existing dockerfiles and gitlab CI config.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-10 13:14:30 +01:00
Daniel P. Berrangé
a2323dccb2 gitlab: remove centos-7 build target
This platform is no longer supported by libvirt.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-10 12:37:37 +01: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
Hela Basa
38b3f50374 Translated using Weblate (Sinhala)
Currently translated at 2.2% (4 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/si/

Signed-off-by: Hela Basa <r45xveza@pm.me>
2021-08-19 09:04:52 +02: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
64a2ecdfe3 tests: Disable smartcard hotkey test to work around CI issue
The next commit fixes a bug which was causing
gtk_application_get_accels_for_action() in
virt_viewer_update_smartcard_accels() to incorrectly return nothing.
Now that it is correctly working,
gtk_application_get_accels_for_action() is internally trying to call
gdk_keymap_get_for_display(), which fails if there is no available X11
display.  This causes the CI pipeline to fail since the CI pipeline
doesn't have an X11 display.

To work around this, disable the smartcard hotkey test.

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é
ccf5c5eace ci: refresh centos-stream container
It is no longer possible to just install an extra package to run regular
centos into centos stream.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-27 16:50:29 +01: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é
56339ae111 gitlab: use custom docker:dind image
The current docker:dind container has broken default seccomp filter that
results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.

This custom image has a workaround that causes the seccomp filter to
return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
fallback to clone correctly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-27 14:55:13 +01:00
Charles Lee
3c2367bcc8 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: Charles Lee <lchopn@gmail.com>
2021-07-01 00:13:39 +02: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
Jan Kuparinen
7c38d07b86 Translated using Weblate (Finnish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-05-27 13:33:01 +02:00
Charles Lee
84c4ae4ae3 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 91.5% (163 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: Charles Lee <lchopn@gmail.com>
2021-05-27 13:33:01 +02: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
Daniel P. Berrangé
f48b17e4d0 Remove remaining traces of changelog
We intentionally stopped generating a changelog from git history in the
switch to meson, since the tiny number of people who care can just look
at the git history directly. For end users the "NEWS" file is a more
consumable record of what's changed at a high level.

The empty ChangeLog was still in git though from the autoconf days and
thus ended up in the meson generated dist. It was also still mentioned
in syntax check rules and the RPM spec.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-04 18:18:27 +01:00
Daniel P. Berrangé
dc378540ec rpm: set os-id when building for RHEL
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-26 15:01:58 +01:00
Daniel P. Berrangé
65fe7379f8 config.h: conditionally define REMOTE_VIEWER_OS_ID
It should only be set in config.h if it is not the empty string

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-26 15:01:50 +01:00
Daniel P. Berrangé
d07b1e5bad config.h: avoid extra hyphen in build ID value
The meson.build file already adds a hyphen.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-26 14:57:22 +01:00
Daniel P. Berrangé
7dc64fef6b rpm: explicitly tell meson to disable spice/ovirt
%meson will force enable all features, so simply omitting the
BuildRequires is not sufficient to disable spice/ovirt. Meson
must be explicitly told to do so.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-26 10:24:23 +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é
09f268b05f rpm: remove obsolete icon path from file list
This fixes

  commit 7040dded11aa363d54684da3295d8cd50a2eab3a
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Fri Feb 19 12:51:44 2021 +0000

    icons: remove obsolete usb icon

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-20 17:16:19 +01:00
Daniel P. Berrangé
6a9909b105 Add NEWS for 10.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-20 14:00:07 +01:00
Pino Toscano
ed58a1bd45 Translated using Weblate (Italian)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2021-04-20 10:46:51 +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
Jan Kuparinen
6f73712a16 Translated using Weblate (Finnish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-04-18 12:02:08 +02:00
Yuri Chornoivan
5f52dfc320 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2021-04-18 12:02:07 +02:00
Oğuz Ersen
3f0c5648b3 Translated using Weblate (Turkish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>
2021-04-18 12:02:07 +02:00
Göran Uddeborg
eab4097841 Translated using Weblate (Swedish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2021-04-18 12:02:07 +02:00
simmon
8ab6c1b02a Translated using Weblate (Korean)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-04-18 12:02:07 +02:00
Pino Toscano
ec6a76f7a5 Translated using Weblate (Italian)
Currently translated at 92.6% (165 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2021-04-18 12:02:07 +02:00
Pavel Borecki
68b3f7685a Translated using Weblate (Czech)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2021-04-18 12:02:06 +02:00
Piotr Drąg
3556498bff Translated using Weblate (Polish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2021-04-15 17:29:56 +02:00
Yuri Chornoivan
c97fa32d3f Translated using Weblate (Ukrainian)
Currently translated at 100.0% (154 of 154 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2021-04-14 18:15:44 +02:00
Oğuz Ersen
25f2a7822b Translated using Weblate (Turkish)
Currently translated at 100.0% (154 of 154 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>
2021-04-14 18:15:44 +02:00
simmon
b178007a7b Translated using Weblate (Korean)
Currently translated at 100.0% (154 of 154 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-04-14 18:15:44 +02:00
Piotr Drąg
ec1894e1de Translated using Weblate (Polish)
Currently translated at 100.0% (154 of 154 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2021-04-14 18:15:44 +02:00
Weblate
955ffbaee6 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2021-04-14 18:15:44 +02:00
Jan Kuparinen
6813440baa Translated using Weblate (Finnish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fi/

Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-04-14 18:15:43 +02:00
simmon
0b1fc2e97f Translated using Weblate (Korean)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>

Translated using Weblate (Korean)

Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-04-14 18:15:43 +02:00
Daniel P. Berrangé
8140b6448d po: regenerate POT file with missing UI files added
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-14 16:58:10 +01:00
Daniel P. Berrangé
e734a52cec po: add missing UI files to POTFILES
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-14 16:57:17 +01:00
Daniel P. Berrangé
82c14f3dea po: sort the POTFILES contents alphabetically
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-14 16:55:55 +01:00
Daniel P. Berrangé
32ad23bff7 Refresh translatable strings in pot file
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-14 11:39:57 +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
Jan Kuparinen
1589f90601 Added translation using Weblate (Finnish)
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-04-06 19:17:35 +02:00
simmon
330418f69c Translated using Weblate (Korean)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>

Translated using Weblate (Korean)

Currently translated at 33.5% (60 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-03-24 11:00:41 +01: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é
a511365d78 rpm: disable spice for RHEL-9
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-23 15:22:19 +00:00
Daniel P. Berrangé
2b9c9c51f8 rpm: disable govirt for RHEL-9
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-23 15:21:59 +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
Daniel P. Berrangé
abbd076fdb src: use embedded eye icon in password entry box
This improves the UI for the password auth box by using an inline icon
for showing/hiding the password text. This is the UI pattern uses by
GNOME shell and other GTK applications.

The two svg files added here are copied from the GTK4 codebase which
is under the LGPLv2+.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00
Daniel P. Berrangé
c6f429627c src: remove SIGINT handler after first firing
If you press Ctrl-C while the auth dialog is active it gets ignored
because calling g_application_quit() won't break out of the model
g_dialog_run() call.

By removing the SIGINT handler after first firing, we can at least let
the user press Ctrl-C a second time to force quit.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00
Daniel P. Berrangé
5b44064b35 src: use the same application ID for remote-viewer and virt-viewer
Gtk uses the application ID to lookup resource entries compiled into the
application. The application ID must match the path in the gresource.xml
file for this to work correctly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-18 11:26:37 +00:00
simmon
23a6ee68d8 Translated using Weblate (Korean)
Currently translated at 30.7% (55 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ko/

Signed-off-by: simmon <simmon@nplob.com>
2021-03-08 20:01:47 +01:00
Victor Toso
81129f8eb1 build: fix build without gtk-vnc
Without gtk-vnc we get implicit function declaration for
VIRT_VIEWER_IS_SESSION_VNC. Introduced at 8bc91ac "session: remove
"session-error" signal" in 2021-02-18

As we are already using #ifdef here, I've also changed the ternary to
an if for clarity.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2021-03-08 17:05:42 +01:00
Daniel P. Berrangé
04c2c4a035 build-aux: set MANUFACTURER env when building MSI
This needs to be set via an env variable so that it can be overridden by
vendors building their own MSIs downstream.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:53:55 +00:00
Daniel P. Berrangé
df4f0a8d4f data: fix URLs in wxs file
The download site is on virt-manager.org, not virt-tools.org, so lets
use that site, with TLS too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:53:55 +00:00
Daniel P. Berrangé
7040dded11 icons: remove obsolete usb icon
We are now using a standard symbolic icon so don't need the custom USB
icon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:33:06 +00:00
Hela Basa
d71c56dacd Added translation using Weblate (Sinhala)
Signed-off-by: Hela Basa <r45xveza@pm.me>
2021-03-03 22:00:42 +01:00
Daniel P. Berrangé
0c94c1f844 man: document the default cursor ungrab sequence in man pages
While the window titlebar already displays the ungrab sequence when a
grab is active, it doesn't hurt to also document it upfront for people.

Fixes https://gitlab.com/virt-viewer/virt-viewer/-/issues/10
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-03 14:45:03 +00:00
Daniel P. Berrangé
044534899b rpm: include buildid components in MSI filename
The MSI file can contain different content with each change in build ID,
but the filename never changes. This creates confusion as to whether the
MSI is actually up to date or not. It requires the looking inside the
MSI to see the encoded version.

The RPM uses 2 components from the %release field as input for the build
ID value. Use these as two parts of the filename, separated from the
version with a "-" similar to how RPM version/release are separated.

IOW, an RPM

   mingw32-virt-viewer-msi-9.0-1.fc33.noarch.rpm

will result in

   virt-viewer-x64-9.0-1.0.msi

while

   mingw32-virt-viewer-msi-9.0-1.fc33.1.noarch.rpm

will result in

   virt-viewer-x64-9.0-1.1.msi

Essentially we've just stripped the %dist part (".fc33") out of
the release, and default the second component to "0" if omitted.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-01 22:25:54 +00:00
Geert Warrink
c34984c41e Translated using Weblate (Dutch)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/nl/

Signed-off-by: Geert Warrink <geert.warrink@onsnet.nu>
2021-03-01 23:07:34 +01:00
Daniel P. Berrangé
febf72fe26 src: switch to preferring gtk dark theme
This enables the app to use the dark theme when running in environments
where a dark theme is available.

This is not done in Windows because the dark theme looks quite odd when
run on older versions of Windows where GTK can't replace the titlebars
by default.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
0f1c12dc38 src: add help window showing keyboard shortcuts
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
49a67971af src: make use of header bar subtitle for ungrab hint
The header bar includes space for both a title and subtitle. By using
the latter for the ungrab hint, we avoid having such a long title.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
c43eb057bd src: convert full screen toolbar to GtkHeaderBar
The user interface for the fullscreen toolbar is now identical to that
seen when non-fullscreen. All that differs is that the toolbar autohides
in fullscreen mode and doesn't expand to fill the window width.

There is a complication with the timed revealer and menus. With
traditional GtkMenus, it appears a grab is held as long as the menu is
open, so the revealer won't hide the toolbar. With modern GtkPopover
based menus, however, the revealer hides the toolbar despite the menu
being open, and thus in turn hides the menu.

This hacks around the problem by setting the header buttons to force use
of a traditional GtkMenu instead of a GtkPopover. It is not quite as
visually pretty, but at least it works.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
bb9664de38 src: switch main window to use GtkHeaderBar
This removes the main menu bar in favour of using the GtkHeaderBar with
integrated bars. This reduces the amount of vertical screen real estate
consumed by the application, leaving more for the guest display. The new
buttons are laid out to make the more common actions available with a
single click.

The buttons are grouped into two sets. On the left hand side of the
header are buttons that are interacting with the server

 - Send key
 - USB device selection
 - Monitor selection and VM pause/shutdown

whle on the right hand side are buttons interacting with the local user
interface

 - Fullscreen
 - Preferences / About / Guest detail / zoom level

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
2f11e0a407 src: convert accelerator handling over to actions
This better decouples the accelerator handling from the current user
interface design.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
407836ecee src: convert displays menu to use actions
This better decouples the user interface from the implementation.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
4ae25cdf46 src: switch most menu and toolbar buttons to use actions
This decouples the user interface from the functional implementation
more cleanly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
1ffee18864 src: convert smartcard and machine menus to use actions
This better decouples the user interface from the implementation.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
d35ca0b099 src: introduce more window level actions
All the menu / toolbar callbacks are given equivalent action
implementations.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
71a583bae6 src: introduce some application level actions
The machine pause/reset/powerdown and smartcard insert/remove operations
can implemented directly by the application class as they require no UI.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
5a0bf52d73 src: introduce public helpers for changing cd and screenshot dialogs
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
049f93d90a src: introduce public helpers for about and guest details dialogs
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
825975d2e7 src: introduce public helpers for changing zoom levels
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
29d0c7cecd src: decouple accelerators array from actions array
We will be adding many more actions shortly, so cannot keep the two
arrays' sizes in sync.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
ef6485c63e src: remove conditional test when setting USB reset accelerator
The first time this method is called we know that
usb_device_reset_accel_valid will be FALSE.

The other times this method is called all pass override=TRUE.

Thus the conditional test in virt_viewer_set_usb_device_reset_accel
always evaluates to TRUE and thus can be removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Eduard Lucena
bb51ddb72f Translated using Weblate (Spanish)
Currently translated at 83.7% (150 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/es/

Signed-off-by: Eduard Lucena <eduardlucena@gmail.com>
2021-02-19 00:06:53 +01:00
Igor Gorbounov
8199a74091 Translated using Weblate (Russian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ru/

Signed-off-by: Igor Gorbounov <igor.gorbounov@gmail.com>
2021-02-19 00:06:53 +01:00
Daniel P. Berrangé
efbc5f9c91 src: build as a GUI app
This hides the console window when running on Windows platforms

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 22:41:00 +00:00
Daniel P. Berrangé
e71c72490d src: replace deprecated GtkVBox with GtkBox
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
71d146f3d0 src: recreate .ui files with latest glade
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
eb9dffbbd9 src: set min gtk to 3.18 to match glib 2.48 vintage
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
6c6af77fdd src: remove setting of resize grip property
This API is deprecated since GTK 3.14 as the concept has been removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
496f99f5da src: remove deprecations squash for g_strv_contains
We rely on new enough glib version, so don't need to squash warnings.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Jakub Janků
5a55d43796 vnc-session: use g_signal_connect_object
If the VncDisplay emits a signal and the VirtViewerSessionVnc
instance is no longer valid, using the pointer inside one of the
callbacks can lead to segfault.

To prevent that, use g_signal_connect_object instead of
g_signal_connect.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1911224

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:25 +01:00
Jakub Janků
8bc91ac80f session: remove "session-error" signal
This partially reverts commit de5cd71.

Problem with that commit is, that it practically renders
the "session-auth-*" signals from vnc session useless.
That's because gtk-vnc currently emits "vnc-error" before each
"vnc-auth-*" signal and the error callback in virt-viewer-app.c
calls virt_viewer_app_disconnected(), which in turn closes
the session.
As a consequence, virt-viewer never retries authentication
with vnc, it simply exits.

Since the last commit, vnc, similarly to spice, emits
"session-disconnected" with the appropriate error message. Thus
there's no need to maintain separate "session-error" signal
for now.

With vnc, this error message is shown to the user in a dialog,
if the disconnect happened during the init phase.
"session-auth-*" callbacks create their own dialogs, so
initialized must be set to TRUE to avoid having a dialog
displayed twice.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1911224

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:22 +01:00
Jakub Janků
11ec065ce2 vnc-session: save message from "vnc-error" for "vnc-disconnected"
"vnc-error" is always followed by "vnc-disconnected".
So save the error message and use it in "vnc-disconnected" callback.

"session-disconnected" already allows us to set a string
with details on why the disconnection happened.

This approach is also similar to the one in spice session
(GError is saved in virt_viewer_session_spice_channel_destroyed).

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:16:29 +01:00
Daniel P. Berrangé
942fc8c6fb src: remove G_BEGIN_DECLS / G_END_DECLS
None of our header files are installed for public use, so these macros
are not required.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
3ae426e926 src: switch to using "#pragma once" for headers
We can rely on GCC/CLang and thus use this more concise approach

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
25092c2122 src: centralize the editor indentation rules
Instead of repeating an emacs footer in every source file, use config
files in the root of the repository. This fixes the bug that several
source files are missing the indent rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
396f31cb4b tests: convert VirtViewerTest to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
aa8bb67972 src: convert OvirtForeignMenu to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
622d5c2e3e src: convert RemoteViewerISOListDialog to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
06b57ee1fe src: convert RemoteViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
5c8c6db41b src: convert VirtViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
080a6fefe2 src: convert VirtViewerFileTransferDialog to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
58a8e71404 src: convert VirtViewerTimedRevealer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
18322a9551 src: convert VirtViewerNotebook to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
4973411ed8 src: convert VirtViewerSessionVnc to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
1985713f78 src: convert VirtViewerSessionSpice to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
96c24fd9db src: convert VirtViewerSession to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
025fbb2470 src: convert VirtViewerFile to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
e382c931fd src: convert VirtViewerApp to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
99f6cd7f87 src: convert VirtViewerDisplayVnc to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
45b03df8b8 src: convert VirtViewerDisplaySpice to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
8519b2f737 src: convert VirtViewerDisplayVte to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
4e4bd0d67f src: convert VirtViewerDisplay to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
10b2850d70 src: convert VirtViewerWindow to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
7a71409028 build: bump min required glib to 2.48
All our targetted distros have this vintage glib letting us remove some
compat code, and introduce future use of new features.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
b5cf22481f build: fix formatting of build id parameter for wxs file
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
5400e86e4d rpm: fix passing of build-id parameter
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
253a14f754 build-aux: fix typo in ovirt conditional for MSI build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
16a3d08d09 build: fix version in meson
The next version we're working on is going to be 10.0, not 3.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Shawn M. Chapla
bda6dbbecf Don't double attach accels on enable window mods
Check whether accels are currently attached to a window before attaching
them when enabling window modifiers.

This commit fixes an assert in _gtk_accel_group_attach introduced by
cfcac9fb, which erroneously assumed that is harmless to re-add accel
groups that have already been added to a window.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2021-02-14 14:51:06 -05:00
玉堂白鹤
70b90370e2 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: 玉堂白鹤 <yjwork@qq.com>
2021-02-05 14:40:12 +01:00
Daniel P. Berrangé
1f814df294 build: remove all traces of autotools build recipes
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
8eb7ff6688 gitlab: don't block container / build jobs on DCO check
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
f03e009eb7 gitlab: convert CI to use meson instead of autotools
A new 'codestyle' job is added for syntax-check, since that is not run
as part of the 'dist' target.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
ef2a679d69 build: convert release script over to use meson
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
1f701aae66 rpm: convert the RPM builds over to using meson
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
b2c072cf0b build: introduce meson build recipes
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
f21cb3d233 icons: install svg files into the "scalable" directory
The USB SVG was mistakenly installed into a size specific dir, while the
main logo was not installed at all.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
3a57d746a6 src: ensure all spice channel types have enum cases
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
eb3641f347 src: simplify some conditionals related to features lacking on Windows
This avoids the need to probe for them prior to build.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
c78adca86f src: mark argc/argv unused in windows command line wrapper
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
0fdd3ed563 src: avoid warning about strncpy without trailing NUL
We know that the destination will already have a trailing NUL after the
three characters we're copying. The compiler can't see this though and
warns about lack of NUL termination.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
f6007cfad1 src: enable more format string validation at build time
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
24bf4c998d src: switch to use G_GNUC_FALLTHROUGH macros
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
45dd26ece2 src: add missing COMMON_CFLAGS to libvirt_viewer_util.la
This ensures that G_LOG_DOMAIN is used in all places, and in turns
highlights a bug in the test suite.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
0dab000823 src: remove use of 'volatile' from enum type decl
This avoids warnings with latest glib/gcc

src/virt-viewer-enums.c: In function ‘virt_viewer_display_show_hint_flags_get_type’:
/usr/include/glib-2.0/glib/gatomic.h:112:5: error: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Werror=incompatible-pointer-types]
  112 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
src/virt-viewer-enums.c:34:7: note: in expansion of macro ‘g_once_init_enter’
   34 |   if (g_once_init_enter (&g_define_type_id__volatile))
      |       ^~~~~~~~~~~~~~~~~

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
041857e677 tests: ensure compiler knows the argv[0] is non-NULL
../tests/redirect-test.c
/usr/i686-w64-mingw32/sys-root/mingw/include/winbase.h: In function 'WinMain':
../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=]
  318 |     fprintf(log_f, "argc %d argv[0] %s \n", argc, argv[0]);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=]

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
7f9aba52c7 build: remove obsolete minimize-po.pl script
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
98c2628f44 build: merge all syntax-check logic into one file
The gnulib syntax-check rules are spread across GNUmakefile, cfg.mk and
maint.mk. This made sense when we were getting two of the files from the
gnulib submodule. Now that we own all files though, we can at least
merge maint.mk and cfg.mk together. GNUmakefile can be eliminated when
we switch to meson.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
c8384180c8 build: delete all syntax check rules we're skipping
If we've marked rules as skipped, there's no sense keeping them in the
maint.mk file.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
e30f842b24 build: remove all logic unrelated to syntax-check
The standard maint.mk from gnulib provides alot more than just the
'syntax-check' target. This can all be purged to give a more minimal
file.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
a743d85c4e build: move cfg.mk and maint.mk into build-aux directory
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
a95a5f71a7 rpm: remove obsolete desktop file script deps
This is handled automatically by RPM post-transaction.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
0e2051ac21 rpm: remove dep on update-alternatives
This is obsolete since the removal of the spice-xpi helper

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
d4b37dac04 rpm: don't subsititute in package name
This is always a fixed constant.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
15cd58093a rpm: drop rule for obsleting spice-client
The old package has been gone for long enough.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
a47eb848c1 rpm: remove conditionals for spice/ovirt/bash-completion
We can assume that we have a new enough distro for all these features.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
db6c067c93 rpm: use https for URLs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
f36bd36667 rpm: remove version numbers from deps
We can assume that the distros we target have sufficiently new versions
of all our dependencies.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
d1ed3d4e75 gitlab: refresh container images
This replaces opensuse 15.1 with 15.2

This bring in the missing vte package dep

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Uri Lublin
74fdd26c94 vnc: no dialog for server-closed-connection error
Following commit de5cd71, when the server closes the connection
(likely when qemu-kvm exits), a dialog is shown to the user.

This behavior change is not good for automatic tests that expect
virt-viewer to exit without any dialog.

This patch makes sure no dialog is shown for this error, by
checking if the VNC connection was already initialized.

Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-18 22:48:47 +02:00
Daniel P. Berrangé
696b835911 gitlab: convert to use meson for libvirt-glib
https://gitlab.com/libvirt/libvirt-glib/-/issues/2
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-12 20:05:44 +00:00
Uri Lublin
7c442b60b3 zoom hotkeys: disable numpad when users set new hotkeys
If a user sets any hotkey, disable numpad hotkeys.
If a user does not set any hotkey and the default hotkeys
are enabled, then numpad hotkeys are enabled too.

This is a folloup for commits a40c8f4 and e89e82e + 8cc0667.
Currently setting (e.g. ctrl [123]) hotkeys for zoom (in/out/reset),
re-enable the default numpad hotkeys (ctrl [+-0]).

Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1791261

Suggested-by: Jakub Janků <jjanku@redhat.com>
Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-12 12:13:05 +00:00
Daniel P. Berrangé
b23b53a728 gitlab: update build rules for changed gtk-vnc meson options
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-11 17:01:38 +00:00
Uri Lublin
ae3e15f851 man: add zoom hotkeys
Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-05 11:06:19 +02:00
Uri Lublin
8de1e49136 tests: hotkeys: add zoom hotkeys
Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-05 11:06:19 +02:00
Uri Lublin
8cc0667023 hotkeys: enable setting zoom hotkeys from a vv file
Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-05 11:06:19 +02:00
Uri Lublin
e89e82eeb9 hotkeys: enable setting zoom hotkeys from command line
Signed-off-by: Uri Lublin <uril@redhat.com>
2021-01-05 11:06:19 +02:00
Weblate
5952d51dd8 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2021-01-04 17:05:30 +01:00
Andika Triwidada
d2dca584c0 Translated using Weblate (Indonesian)
Currently translated at 27.9% (50 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Andika Triwidada <andika@gmail.com>

Translated using Weblate (Indonesian)

Currently translated at 13.9% (25 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Andika Triwidada <andika@gmail.com>

Translated using Weblate (Indonesian)

Currently translated at 2.7% (5 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/id/

Signed-off-by: Andika Triwidada <andika@gmail.com>

Added translation using Weblate (Indonesian)

Signed-off-by: Andika Triwidada <andika@gmail.com>
2021-01-04 17:05:30 +01:00
Jakub Janků
c3a3f23968 disable default grab sequence in kiosk mode
Hotkeys should be disabled in kiosk mode. However, if no
"release-cursor" hotkey is specified, the default Ctrl+Alt
grab sequence keeps functioning even in kiosk mode.
That's because it's based on the spice/vnc functionality instead
of on the accelerators in virt-viewer.

That's especially problematic with spice, because the grab
sequence releases both the cursor and the keyboard. Thus the user
can escape from kiosk mode by pressing Ctrl+Alt followed by
Alt+Tab, for example.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1893584

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-01-04 13:33:34 +00:00
Daniel P. Berrangé
1e18203e55 ci: refresh containers for CentOS-8 PowerTools repo rename
A recent CentOS-8 update renamed the "PowerTools" repo to "powertools"
and since dnf is case sensitive wrt repo names, this broke ability to
build new containers.

The refresh fixes the repo name and pulls in other misc improvements
to containers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-15 10:43:40 +00:00
Daniel P. Berrangé
dae506032f gitlab: rename dockerfiles to have a "ci-" prefix
This means the dockerfile has the same name as the generated container
image.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-04 10:42:59 +00:00
Daniel P. Berrangé
bf29e894c8 gitlab: refresh containers with lcitool for fully minimized base
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-04 10:42:59 +00:00
Daniel P. Berrangé
ab84b11b2d gitlab: re-generate container images from lcitool
This introduces Fedora 33 and removes some redundant packages.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-04 10:42:59 +00:00
Daniel P. Berrangé
3d3f0fbe26 gitlab: move dockerfiles into ci/containers sub-directory
This brings the repo into alignment with the main libvirt.git practice.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-04 10:42:59 +00:00
Jakub Janků
a40c8f4508 windows: fix nonuniform behavior of zoom hotkeys
If a vv file is used or the hotkeys are customized using the
--hotkeys cmd option, all hotkeys that are not explicitly
requested get disabled, this includes the zomm hotkeys.

As a consequence, the labels for zoom actions in the menu
disappear. However, the user can still perform these actions
using the keys on the numpad which are handled separately.

To fix it, check that the normal zoom hotkeys are enabled
before enabling the keypad ones.

Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1791261

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2020-12-03 14:50:26 +01:00
Shawn M. Chapla
d5e96a30cb Don't re-enable kiosk mode in virt_viewer_window_show
There is nothing that would disable any aspect of kiosk mode that would
ever need to be enabled with a call to virt_viewer_window_show. To the
contrary, "re-enabling" kiosk mode in virt_viwer_window_show can, in
certain cases, result in accels becoming disable despite the keyboard
being released.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2020-11-26 19:48:21 +00:00
Shawn M. Chapla
cfcac9fb9d Add all accel groups when enabling window mods
Previously, enabling window modifiers would only add accel groups that
had presumably been disabled to the window in question. This was fragile
and caused bad behavior in cases when the criteria for whether or not an
accel group should be enabled changed between the time the groups were
disabled and re-enabled, potentially leading to certain groups never
being re-added. There is no harm in adding accel groups that are already
added to a window, so this change simply eliminates the unnecessary
check.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2020-11-26 19:48:20 +00:00
Shawn M. Chapla
6af952adb9 Disable all accels when not grabbed in kiosk mode
Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2020-11-26 19:48:20 +00:00
Shawn M. Chapla
f08cb607a4 Add "USB device reset" accel
Adds a "USB device reset" default keyboard shortcut (ctrl+shift+r), as
well as the option to override this shortcut with the --hotkeys opt.
Updates documentation accordingly.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2020-11-26 18:22:23 +00:00
Shawn M. Chapla
1608dabd9f Add "USB device reset" option to File menu
Adds a "USB device reset" option to the File menu. When selected, "USB
device reset" will disconnect and reconnect all currently connected USB
devices.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2020-11-26 18:22:23 +00:00
Frediano Ziglio
1573a790da Fix warning by Coverity
Error: DEADCODE (CWE-561): [#def1]
virt-viewer-9.0/src/virt-viewer-display-vte.c:164: assignment: Assigning: "scroll" = "NULL".
virt-viewer-9.0/src/virt-viewer-display-vte.c:188: null: At condition "scroll", the value of "scroll" must be "NULL".
virt-viewer-9.0/src/virt-viewer-display-vte.c:188: dead_error_condition: The condition "scroll" cannot be true.
virt-viewer-9.0/src/virt-viewer-display-vte.c:189: dead_error_begin: Execution cannot reach this statement: "gtk_container_add((GtkConta...".
virt-viewer-9.0/src/virt-viewer-display-vte.c:189: effectively_constant: Local variable "scroll" is assigned only once, to a constant value, making it effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make "scroll" not remain constant.

Reported in https://gitlab.com/virt-viewer/virt-viewer/-/issues/7.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-11-26 10:26:02 +00:00
Daniel P. Berrangé
db827dedc9 Add a --shared / -s flag for shared session access
By default when connecting with VNC, an existing viewer will be kicked
off. This adds a --shared / -s flag which tells the server we are
willing the share the session with other clients.

This is wired up for VNC only.

https://bugzilla.redhat.com/show_bug.cgi?id=1060425

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-26 09:55:58 +00:00
Jean-Baptiste Holcroft
9ccc0bf614 Translated using Weblate (French)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fr/

Signed-off-by: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
2020-11-26 10:13:12 +01:00
Yuri Chornoivan
c967876952 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2020-11-26 10:13:12 +01:00
Oğuz Ersen
38e32b01a8 Translated using Weblate (Turkish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>
2020-11-26 10:13:12 +01:00
Göran Uddeborg
6b32a1aab6 Translated using Weblate (Swedish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2020-11-26 10:13:12 +01:00
Pino Toscano
f4bb26480d Translated using Weblate (Italian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-11-26 10:13:12 +01:00
Pavel Borecki
9fa5e31669 Translated using Weblate (Czech)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2020-11-26 10:13:12 +01:00
Piotr Drąg
b2b23a8f2a Translated using Weblate (Polish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2020-11-26 10:13:12 +01:00
Weblate
9ab1f0c554 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-11-26 10:13:12 +01:00
Uri Lublin
de5cd71013 vnc: show an error dialog upon vnc-error
For example when connecting by accident to a spice server

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-10-27 19:53:40 +02:00
Pino Toscano
b7a2f05266 po: update pot file
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-11 11:35:00 +02:00
Uri Lublin
d880ce4a40 about ui: year 2020 in Copyright
rhbz#1848267

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-09-08 15:36:38 +03:00
Whired Planck
ae4a8fc48a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: Whired Planck <fungdaat31@outlook.com>
2020-08-31 05:29:25 +02:00
Julien Humbert
6960919074 Translated using Weblate (French)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/fr/

Signed-off-by: Julien Humbert <julroy67@gmail.com>
2020-08-28 14:35:11 +02:00
Frediano Ziglio
28a330758f win32: Enable some additional security flags for Windows executables
Enable ASLR and NX options.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-08-27 15:02:49 +01:00
Weblate
0ddf959abb Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-08-19 22:42:09 +02:00
Göran Uddeborg
3e5b8cc69b Translated using Weblate (Swedish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/sv/

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2020-08-19 22:42:09 +02:00
Oğuz Ersen
cbcf5dd60c Translated using Weblate (Turkish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/tr/

Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>
2020-08-19 22:42:09 +02:00
Haochen Tong
03f8a8ff5a virt-viewer-display: fix guest display size on HiDPI host
Signed-off-by: Haochen Tong <i@hexchain.org>
2020-08-19 20:11:13 +00:00
Daniel P. Berrangé
d8c329b024 gitlab: adapt CI rules for libvirt use of meson
Libvirt changed from using autotools to meson, so we need to adapt the
GitLab CI recipe.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-19 18:32:24 +01:00
Yuri Chornoivan
e4a065c7ee Translated using Weblate (Ukrainian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2020-07-29 15:29:24 +02:00
Pino Toscano
b07d16b8eb Translated using Weblate (Italian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-07-29 15:29:21 +02:00
Pavel Borecki
117482a611 Translated using Weblate (Czech)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/cs/

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2020-07-29 15:29:19 +02:00
Piotr Drąg
d36be19994 Translated using Weblate (Polish)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2020-07-29 15:29:16 +02:00
Weblate
740d84ea2b Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-27 11:32:49 +02:00
Pino Toscano
dcbac960f4 po: update pot file
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-25 06:56:24 +02:00
Pino Toscano
9957a6d6d8 po: use custom ITS rules when extracting messages
This way the custom rules for translating MIME types are used, and thus
the MIME type XML files are properly extracted.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-25 06:54:28 +02:00
Pino Toscano
e4e6462818 mime: rename <_comment> to <comment>
Since gettext is used to extract this file, there is no more need to
prefix the translatable tags with underscore as intltool required.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-25 06:51:10 +02:00
Weblate
b970c7f466 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-24 15:16:52 +02:00
Yuri Chornoivan
41059e0907 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2020-07-24 15:16:52 +02:00
Pino Toscano
38fb4f7f49 Translated using Weblate (Italian)
Currently translated at 99.4% (177 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-07-24 15:16:52 +02:00
Piotr Drąg
298bfa29e7 Translated using Weblate (Polish)
Currently translated at 100.0% (178 of 178 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2020-07-24 15:16:52 +02:00
Weblate
4d6aa3203d Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-24 15:16:52 +02:00
Pino Toscano
130dc172af Translated using Weblate (Italian)
Currently translated at 98.4% (193 of 196 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/it/

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-07-24 15:16:52 +02:00
Balázs Meskó
7d5e1f8040 Translated using Weblate (Hungarian)
Currently translated at 100.0% (196 of 196 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/hu/

Signed-off-by: Balázs Meskó <meskobalazs@mailbox.org>
2020-07-24 15:16:52 +02:00
Geert Warrink
0acbe04bc4 Translated using Weblate (Dutch)
Currently translated at 100.0% (196 of 196 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/nl/

Signed-off-by: Geert Warrink <geert.warrink@onsnet.nu>
2020-07-24 15:16:52 +02:00
Weblate
6a2393c717 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-24 15:16:52 +02:00
Yuri Chornoivan
a7cf9c665c Translated using Weblate (Ukrainian)
Currently translated at 100.0% (196 of 196 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2020-07-24 15:16:52 +02:00
Piotr Drąg
8d1d0984aa Translated using Weblate (Polish)
Currently translated at 100.0% (196 of 196 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/pl/

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2020-07-24 15:16:52 +02:00
Pino Toscano
7f3317e578 VM selection: sort items
Even if the view has search capabilities built-in, show the VM names
sorted so it is easier to visually search for them.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
4b7f2ac0ec Use VM descriptions if available
When listing the running VMs in a libvirt connection, use the
descriptions as tooltips if available.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
e2abe953ed VM selection: expand models for tooltip column
Add a new column in the list models for the VM selection dialog, and use
this new column to hold the tooltip of the items in the list.

At the moment nothing is set in the new column, so there is no behavior
change.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
2e46ffc08d Use VM titles if available
When listing the running VMs in a libvirt connection, use the titles if
available.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
74d25742ea VM selection: expand models for UI/key columns
Add a new column in the list models for the VM selection dialog, and use
this new column to hold the key of the VM. This way, the first column
represents the UI representation of the VM without affecting the key.

At the moment the VM name is set for both, so there is no behavior
change.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
c28374d8a8 Unconditionally use virDomainOpenGraphicsFD
libvirt 1.2.8 is required now.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 11:38:16 +02:00
Pino Toscano
00515915e5 build: bump libvirt requirement to 1.2.8
It was released almost 6 years ago, so already available for a long time
in supported distributions. This way, it is possible to use
virDomainOpenGraphicsFD without checks.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 11:38:16 +02:00
Pino Toscano
e05169c0e8 Modernize AppStream file
- use the "desktop-application" component instead of the old "desktop"
- do not specify a type for the id, and remove the .desktop suffix;
  it is implicit for type=desktop-application
- move the URLs of screenshots within <image> tags
- simply remove the non-standard <updatecontact>, instead of converting
  it to <url type="contact">, as it is the same
- add URLs for the bug tracking, and the translation system

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 16:43:59 +02:00
Pino Toscano
05de79c4db build: appdata -> metainfo
Rename our makefile bits to metainfo as better naming.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 16:43:04 +02:00
Pino Toscano
e1e345a9a3 Install the AppStream file to the canonical location
The canonical location for AppStream XML files has been changed to
/usr/share/metainfo four years ago at least, with /usr/share/appdata
left as legacy location. It is time to switch to the right location.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 16:41:41 +02:00
Pino Toscano
7a991e4ad5 po: update pot file
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
35443daed4 Remove unused i18n translation
All the g_printerr does is printing the message of the GError with a
newline at the end. Hence, use a simple format string without the need
to translate it.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
0325901984 Create single strings for the window title
Currently there is a strings with four placeholders that represents
optional bits: the "press to release", a whitespace (!), the subtitle,
and the application title. This is suboptimal, because it hides the way
the title is composed, and makes it hard to properly translate.

Instead of this string puzzle, create separate strings for each case
(there are only four of them, and one is only the application title).
Each of the string has all the static text availale, with a proper
comment explaining the layout.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
6621cc2f33 po: extract translator comments
Extract the only comments preceeding messages that start with
"translators:".

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
debedd40d1 Disambiguate "unknown" messages
Give them a context to explain what is the "unknown thing", so it is
possible to provide proper translations.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
88e4d565a3 po: extract also C_
This represents messages with context.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
8db413e689 Fix few spellings
"ID", "oVirt", "SSH", "UNIX", "URI", "UUID"

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
b2a2a02b5b Show localized accelerators in Send key menu
Turn the menu labels into GTK accelerator strings, so we can parse them
to convert them into a proper user representation.

There is a small behaviour change: the menu items do not have mnemonics
anymore by default.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:38 +02:00
Pino Toscano
671f79bd7d ui: improve homepage in about dialog
Switch the homepage URL to https, and synchronize the label with the
URL. Also, do not make the label translatable, as it is pointless (it is
only a URL).

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-22 12:08:25 +02:00
Pino Toscano
44c03148f1 ui: use the standard about dialog license type
Use the standard gpl-2-0 license type of GtkAboutDialog, instead of the
custom license text: this way, the dialog will show a translated text
with the license type, and a link to the full license text.

As side change due to the editing of this file in glade 3.36: set the
logo icon name to "virt-viewer", even if at runtime a logo/image will be
loaded. glade needs a logo set, either as icon name or as pixmap.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-22 12:04:33 +02:00
Frediano Ziglio
522cca5ac1 virt-viewer-file-transfer-dialog: Reports detailed errors
Instead of showing just a generic error with a list of files group
files by error and show them.

This solves https://bugzilla.redhat.com/show_bug.cgi?id=1753563

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-15 10:52:24 +01:00
Frediano Ziglio
ae25f6ca6b More specific key accelerator description
The default key accelerator to release mouse if left control and
left alt but the current description is "Ctrl+Alt", change to
"Ctrl_L+Alt_L" to avoid misunderstanding.

This solves https://bugzilla.redhat.com/show_bug.cgi?id=1548371

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-15 08:13:45 +01:00
Weblate
24c6a613eb Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-14 11:04:18 +02:00
Daniel P. Berrangé
edd20d4c91 po: dedupe authors in translations
Weblate gets confused if the same email address is mentioned multiple
times in the translation headers. Dedupe authors so that each author
is mentioned only once, with a range of years listed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-13 20:57:13 +00:00
Daniel P. Berrangé
350d92c926 po: switch over to using Weblate for translations
Weblate works a slightly different way than Zanata. Instead of manually
pushing a pot file and fetching po files, Weblate is going to work
automatically with GitLab Merge requests. The main pot file must be
committed to git, and then Weblate fully manages the .po files, using
merge requests to send updates back.

With this new system we don't have a separate .mini.po file. The main
.po file is partially minimized by removing locations but does not
have non-translated msgids removed. This is not a big downside if we
consider that over time most translations should trend towards 100%
translated, and we have purged all 100% non-translated languages.

The main .pot file is generated with alphabetic sort ordering instead
of the default source file location ordering, as this makes the diffs
stable across renames/code movement, which is something we used in the
old .mini.po files.

The only rules needed in the makefile are to refresh the .pot file
and to generate the .gmo files at install time. We must never touch
the .po files locally, not even to rebase them when the .pot is
updated, as that will create merge conflicts with Weblate. Weblate
will take care of all rebases of the .po files in its own fork of
the git repo, and open merge requests to send changes back when
needed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-13 20:57:13 +00:00
Daniel P. Berrangé
8a722020da po: delete all empty translations
There is no benefit to keeping .po files in git for languages which
have zero translated strings. make should also be honouring the list
in the LINGUAS file, not repeating it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-13 20:57:13 +00:00
Daniel P. Berrangé
9562e0cbcd ci: adapt for meson 0.55 change in cross compilers
Previously meson searched $PATH for libgcrypt-config, but it no longer
does this for cross-builds.

The dockerfile changes can be dropped when the following hits rawhide
container images:

  https://bugzilla.redhat.com/show_bug.cgi?id=1856446

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-13 18:54:11 +01:00
Frediano Ziglio
2f0d080179 iso-dialog: Fix leak and quoting
Do not leak memory in case of task cancelled.
Quote "msg" in case it contains some no-xml character that could
came from translated strings.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:52 +01:00
Frediano Ziglio
8297a178c4 Minor updates to accel_key_to_keys
Make "modifiers" static, potentially avoids a copy to stack.
Use G_N_ELEMENTS also to allocate keys, as in the next loop
allowing to easily change "modifiers" size.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:52 +01:00
Frediano Ziglio
ff11d5937e iso-dialog: Give less scary error if there are no ISOs
Instead of a fail simply reply that there are no ISO files.

Message text was suggested by Radek Duda who reported the issue.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:19 +01:00
Eduardo Lima (Etrunko)
53dcc7fe52 foreign-menu: Avoid leaking 'name' variable in error path
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-07-01 11:14:38 -03:00
Daniel P. Berrangé
82a0612cc8 gitlab: add coverage of mingw builds
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
a0f4d1490a gitlab: add builds on CentOS 8 Stream
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
aa4482a223 gitlab: refactor recipe for native builds
Currently on every distro we build against the latest git libvirt
and related deps. We need to test multiple axis:

 - A variety of libvirt versions
 - A variety of distro versions

So this changes most jobs to build against the distro provided
libvirt and related deps. The CentOS 8 job is kept building
against latest git master libvirt and deps.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
42752d3ff0 data: replace unix2dos with sed
This avoids needing to install extra packages in the CI system

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
b2afd44cab rpm: add missing rest dep to RPM spec
We get this indirectly via govirt, but since we directly use its APIs,
we should list it as an explicit dep too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
3e1d619529 src: remove trailing whitespace
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
646662bceb gitlab: ensure "make syntax-check" is run during CI
This will stop style errors creeping in via merge requests

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
e587274b76 src: remove tab characters from indent
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Eduardo Lima (Etrunko)
bb3d020cb9 ovirt-foreign-menu: Take into account StorageDomains of type DATA
Now that we support both ISO and DATA storage domain types, we need to
make sure that the files are listed correctly. In this case we give the
domains of ISO type the precedence over DATA ones.

This change extends previous commit bbda3aa which made it possible for
storage domains of type DATA to be considered valid.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-06-25 23:02:03 -03:00
Eduardo Lima (Etrunko)
42f408902e ovirt-foreign-menu: Use proper function in the case of DATA StorageDomains
Unlike the StorageDomain objects of ISO type, the DATA ones require a
specific API recently added to libgovirt to support them. This commit
makes use of those new functions under #ifdef guards and adds proper a
check to configure.ac.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1847223

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-06-25 23:02:01 -03:00
Julien Ropé
c6afc28cc9 Rather than adding a default extension to screenshots, display an error message to make the user add it.
This prevents the silent overwriting of the file, and still makes sure the user knows why we don't proceed.

Fix BZ#1752514

Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-06-09 15:50:02 +02:00
Stephen Thom
fedaa5f89a Added -K --keymap commandline option that allows user to block certain keypresses or to remap keypresses being sent to the underlying spice or vnc widget
Signed-off-by: Stephen Thom <sthom@williamhill.co.uk>
2020-06-05 14:12:19 +00:00
Daniel P. Berrangé
27ea968c70 gitlab: introduce CI jobs for building on multiple distros
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-22 12:22:00 +01:00
Daniel P. Berrangé
88d19fb210 gitlab: convert to use the common DCO check image
Instead of building our own DCO check image, just reuse the common image
provided by the libvirt-ci project.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-22 12:22:00 +01:00
Daniel P. Berrangé
c12131ef30 fix handling of enter/leave events in full screen revealer
The current code is using a single event handler for leave/enter and
looking at the mouse coordinates to decide whether it entered or left
the widget. This logic is completely broken when the window is
mimimized, because the mouse coordinates of the leave event are still
within the window boundary.

Switch to just have a separate handler for enter/leave events and stop
looking at mouse coordinates entirely.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-19 17:48:28 +01:00
Eduardo Lima (Etrunko)
bbda3aa71a ovirt: Do not filter out DATA storage domains
Since ovirt 4.2 it is acceptable to have ISO images in storage domains
of DATA type, while the usage of ISO type is about to be deprecated. The
code now allow both types of storage domains when looking up for ISO
images.

https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/release_notes/deprecated_features_rhv
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.4-beta/html/release_notes/deprecated_features_rhv

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1835640

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-05-19 10:30:21 -03:00
James Le Cuirot
ee173fc254
Add minimize button to toolbar
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2020-05-07 09:21:04 +01:00
Daniel P. Berrangé
ac316905b4 Update NEWS for 9.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01 17:30:25 +01:00
Ján Tomko
b0a95e9de2 README: prefer https over http
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-04-09 17:04:18 +02:00
Daniel P. Berrangé
ae4f4ea972 gitlab: introduce minimal CI job for checking DCO signoff
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-03 16:57:02 +01:00
Daniel P. Berrangé
beeff760ac docs: update to point users to gitlab.com project
The project primary git repo has moved from pagure.io to
gitlab.com/virt-viewer/virt-viewer.  We want users to submit
code contributions, bug reports and support questions to the
gitlab project, not the mailing list, nor bugzilla, nor the
virt-manager.org site.

We're still using virt-manager.org for hosting downloads of
source and pagure.io for MSIs, but we'll aim to change that
too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-03 14:08:10 +01:00
Julien Ropé
d84149a92c Fix potential file descriptor leaks found by Coverity.
The error code returned by virt_viewer_session_open_fd() and
virt_viewer_session_channel_open_fd() were not checked. The file
descriptor passed to them could then be left opened even if the function
failed, causing a leak of resources.

This was reported by a Coverity scan, logged under
https://bugzilla.redhat.com/show_bug.cgi?id=1655792

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-04-03 14:08:00 +01:00
Julien ROPE
e4bacb8fde remote-viewer: add a default extension to screenshot filenames
When doing a screenshot, if the user provides a filename without a file
extension, an error occurs because the image format could not be determined.
This patch adds a .png extension to such filenames, so that there is a default
file format for screenshots.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1752514

Reviewed-by: Victor Toso <victortoso@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-02-19 09:47:21 +01:00
Julien Ropé
e279712281 Remember monitor mapping on close.
When the application is stopped, if the windows are in fullscreen, their
position on the client will be remembered.

This change uses the existing option 'monitor-mapping' in the settings
file to save the position and reuse it on next launch.

This implements part of the requirement from
https://bugzilla.redhat.com/show_bug.cgi?id=1179070

NOTE: this feature is effective only with GTK >= 3.22

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-02-07 13:57:56 +00:00
Francesco Giudici
a724dff8a3 remote-viewer: add handler for SIGINT signal
When remote-viewer is started from terminal, CTRL-C sends a SIGINT
signal to the program causing immediate termination. On linux clients
usb redirected devices are left without any kernel driver attached,
causing them to appear as no more available to the host.
Add a SIGINT handler to allow a clean exit, in particular to allow
the kernel to attach back the host driver.
The issue is present on linux only.

To perform usb device redirection, virt-viewer leverages spice-gtk
library, which in turn relies on usbredir library, which uses libusb.
In order to take control of the usb device the auto-loaded kernel
driver must be detached. This is achieved (in the very end) with
libusb_detach_kernel_driver(). Then the device interfaces can be claimed
with libusb_claim_interface() and get in control to the application.
During normal application termination, the usb channel is teared down,
performing a reset of the usb device and giving back the control of the
device to the kernel (libusb_attach_kernel_driver()).
If the application quits without doing this, the device interfaces will
end up with no driver attached, making them not usable in the host
system.

Note that enabling libusb_set_auto_detach_kernel_driver() does not solve
the issue, as this is just a convenient API from libusb: libusb will
take care of detaching/attaching the driver to the interfaces of the usb
device each time a call to libusb_release_interface() and
libusb_claim_interface() is performed. An unexpected quit of the
application will skip the libusb_release_interface() call too, leaving
the interfaces without any driver attached.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1713311

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2020-01-17 16:37:52 +00:00
Daniel P. Berrangé
635b91d5e4 po: refresh translations from zanata
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-16 16:03:43 +00:00
Eduardo Lima (Etrunko)
b63e90f1f9 remote-viewer: Prefer ca-cert from display instead of proxy
Since oVirt engine version 4.3.2.1, the API returns certificate data for
display connection in the VM XML, so users do not need to specify it
from the command line anymore. The certificate obtained from the XML
gets precedence over the one from the command line, which is still kept
to keep compatibility of older versions of oVirt.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1402909

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-11 10:55:00 -03:00
Victor Toso
a13173ae64 remote-viewer: fix free on dangling pointer
On remote_viewer_session_connected() we are passing a dup of URI of
connection and freeing it afterwards. Problem is, we don't disconnect
from listening "session-connected" and on an eventual second emission
of this signal, remote-viewer crashes as seen in the backtrace below.

This can happen over switch-host migration message from
SpiceMainChannel.

A fix trying to use VirtViewerApp URI avoid the crash but introduces
regression while running remote-viewer with ovirt so, keeping the
changes to a minimum to avoid it, just use g_intern_string() for now.

Found it while improving migrate.py from spice/tests (server):
 | Invalid free() / delete / delete[] / realloc()
 |    at 0x4839A0C: free (vg_replace_malloc.c:540)
 |    by 0x56EBD8C: g_free (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11DED0: remote_viewer_session_connected (remote-viewer.c:658)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566AF68: g_signal_emit_by_name (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x135E5D: virt_viewer_session_spice_main_channel_event (virt-viewer-session-spice.c:699)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x53149E3: emit_main_context (gio-coroutine.c:198)
 |  Address 0x18f1ecc0 is 0 bytes inside a block of size 23 free'd
 |    at 0x4839A0C: free (vg_replace_malloc.c:540)
 |    by 0x56EBD8C: g_free (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11DED0: remote_viewer_session_connected (remote-viewer.c:658)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566AF68: g_signal_emit_by_name (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x135E5D: virt_viewer_session_spice_main_channel_event (virt-viewer-session-spice.c:699)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x53149E3: emit_main_context (gio-coroutine.c:198)
 |  Block was alloc'd at
 |    at 0x483880B: malloc (vg_replace_malloc.c:309)
 |    by 0x56EBC98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x5705C43: g_strdup (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11EB80: remote_viewer_initial_connect (remote-viewer.c:696)
 |    by 0x11EB80: remote_viewer_start (remote-viewer.c:790)
 |    by 0x1250D3: virt_viewer_app_start (virt-viewer-app.c:1727)
 |    by 0x127108: virt_viewer_app_on_application_startup (virt-viewer-app.c:1870)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x5661638: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A972: g_signal_emit (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x553ECA1: g_application_register (in /usr/lib64/libgio-2.0.so.0.6000.6)
 |    by 0x553F41D: g_application_run (in /usr/lib64/libgio-2.0.so.0.6000.6)

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-04 10:02:42 +02:00
Eduardo Lima (Etrunko)
c1998594b1 ovirt-foreign-menu: Plug memory leak
Error caught by valgrind, the OvirtCollection object created in function
ovirt_foreign_menu_fetch_vm_async() was never freed.

433 (40 direct, 393 indirect) bytes in 1 blocks are definitely lost in loss record 16,708 of 17,677
   at 0x5868FDF: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584B42C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584D347: g_object_new_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584D69C: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x558E823: ovirt_collection_new (ovirt-collection.c:304)
   by 0x558E98C: ovirt_sub_collection_new_from_resource_search (ovirt-collection.c:375)
   by 0x42D510: ovirt_foreign_menu_fetch_vm_async (ovirt-foreign-menu.c:994)
   by 0x42D510: ovirt_foreign_menu_next_async_step (ovirt-foreign-menu.c:316)
   by 0x42D70D: api_fetched_cb (ovirt-foreign-menu.c:1025)
   by 0x570BC19: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
   by 0x570C7EC: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
   by 0x559005D: call_async_cb (ovirt-proxy.c:279)
   by 0x55B5A07: ??? (in /usr/lib64/librest-0.7.so.0.0.0)

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-30 11:05:42 -03:00
Eduardo Lima (Etrunko)
22bd91cba0 ovirt-foreign-menu: Factor out code to set file collection
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-26 10:18:52 -03:00
Eduardo Lima (Etrunko)
ff0bfe3494 ovirt-foreign-menu: Only set domain_valid once
In the case of having a valid storage domain without any ISO files, this
variable can be reset to FALSE again in the next iteration of the loop,
resulting in a misleading error message presented to the user.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-21 10:37:47 -03:00
Fabiano Fidêncio
b79bb39420 ovirt-foreign-menu: Fix warnings on Rawhide
gmaovirt-foreign-menu.c: In function 'storage_domains_fetched_cb':
ovirt-foreign-menu.c:721:9: error: format not a string literal and no format arguments [-Werror=format-security]
  721 |         g_debug(msg);
      |         ^~~~~~~
ovirt-foreign-menu.c:722:9: error: format not a string literal and no format arguments [-Werror=format-security]
  722 |         g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED, msg);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
gmake[3]: *** [Makefile:963: libvirt_viewer_la-ovirt-foreign-menu.lo] Error 1
gmake[2]: *** [Makefile:647: all] Error 2
gmake[1]: *** [Makefile:482: all-recursive] Error 1
make: *** [Makefile:410: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.f14Lmj (%build)

Errors have been caught by https://ci.centos.org/job/virt-viewer-rpm/systems=libvirt-fedora-rawhide/589/

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-08-15 22:26:26 +02:00
Eduardo Lima (Etrunko)
1c9a9c1205 ovirt-foreign-menu: Fix endpoint for storage domains query
Instead of fetching toplevel REST API query, we use the one relative
from the data center, which returns more detailed information,
especially the status of the storage domain.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1427467

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-12 10:55:54 -03:00
Kevin Pouget
a2a372ac2d virt-viewer-file-transfer-dialog: improve error message
This patch improves the error shown to the user when a file transfer
fails.

The previous behavior was to create a simple message dialog box, with
the error description and the full list of the files that failed to be
transferred. When the list of files was long, the dialog box would
grow bigger than the screen.

Now, the file list is inserted inside a scrollable widget, whose
height is limited to 170px.

NB: these two calls would be more adapted, but they require GTK >=
3.22:

> gtk_scrolled_window_set_max_content_height(GTK_SCROLLED_WINDOW(scrolled_window), 170);
> gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrolled_window), TRUE);

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1496356

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-08 15:54:46 +02:00
Michal Privoznik
898f972d53 Introduce bash completion
With this change one can get list of domains on the command line:

  $ virt-viewer -c qemu:///system <TAB><TAB>
  dom1   dom2   ... domN

The list of domains is fetched using virsh, hence the dependency
on libvirt-client recorded in the spec file. I think it's fair
to assume that Linux hosts with virt-viewer will have virsh
available too. If they don't, nothing breaks and no error message
is printed.

The completer script is inspired by libvirt.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2019-06-19 13:42:12 +02:00
Eduardo Lima (Etrunko)
a98fcdf7e7 configure: Fix check for govirt functions
Use saved CFLAGS and LIBS to avoid errors in the check programs.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-31 12:40:36 -03:00
Pavel Moseev
3627da2432 virt-viewer add translatable string
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-05-28 11:08:02 -03:00
Jonathon Jongsma
c2dabf0730 Fix a regression when initial connection fails
Due to changes in commit 65ef66e4, when the initial connection fails,
virt-viewer just sat quietly and didn't indicate what was wrong. It also
did not exit as it did before.  This is because we were using
virt_viewer_session_spice_channel_destroy() incorrectly. This function
was intended to be a callback that is called to clean up the VV session
when the SpiceSession tells us that a channel has been destroyed. It
does not actually destroy the channel, it only cleans up references to
that channel within virt-viewer. After calling this function, the
channel is not affected in any way. If the channel object was valid
before calling the function, it will be valid and unchanged after
calling the function as well.

The problem is that before commit 65ef66e4, this function
(_channel_destroy()) also had a side-effect of emitting a signal that
made us think that the SpiceSession was disconnected when it was not.
The application responded to this signal by exiting even though the
session was not properly disconnected and cleaned up.

We now no longer exit the application until the SpiceSession is properly
disconnected and cleaned up. So we need to make sure that this happens
when our initial connection fails. Therefore, when the main channel
receives an error channel-event, we should not call
virt_viewer_session_spice_channel_destroy(). This function should only
be called when a channel has actually been destroyed, and the channel is
not destroyed at this point.  We should instead explicitly disconnect
the session, which will result in the channels being destroyed properly.
After the session destroys all of the channels, the 'channel-destroy' signal
will be emitted by SpiceSession, so the _channel_destroy() function will
eventually get called by the signal handler.

To make the proper use of the function more obvious, I also changed the
function name from _channel_destroy() to _channel_destroyed() and added
a comment.

Fixes: rhbz#1666869
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-04-16 15:19:51 -05:00
Christophe Fergeau
da336ab4b3 Mark PrintScreen as translatable
It's for example ImprÉcran on French keyboards.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1510411
Fabiano Fidêncio <fidencio@redhat.com>
2019-03-15 14:38:53 +00:00
Daniel P. Berrangé
22589691d1 po: refresh translations from zanata
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:48 +00:00
Daniel P. Berrangé
592cfa9821 po: minimize uk ur vi wba yo zh_CN zh_HK zh_TW zu
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:47 +00:00
Daniel P. Berrangé
c9fe1995e5 po: minimize sq sr@latin sr sv ta te tg th tr tw
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:47 +00:00
Daniel P. Berrangé
af26945352 po: minimize or pa pl pt_BR pt ro ru si sk sl
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:46 +00:00
Daniel P. Berrangé
d7ffa9280f po: minimize mn mr ms nb nds ne nl nn nso
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:46 +00:00
Daniel P. Berrangé
651901fdb2 po: minimize kw_GB kw@kkcor kw kw@uccor ky lt lv mai mk ml
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:45 +00:00
Daniel P. Berrangé
e32e576012 po: minimize id ilo is it ja ka kk km kn ko
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:44 +00:00
Daniel P. Berrangé
16339f99ce po: minimize fr gl gu he hi hr hu ia
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:44 +00:00
Daniel P. Berrangé
cadb31d389 po: minimize de_CH de el en_GB eo es et eu fa fi
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:43 +00:00
Daniel P. Berrangé
2daefdde22 po: minimize bn_IN bn bo br brx bs ca cs cy da
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:42 +00:00
Daniel P. Berrangé
5b9118f04c po: minimize af am anp ar as ast bal be bg
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:42 +00:00
Daniel P. Berrangé
99f960b944 po: minimize & canonicalize translations stored in git
Similar to the virt-viewer.pot, .po files contain line numbers and file
names identifying where in the source a translatable string comes from.
The source locations in the .po files are thrown away and replaced with
content from the virt-viewer.pot whenever msgmerge is run, so this is not
precious information that needs to be stored in git.

When msgmerge processes a .po file, it will add in any msgids from the
virt-viewer.pot that were not already present. Thus, if a particular msgid
currently has no translation, it can be considered redundant and again
does not need storing in git.

When msgmerge processes a .po file and can't find an exact existing
translation match, it will try todo fuzzy matching instead, marking such
entries with a "# fuzzy" comment to alert the translator to take a
look and either discard, edit or accept the match. Looking at the
existing fuzzy matches in .po files shows that the quality is awful,
with many having a completely different set of printf format specifiers
between the msgid and fuzzy msgstr entry. Fortunately when msgfmt
generates the .gmo, the fuzzy entries are all ignored anyway. The fuzzy
entries could be useful to translators if they were working on the .po
files directly from git, but Virt-Viewer outsourced translation to the
Fedora Zanata system, so keeping fuzzy matches in git is not much help.

Finally, by default msgids are sorted based on source location. Thus, if
a bit of code with translatable text is moved from one file to another,
it may shift around in the .po file, despite the msgid not itself changing.
If the msgids were sorted alphabetically, the .po files would have
stable ordering when code is refactored.

This patch takes advantage of the above observations to canonicalize
and minimize the content stored for .po files in git. Instead of storing
the real .po files, we now store .mini.po files.

The .mini.po files are the same file format as .po files, but have no
source location comments, are sorted alphabetically, and all fuzzy
msgstrs and msgids with no translation are discarded. This cuts the size
of content in the po directory.

Users working from a virt-viewer git checkout who need the full .po files
can run "make update-po", which merges the virt-viewer.pot and .mini.po
file to create a .po file containing all the content previously stored
in git.

Conversely if a full .po file has been modified, for example, by
downloading new content from Zanata, the .mini.po files can be updated
by running "make update-mini-po". The resulting diffs of the .mini.po
file will clearly show the changed translations without any of the noise
that previously obscured content. Being able to see content changes
clearly actually identified a bug in the zanata python client where it
was adding bogus "fuzzy" annotations to many messages:

  https://bugzilla.redhat.com/show_bug.cgi?id=1564497

Users working from virt-viewer releases should not see any difference in
behaviour, since the tarballs only contain the full .po files, not the
.mini.po files.

As an added benefit, generating tarballs with "make dist", will no
longer cause creation of dirty files in git, since it won't touch the
.mini.po files, only the .po files which are no longer kept in git.

The languages are minimized in the following commit since it is a
large mechanical process.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:41 +00:00
Daniel P. Berrangé
1ba5f91001 po: add rules for integration with zanata
Add rules to handle pushing virt-viewer.pot to zanata, and refreshing .po
files with new content from zanata.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:40 +00:00
Daniel P. Berrangé
98503e1a72 po: remove language list from zanata configuration
The <locales> element in zanata.xml is no longer relevant as this info
is recorded server side.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:39 +00:00
Daniel P. Berrangé
8089cddfcb po: provide custom make rules for po file management
Historically we have relied on intltool to install a standard
po/Makefile.in.in which has very limited scope for customization.
intltool is deprecated in favour of standard gettextize tools,
but these share the same disadvantages.

Writing make rules for po file management is no more difficult
than any other rules virt-viewer has, so stop using intltool
and don't use gettextize ether.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:38 +00:00
Daniel P. Berrangé
cebaaa22ff po: fix syntax error in plural forms for lt language
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-12 11:49:19 +00:00
ceb21d7894 remote-viewer: Allow toggling shared clipboard
Signed-off-by: Aleksei Nikiforov <darktemplar@basealt.ru>
Message-Id: <20190304143712.27989-1-darktemplar@basealt.ru>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-03-07 19:52:00 +01:00
Daniel P. Berrangé
226956eac7 Add a git-publish configuration file
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-04 10:43:39 +00:00
Daniel P. Berrangé
8e4683b00b rpm: remove obsolete Group tag purged from Fedora RPMs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-01 17:11:36 +00:00
Daniel P. Berrangé
dffe9f090a Post release verson bump to 9.0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-01 17:10:37 +00:00
Daniel P. Berrangé
30cb0ce8d0 Update NEWS for 8.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-01 16:43:57 +00:00
Daniel P. Berrangé
ecae4e5628 rpm: use the mingw hicolor icon theme not native
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-01 15:33:20 +00:00
Daniel P. Berrangé
8de486853e Add glib2-devel for mingw build
The native glib2-devel package is needed for mingw builds in order to
get the glib-compile-schemas binary.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-01 15:27:28 +00:00
Eduardo Lima (Etrunko)
099d86286b iso-dialog: Move type definitions from header to source file
There is no reason for this object to define a private structure, so it
is fine to make everything private to the dialog itself.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-02-22 09:19:27 -03:00
Eduardo Lima (Etrunko)
ed4768d589 Update usage of GObject private structures
New functions and macros have been added in glib 2.38 to better handle
this case.

c8de2b11bb/NEWS

The old method is being deprecated as of version 2.58.

https://gitlab.gnome.org/GNOME/glib/merge_requests/7/commits

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-02-22 09:19:27 -03:00
Daniel P. Berrangé
7bea22aece msi: record full build environment in MSI installer
For proper compliance with the GPL and other licenses we need to be
clear about exactly what toolchain and dependent packages we used in
order to build the MSI installer we distribute.

Historically we've done this by including a "deps.txt" file which
provides a list of all the mingw{32,64}-* RPMs on the host system.

This is not sufficient information, however, because the build system
will in fact use various native packages too from the toolchain too,
notably including any program run by "configure" which covers various
shell utilities, and pkg-config, and then of course make & msitools
itself.

Rather than try to figure out which subset of host RPMs are used,
just list every single host RPM that is installed.

A key implication of this is that formal release builds should always
be done in a pristine build root populated with the minimal content
required for the build.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:59:18 +00:00
Daniel P. Berrangé
5daeea567c Declare VirtViewerFile variable at start of method
virt_viewer_session_vnc_auth_credential uses gotos which jump over the
declaration of 'file', meaning its contents are uninitialized in the
jump target.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:52:59 +00:00
Daniel P. Berrangé
9e4cc377a5 Fix prototype of function with no arguments
Modern C standard requires the function to be "void"

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:52:59 +00:00
Daniel P. Berrangé
9e16ee09cf Fix signed/unsigned mixup in format args
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:51:29 +00:00
Eduardo Lima (Etrunko)
673e993158 window: Use proper define from glib for ignoring deprecated warning
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-13 11:58:17 -02:00
Daniel P. Berrangé
455c9a2f36 Disable deprecation warnings for gtk_window_fullscreen_on_monitor
We use GLIB_VERSION_MAX_ALLOWED to prevent use of functions from
GTK >= 3.12. When we do conditional compilation based on a GTK
version check, we must thus suppress the warning:

  CC       libvirt_viewer_la-virt-viewer-window.lo
../../src/virt-viewer-window.c: In function 'virt_viewer_window_enter_fullscreen':
../../src/virt-viewer-window.c:608:9: error: 'gtk_window_fullscreen_on_monitor' is deprecated: Not available before 3.18 [-Werror=deprecated-declarations]
         gtk_window_fullscreen_on_monitor(GTK_WINDOW(priv->window),
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtkdialog.h:32,
                 from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from ../../src/virt-viewer-window.c:28:
/usr/include/gtk-3.0/gtk/gtkwindow.h:391:10: note: declared here
 void     gtk_window_fullscreen_on_monitor(GtkWindow *window,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-12 13:56:07 +00:00
Marc-André Lureau
8d451999be build-sys: lower spice-gtk requirement to 0.35 again
Compile out QMP channel support if spice-gtk version < 0.36.

(note: I didn't bother adding configure switch to enable it
explicitly, this could be added later if necessary)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-04 11:42:11 +01:00
Paul Donohue
54b9d05b04 Report gtk_accel_map_change_entry() failures
Signed-off-by: Paul Donohue <virt-tools@PaulSD.com>
Message-Id: <1533340753-24176-2-git-send-email-virt-tools@PaulSD.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-02-01 11:21:33 +01:00
Marc-André Lureau
31cb5592a0 spice: hook into QMP port
If the "org.qemu.monitor.qmp.0" port is available:
- enable the VM UI
- get and follow the VM state
- send the requested VM actions

This requires spice-gtk version 0.36 with SpiceQmpPort helper.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-02-01 11:21:29 +01:00
Marc-André Lureau
951f364dc3 spice: hook into port channel to create VTE terminals
QEMU defines a few Spice port channel names in
docs/spice-port-fqdn.txt that can be interacted with a terminal.

Create VirtViewerDisplayVte display for all known terminal channel,
and redirect read/write signals.

Note that if VTE support is disabled, or if the VTE console isn't
shown, spice-gtk will still process those port channels (discarding
the read if VTE is disabled).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-02-01 11:21:26 +01:00
Marc-André Lureau
ffa9c81a09 session: do not take VTE display into account for geometry changes
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-02-01 11:21:12 +01:00
Jonathon Jongsma
3bc3b15284 Fix regression when showing disconnect error
Commit 65ef66e42 introduced a regression due to lack of type-safety on
signals. We mistakenly passed a GError rather than a string error
message to the signal.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-01-28 11:32:04 -06:00
Eduardo Lima (Etrunko)
b3017371ce Add missing G_MODULE_EXPORT to signal handler
Fixes the Windows case where the dialog fails to show with the following
message:

warning: "Could not find signal handler 'virt_viewer_window_menu_change_cd_activate'"

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-01-18 17:48:46 -02:00
Daniel P. Berrangé
9e2e894673 Add src/virt-viewer-display-vte.c to POTFILES
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-12-21 17:19:09 +00:00
Marc-André Lureau
e7b134c270 app: add "vm-running" property
Add "vm-running" property and modify "menu-vm-pause" check button
state when the running state changes.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 18:16:41 +04:00
Marc-André Lureau
2d8d923fd0 app: add "machine" UI
Add a new "Machine" menu, which allows to Pause/Reset/Power Down a VM.

The menu is only visible if "vm-ui" app property is set.

When the application quits, it will also send a quit action to the VM.

This is a similar behaviour/UI as qemu -display gtk.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 18:16:39 +04:00
Marc-André Lureau
a0a2d99fbd app: create a window for VTE displays
virt_viewer_app_display_added() now handles VTE displays. They should
be skipped for monitor configuration, and they don't emit "show-hint".

(a VTE display has a monitor nth == -1, which is now a valid value)

The associated window will be hidden when virt-viewer is started.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 18:16:03 +04:00
Marc-André Lureau
be5ff83dfc spice: add unix-path in .vv file support
This will allow to connect to a Spice server using a unix socket path,
for example:

[virt-viewer]
type=spice
unix-path=/var/run/user/1000/qemu/test/spice.sock

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
2018-12-21 16:53:35 +04:00
Marc-André Lureau
f06a882b11 display: allow display without associated monitor number
The VTE display will have monitor id -1.

Eventually, having a base "console" class without monitor id could
avoid this allowance.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:37 +04:00
Marc-André Lureau
fd25645c11 app: append VTE consoles to display submenu
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:34 +04:00
Marc-André Lureau
f6448ae6e6 app: set subtitle using VTE name
Currently, subtitle indicate the monitor number, ex: "Fedora (1)".

Custom subtitle use %d to place the monitor number.

Let's make this placeholder more generic to place the name of the
console, ex: "Fedora (Serial)".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:31 +04:00
Marc-André Lureau
ad64d0a3ac session: skip monitor changes if there is no sized monitors
spice-gtk discards configurations without any sized monitors.

Also shuts extra warnings when shifting the monitors.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:29 +04:00
Marc-André Lureau
1ad52ea8e9 display: ignore display that do not have toplevel window
virt_viewer_display_get_preferred_monitor_geometry() may be called
during application initialization (when the VTE console is being
shown, virt_viewer_session_update_displays_geometry() is called when
the visibility menu item is toggled). But the other displays may not
yet be associated with a window, ignore them.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:26 +04:00
Marc-André Lureau
f23548aa33 window/zoom: deal with VTE display differently
VTE display doesn't use the desktop / window aspect ratio, let's just
call directly the functions handling zoom.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:24 +04:00
Marc-André Lureau
c233917495 Add a VirtViewerDisplayVte display kind
This is not a graphical display, so the application will have to deal
with it with care.

You may argue that we need a large refactoring to introduce a more
generic "console" object, that could be either graphical or textual.
For now, this does work well enough for me.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:22 +04:00
Marc-André Lureau
126db5f639 build-sys: check for VTE library
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:19 +04:00
Marc-André Lureau
8cdc91227d window: set sensitivity based on display capability
A following patch is adding a new display (VTE) that won't have the
send_key() or screenshot() callbacks. Activating those menu/actions
would lead to nothing or a crash. I chose to keep the UI consistent
for all display, but disable the menu sensitivity.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:16 +04:00
Marc-André Lureau
ffd1f05c08 window: do not reset sensitivity of menu-send in rebuild
The sensitivy of "menu-send" is getting more complex in the following
patch. Let's have the logic in a single place,
virt_viewer_window_set_menus_sensitive().

rebuild_combo_menu() is called in 2 cases:

1. notify::enable-accel: there is no need to update the sensitivy of
   "menu-send"

2. on construction: default to false since display == NULL. It will be
   later updated when virt_viewer_window_set_menus_sensitive(). The
   default sensitivity is covered by previous .ui patch change.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-21 15:14:12 +04:00
Christophe Fergeau
fe7aad2002 ovirt: Fix initial connection
After commit df42f78d46 "remote-viewer: factor our
remote_viewer_initial_connect()", the initial connection code only gets
run in the !ovirt case. When ovirt is in use, the initial connection
never happens, meaning all we get when using ovirt:// is a blank
virt-viewer window.

This commit fixes that by moving creation of the ovirt session to
remote_viewer_initial_connect, and unconditionnally calling the
remote_viewer_initial_connect rather than only doing it in the !ovirt
case.

https://bugzilla.redhat.com/show_bug.cgi?id=1655537

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-12-06 13:25:15 +01:00
Ben Mathews
564b03e3d6 Set window title to VM name
The attached patch address an issue with virt-view not setting the
titlebar text to be the title of the VM (previously discussed on:
https://www.redhat.com/archives/virt-tools-list/2018-September/msg00064.html).
2018-12-05 17:23:08 +01:00
Jonathon Jongsma
49e219335b Silence coverity warning about dead code
For some reason, coverity was complaining that the definition of
cred_type_to_str was dead code, even though it wasn't. Changing the
storage to static silences the warning. Since that's a benficial change
anyway, let's change it. At the same time, make the pointer constant as
well and move it outside of the loop since it doesn't need to be inside
the loop.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-12-04 11:33:30 -06:00
Jonathon Jongsma
c07cc4f89f Avoid potential memory leak in spice session
If j == -1, the memory allocated for rect will leak. So move the
allocation after the test.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-12-04 11:33:30 -06:00
Andrea Bolognani
ba9c79b55e spec: Drop %{extra_release}
It was mainly meant to be used for automatic builds through
Test::AutoBuild, so it can be removed now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 10:13:25 +01:00
Andrea Bolognani
ffdae4a98d prepare-release: Drop references to Test::AutoBuild
They are misleading, and no longer relevant anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 10:13:25 +01:00
Andrea Bolognani
4a9417b115 maint: Rename autobuild.sh to prepare-release.sh
The script was originally used by the Test::AutoBuild
project to perform periodic automatic builds; however, that
effort has been abandoned a long time ago, and these days
virt-viewer CI builds are happening on the Jenkins-based
CentOS CI environment under the libvirt umbrella[1], where
build recipes are maintained separately from the projects
themselves.

The script is still used to prepare releases, so it can't
be dropped from the repository: rename it so that its
purpose is more clearly communicated instead.

[1] https://ci.centos.org/view/libvirt/

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-13 10:13:25 +01:00
Jonathon Jongsma
2e76dbb65c Relax Gtk+ requirement slightly
We previously bumped the gtk+ requirement to 3.18 for the function
gtk_window_fullscreen_on_monitor(). But this function is only necessary
in Wayland. So add some preprocessor version checks to allow it to
compile on older distributions if they don't care about wayland support.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-11-09 10:50:18 -06:00
Qiu Wenbo
e1186e0c92 win32: fix command line encoding on windows platform
On Windows, the arguments we get in GApplication::ocal_command_line
come from g_win32_get_command_line(), and g_option_context_parse_strv()
documentation says:
« On Windows, the strings are expected to be in UTF-8. This is in
contrast to g_option_context_parse() which expects them to be in the
system codepage, which is how they are passed as argv to main(). See
g_win32_get_command_line() for a solution. »

This was causing issues on Windows when running:
remote-viewer -t "你好" spice://<target-host>:5900
2018-10-16 11:39:12 +02:00
Jonathon Jongsma
71419bfa71 Fullscreen displays on wrong monitors in Wayland
In fullscreen mode, we attempt to enable a guest display for each client
monitor and then place a fullscreen window for each display on the
appropriate monitor. Previously, we were using gtk_window_move() to move
the window to the proper monitor, and then calling
gtk_window_fullscreen() to enter fullscreen mode on that monitor.
However, under wayland, gtk_window_move() no longer has any effect for
toplevel windows, so all displays were showing up on top of eachother on
the same client monitor.

Fortunately, Gtk+ 3.18 added a new gtk_window_fullscreen_on_monitor()
API that works on Wayland. In theory this allows us to remove the call
to gtk_window_move() from the code. But to avoid potentially changing
behavior on xorg or older systems, I left the existing logic.

This requires a dependency bump for gtk+ from 3.12 to 3.18. Gtk 3.18 is
provided by the following distributions (or newer):
 - RHEL 7.4
 - Fedora 23
 - Ubuntu 16.04LTS

Resolves: rhbz#1584561

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-10-15 15:34:29 -05:00
Marc-André Lureau
45eeda66a2 display: make klass->close() optional
Spice and VTE display do not need to implement it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:43 +04:00
Marc-André Lureau
029cd8a031 window: move default sensitivity in .ui
Instead of modifying it in object initialization.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:36 +04:00
Marc-André Lureau
e934026986 window: use virt_viewer_window_set_menus_sensitive()
virt_viewer_window_set_menus_sensitive() is the common function to set
sensitivity on menu items.

It was lacking "toolbar_send_key", so add it there too.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:34 +04:00
Marc-André Lureau
41f889f84d app: simplify toggling visibility
There is a hack to maintain the toggle state to a desired state within
the "toggled" handler.

However it is only necessary for the ask-quit case. In this case, we
want to maintain the item active, which is simpler to handle than the
general case. Simplify the code by folding
virt_viewer_app_window_set_visible() and removing the static
"reentering" hack, only maintaining "active" on the last item.

Note that the hack was needed since there is no way to hook a signal
handler on "clicked" before "toggled" is emitted and handled by Gtk,
to avoid the recursion.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:32 +04:00
Marc-André Lureau
b6d3755452 Remove class signal handlers
We don't use class signal handlers, remove the extra pointers.

g_signal_override_class_handler() could be used instead when needed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:30 +04:00
Marc-André Lureau
c4f6142f15 remote-viewer: add handling of spice+unix and spice+tls schemes
- spice+unix:// was added in spice-gtk v0.28
- spice+tls:// was added in spice-gtk v0.35

This allows launchers to start remote-viewer when they encounter a
Spice URI with +unix or +tls.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-25 22:01:28 +04:00
Jonathon Jongsma
65ef66e42a Spice: listen for new 'SpiceSession::disconnected' signal
Previously we were emitting the VirtViewerSession::session-disconnected
when we got the Spice::session::channel-destroy signal for the last
channel. However, since the channels are still valid at this point, and
because VirtViewerApp quits the application in response to the
session-disconnected signal, that means that the channels were never
being properly freed. This was particularly problematic for the usbredir
channel, which must disconnect any connected USB devices as part of its
destruction. By using the new SpiceSession::disconnected signal instead,
we can ensure that all channels have been disconnected and properly
destroyed before quitting the application.
2018-09-18 11:14:09 -05:00
Eduardo Lima (Etrunko)
9a28f89739 ovirt-foreign-menu: New function storage_domain_validate()
It may be useful to know why the storage domain has not been listed,
given that there are different reasons for that. To make it easier to
provide more detailed debug messages, we move code from the callback
function to this new one.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-09-12 10:55:38 +02:00
Eduardo Lima (Etrunko)
5ba2f8ff1b build: Update govirt and rest requirements
With these new values, 0.3.3 for libgovirt and 0.8 for librest, we can
remove checks for OVIRT_REST_CALL_ERROR_CANCELLED and correspondent
rest_proxy_auth_cancel().

Distros that already ship these versions, such as Fedora, RHEL 7.4
onwards, and Ubuntu since 17.10.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-09-12 10:52:04 +02:00
Victor Toso
7ffb7f9cf4 app: Always add guest name comment
Even when the user adds comments, we should place the guest's name
unless it is present already.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1623756

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-09-03 07:09:21 +02:00
Christophe Fergeau
71dc30571e ovirt: Filter everything which does not end in .iso
oVirt REST API does not provide a way to know what is a valid ISO image
which can be assigned to a running VM. I've seen floppy disk images
(.vfd) in a domain, which is already filtered. Now I've seen an ISO
domain with .qcow2 files in it, which can't be assigned to a VM either.
This commit filters every file which does not have a .iso extension as
it's unlikely to be possible to use it.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-08-31 15:12:18 +02:00
Christophe Fergeau
1b45241a66 ovirt: Improve handling of g_strv_contains()
The ovirt code uses g_strv_contains() with fallback code in
glib-compat.h when we are using a glib version where it's not available.
However, when we use a glib version where g_strv_contains is available,
we get a compilation warning since we are compiling GLIB_VERSION_MAX_ALLOWED
set to 2.38.

This commit wraps both the compat code and the g_strv_contains() call in
a strv_contains() helper where we can hide the magic needed to avoid
deprecation warnings.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-08-07 17:41:37 +02:00
Christophe Fergeau
feea9ccd73 window: Adjust get_image_format() prototype
This adds an unused parameter, but lets us get rid of this new warning
with gcc 8:

virt-viewer-window.c: In function 'get_image_format':
virt-viewer-window.c:930:33: warning: cast between incompatible function types from 'GHashTable * (*)(void)' {aka 'struct _GHashTable * (*)(void)'} to 'void * (*)(void *)' [-Wcast-function-type]
     g_once(&image_formats_once, (GThreadFunc)init_image_formats, NULL);

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-08-07 17:41:37 +02:00
Christophe Fergeau
05c8b75113 app: Remove VirtViewerApp::has-focus
This is no longer needed since 140cb84
'remote-viewer: remove --spice-controller'

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-08-06 13:20:04 +02:00
Daniel P. Berrangé
e8b724a777 rpm: import spec changes from fedora
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-27 17:08:34 +01:00
Daniel P. Berrangé
d5b5e3cf06 Post release version bump to 8.0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-27 15:41:14 +01:00
Daniel P. Berrangé
83a91985d6 Add NEWS for 7.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-27 11:50:19 +01:00
Daniel P. Berrangé
4590b50568 Bump min spice to 0.35 and address deprecation warnings
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-27 11:50:07 +01:00
Daniel P. Berrangé
23c0061ccb Disable -Wcast-function-type warning
Most glib function casts trigger this

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-27 11:50:07 +01:00
Victor Toso
c127a80fc6 remote-viewer-connect: centralize window
Instead of top-left corner.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1508274

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-06-04 11:54:05 +02:00
Christophe Fergeau
afa5b45df8 win32: Look up translations relative to installation directory
On Windows, we can't use bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); as
LOCALE_DIR is a compile-time constant, while the location of the
translations will be dependant on where the user installs virt-viewer.
This results in an untranslated virt-viewer UI on Windows. This commit
calls bindtextdomain() with a directory which is relative to the
installation path so that translation are properly found.
This is similar to what spice-gtk is doing:
https://cgit.freedesktop.org/spice/spice-gtk/tree/src/spice-glib-main.c

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-05-02 13:20:13 +02:00
Daniel P. Berrange
55c4b04243 Refresh po files from zanata
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-12-04 16:39:45 +00:00
Eduardo Lima (Etrunko)
726db14cdb Fixes to spec file
- Use macros for paths instead of absolute paths.
- Remove dangling %{gtk_arg} macro in configure.
- Fix scope of enable_autotools macro to avoid warning during build.
  warning: Macro %enable_autotools defined but not used within scope

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-11-23 11:51:00 -02:00
Eduardo Lima (Etrunko)
24fc358862 doc: Adjust reference to spice-gtk man page for remote-viewer
Similar to last commit, as noticed by reporter in bugzilla:

https://bugzilla.redhat.com/show_bug.cgi?id=1477966

Man page should reference spice-client, not spice-gtk.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-11-22 16:17:27 -02:00
Christophe Fergeau
1b89efaa28 doc: Adjust reference to spice-gtk man page
The man page spice-gtk ships is named "spice-client", not "spice-gtk"

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1477966
2017-11-17 15:14:44 -02:00
Marc-André Lureau
bf39970a1f virt-viewer.spec.in: fix build after spice-xpi-client removal
This fixes commit 140cb84c2538bf0eab7dea2035dfecc4db74c784, where we
removed the spice-xpi-client-remote-viewer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2017-11-17 08:39:14 +01:00
Marc-André Lureau
5d04a426db win32: remove debug-helper.exe
This helper was useful to debug spice controller & activex plugin. Now
that the controller is gone, it is no longer needed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Victor Toso <victortoso@redhat.com>
2017-11-16 17:04:28 +01:00
Marc-André Lureau
140cb84c25 remote-viewer: remove --spice-controller
spice controller interface is being removed from spice-gtk.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Victor Toso <victortoso@redhat.com>
2017-11-16 17:04:05 +01:00
Marc-André Lureau
ce7fd6eb45 remote-viewer: learn '-' as URI for standard input connection file
Some users want the ability to set connection details without writing
to a file or passing command line arguments.

Learn to read the connection file from standard input for such use
case.

This allows a parent process to set the connection details without
intermediary file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Victor Toso <victortoso@redhat.com>
2017-11-16 17:04:02 +01:00
Eduardo Lima (Etrunko)
b983b6bf29 remote-viewer: Pass guri to remote_viewer_session_connected
When connecting to a VM via oVirt instance, the original uri can not be
retrieved using virt_viewer_session_get_uri(). Consequently, it was
never saved, even though the connection succeeds and the actual callback
for "session-connected" signal, which saves the URI, is invoked.

To solve this problem, we always pass a copy of the guri as user-data
parameter for the callback, and if the call to
virt_viewer_session_get_uri() returns NULL, the parameter is used
instead.

Resolves: https://bugzilla.redhat.com/1459792

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-11-14 15:27:07 -02:00
Eduardo Lima (Etrunko)
905d84bd22 foreign-menu: Check if storage domain is active for data center
This last patch of the series is where we actually check if the storage
domain is active in the data center the VM is associated with. It makes
use of g_strv_contains(), which is available only in glib version 2.44.
Compatibility code has been added if building against older versions
than required.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1427467
         https://bugzilla.redhat.com/show_bug.cgi?id=1428401

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-10-06 17:05:58 -03:00
Eduardo Lima (Etrunko)
7459ecb66a ovirt-foreign-menu: Fetch host, cluster and data center information
It is possible that the data center the VM is associated with has more
than one storage domain associated with it as well, when only one is
active while the others are not.

The current ovir-foreign-menu code does not take it into consideration,
thus the ISO dialog may show invalid results with that scenario. We fix
this problem by making use of new functions in libgovirt, adding support
or hosts, clusters and data centers.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1427467
         https://bugzilla.redhat.com/show_bug.cgi?id=1428401

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-10-06 17:05:58 -03:00
Eduardo Lima (Etrunko)
476be6bc58 foreign-menu: Use query for fetching virtual machines
This can save us some bandwidth, as we are searching for the specific
virtual machine instead of retrieving the collection with all VMs, and
then iterating over the results after the transfer finishes.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-10-06 17:05:58 -03:00
Eduardo Lima (Etrunko)
c2b0fd825c configure: check for new functions in libgovirt
These functions will be used in ovirt-foreign-menu code and guarded
by #ifdef blocks so that we can keep compatibility with older libgovirt
versions.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1427467
         https://bugzilla.redhat.com/show_bug.cgi?id=1428401

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-10-06 17:05:58 -03:00
Marc-André Lureau
df42f78d46 remote-viewer: factor our remote_viewer_initial_connect()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-10-06 17:05:58 -03:00
Marc-André Lureau
a437f35e96 session: remove virt_viewer_session_new() declaration
The function was removed in commit
05333f0e93fb988c2fd9302e67671490941aedb0.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-10-06 17:05:58 -03:00
Guido Günther
223836ee67 Make it clear that only running VMs are listed
this might otherwise be confusing.

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873597#25
2017-09-14 10:48:05 -05:00
Daniel P. Berrange
fe2e7cb44f Post release version bump to 7.0
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-15 14:55:16 +01:00
Daniel P. Berrange
678a2d84ed Add NEWS for 6.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-15 12:21:51 +01:00
Daniel P. Berrange
2222f81ac7 Set LC_CTYPE=en_US.UTF-8 when running glib-mkenums
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-14 13:51:58 +01:00
Daniel P. Berrange
c49f648f92 Revert "Don't set LC_ALL=C during build as that breaks python apps"
This reverts commit 921e988db0f09e4a1bac04f56b59a981cb944a78.
2017-08-14 11:37:07 +01:00
Daniel P. Berrange
921e988db0 Don't set LC_ALL=C during build as that breaks python apps
Setting LC_ALL=C breaks python apps doing I/O on UTF-8 source
files. In particular this broke glib-mkenums

    Traceback (most recent call last):
      File "/usr/bin/glib-mkenums", line 669, in <module>
        process_file(fname)
      File "/usr/bin/glib-mkenums", line 406, in process_file
        line = curfile.readline()
      File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 849: ordinal not in range(128)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-07-25 13:45:09 +01:00
Jonathon Jongsma
761149ea71 Screenshot: reject unknown image type filenames
If the image format cannot be determined for a screenshot filename,
simply return an error informing the user that this is not a valid image
format.

In the past, if we couldn't determine the file type, we simply saved it
as a PNG, and appended a ".png" file extension to the filename. This has
several problems. First, it can result in some oddly-named files (e.g. a
screenshot named 'Screenshot.pdf.png').

Second, modifying the filename that is returned from the GtkFileChooser
undermines the overwrite-confirmation functionality that is built into
the gtk file chooser. When the user specifies a filename in the file
chooser dialog, the chooser will automatically check whether a file of
that name exists, and if it does, it will display a dialog asking
whether the user wants to overwrite it. But if we then append a ".png"
extension to the filename and save it, we may be overwriting an existing
file without warning. By returning an error for unrecognized file types,
we avoid this problem.

Resolves: rhbz#1455832
2017-07-20 09:06:46 -05:00
Jonathon Jongsma
f1783c3a3f Report errors when saving screenshot
Currently, the user gets no feedback if the screenshot fails (e.g. if
they don't have permission to write in the chosen directory, etc). This
patch adds a simple dialog showing the error message when a screenshot
fails.
2017-07-19 16:46:12 -05:00
Jonathon Jongsma
a51ae4507d Change default screenshot name to "Screenshot.png"
Since the code attempts to append ".png" to filenames without an
extension, it doesn't make much sense to have the default filename be
extensionless.  Including the extension on the default filename makes
things more straightforward.

Related: rhbz#1455832
2017-07-19 16:45:02 -05:00
Victor Toso
58dd08f222 remote-viewer-connect: Keep the 'dialog' window on top
Otherwise, in kiosk mode, it'll be hidden from user.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459800

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-06-12 15:37:28 +02:00
Eduardo Lima (Etrunko)
0cd836dd17 remote-viewer: Show authentication dialog again if in kiosk mode and connecting to ovirt
Similar to previous commit 5d9e6d2338cbb680fe761b86e6ca433b1234e6e0, now
dealing with the case of connecting directly to ovirt:// URIs, which was
left behind.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459808

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-06-08 18:45:53 -03:00
Victor Toso
fb14a8b300 vnc: do not show error on cancel/close of auth dialog
Mainly a kiosk mode issue, similar to the spice fix in 6480e52f62b.

This patch saves the cancel/close state of auth dialog from
virt_viewer_auth_collect_credentials() in order to avoid an error
dialog to pop up to user in kiosk mode.

This happens due the fact that we call virt_viewer_app_disconnected()
twice:
- One with "session-cancelled" which is correct and well handled;
- The other with "session-disconnected" which is misleading as there
  was no connection at this time. This will trigger the error dialog
  with "Unable to connect to the graphic server %s".

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-06-07 10:06:35 +02:00
Victor Toso
6480e52f62 spice: do not show error on cancel/close of auth dialog
Mainly an issue for kiosk mode due the fact that it'll not quit the
application on cancel. That means that authentication dialog can't
really be canceled and showing an input error such as "wrong password"
is misleading (no password should be taken in consideration on Cancel).

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-06-05 15:46:46 +02:00
Eduardo Lima (Etrunko)
5d9e6d2338 kiosk: Show authentication dialog again if cancelled
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-05-31 10:21:52 -03:00
Eduardo Lima (Etrunko)
8ab98eec20 window: Do not show fullscreen toolbar if in kiosk mode
Regression since commit cc455b7f916110d7cfae6b7af753349e070c9494.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-05-31 10:20:41 -03:00
Victor Toso
75249df557 Make the progress bar smooth during file-transfer
When the transfer of a file finishes we stop considering that file's
size in the progress bar which makes it move back due the new
'transfer size' and 'transferred bytes' - for all the other files.

This patch aims to keep the progress smooth when a file is finished
using the notify::total-bytes from SpiceFileTransferTask to be aware
of all file's sizes.

Note that as we have only one progress bar for all files being
transferred, it is expected that it will go back when a new
file-transfer operation starts (e.g we drag-and-drop new files while
we are already transferring other files).

As requested, this patch also updates the string message to include the
amount of files that will be transferred in case we have more than one
file.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449572
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-18 15:28:55 +02:00
Pavel Grunt
209c80375b virt-viewer: Ensure to not close during migration
Take a look at the shutdown event detail before killing
the connection. Otherwise it breaks the SPICE seamless migration
feature.

Regression since commit a62827d28c6b69e90102e4c1c8043cbddad8929a

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442929
Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
2017-05-18 13:46:01 +02:00
Pavel Grunt
701d57742f window: Allow to control zoom using keypad
Support for more than one key combo for accelerator is available
since GTK 3.12 through GAction. It is currently not possible to
use mnemonics also for numpad keys, for more info see:
 https://bugzilla.gnome.org/show_bug.cgi?id=699823

Resolves: rhbz#1337575

Reviewed-by: Victor Toso <victortoso@redhat.com>
2017-05-10 13:46:29 +02:00
Pavel Grunt
633441631a util: Fix -Wsign-compare
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-04-25 10:40:28 +02:00
Victor Toso
bd16d6a958 Fix implicit fallthrough warning on new gcc
The option -Wimplicit-fallthrough was added to -Wall recently which
generates a few warnings. Based on the comment above the switch, the
fallthrough is on purpose so let's add a comment to avoid the following
warnings.

ovirt-foreign-menu.c: In function 'ovirt_foreign_menu_next_async_step':
ovirt-foreign-menu.c:293:12: warning: this statement may fall through
         if (menu->priv->api == NULL) {
            ^
 ovirt-foreign-menu.c:297:5: note: here
      case STATE_VM:
           ^~~~
ovirt-foreign-menu.c:298:12: warning: this statement may fall through
         if (menu->priv->vm == NULL) {
            ^
ovirt-foreign-menu.c:302:5: note: here
     case STATE_STORAGE_DOMAIN:
          ^~~~
ovirt-foreign-menu.c:303:12: warning: this statement may fall through
         if (menu->priv->files == NULL) {
            ^
ovirt-foreign-menu.c:307:5: note: here
     case STATE_VM_CDROM:
          ^~~~

ovirt-foreign-menu.c:308:12: warning: this statement may fall through
         if (menu->priv->cdrom == NULL) {
            ^
ovirt-foreign-menu.c:312:5: note: here
   case STATE_CDROM_FILE:
        ^~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-04-19 15:32:27 +02:00
Pavel Grunt
fe538a9296 app: Allow to connect to channel using unix socket
Only method for connecting to channel opened later was ssh, however
this method failes when unix socket is used:

    <graphics type='spice'>
      <listen type='socket' socket='/tmp/spice.sock'/>
    </graphics>

Related: rhbz#1335832, rhbz#1411765

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-04-19 11:07:29 +02:00
Pavel Grunt
effa832ca5 virt-viewer: Support newer libvirt xml format
Since libvirt 0.9.4 there is a new listen element which can be used
to specify address instead of using the attributes of graphics element.

Also add support for listen type socket - available for Qemu since
libvirt 2.0.0

Resolves: rhbz#1411765

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-04-19 11:06:58 +02:00
Jonathon Jongsma
95faf12283 tests: improvements to monitor-mapping test
Add some tests that specify different numbers of client monitors to
ensure that the parsing handles those situations correctly.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-04-11 15:20:14 -05:00
Jonathon Jongsma
e1adf25b6a Avoid warning when loading initial monitor mapping
When started in fullscreen mode with a monitor-mapping configuration
option, we are getting the following warnings on the terminal:

    (process:27428): Gdk-CRITICAL **: gdk_screen_get_n_monitors: assertion 'GDK_IS_SCREEN (screen)' failed

    ** (process:27428): WARNING **: Invalid monitor-mapping configuration: monitor #1 for display #1 does not exist

This is apparently because we were processing the fallback monitor
mapping before the graphic server display was opened, so
gdk_screen_get_default() returned NULL. This resulted in
gdk_screen_get_n_monitors() reporting that we had 0 monitors.

This patch moves the fallback monitor mapping parsing from
virt_viewer_app_init() to virt_viewer_app_on_application_startup(),
after chaining up to the base class startup() vfunc. The graphic server
display is opened in the base class vfunc, so by the time that returns,
we should be able to query the number of monitors.

The patch also adds a check in virt_viewer_parse_monitor_mappings() to
ensure that we pass a sane value for nmonitors.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-04-11 15:20:01 -05:00
Pavel Grunt
47c7f4c064 vnc: Set display as enabled on init
Since 9c77a78af2ef85f3fcdce21b42d89566a9f7ee17 the vnc display has
stopped setting the show hint and started to ignore the initial zoom
setting. Let's handle it in a similar way as the spice display and set
the hint when the display is initialized and unset it on disconnect.

Resolves: rhbz#1436991

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-04-04 17:05:47 +02:00
Pavel Grunt
4d08da9672 Remove unused virt_viewer_app_set_zoom_level
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-04-04 13:49:21 +02:00
Pavel Grunt
a2d4766d13 Remove G_VALUE_INIT definition
Available in GLib since the version 2.30 and virt-viewer requires
glib 2.38

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-04 13:47:46 +02:00
Pavel Grunt
66b2cbb8a4 virt-viewer: Fix comparison in domain selection
Related: rhbz#1399077

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-03-16 14:21:58 +01:00
Pavel Grunt
11d8676ba4 virt-viewer: Adjust name-id-uuid comment
virt-viewer by default chooses the VM by its id, then uuid
and then by name. Adjust the comment to match the implementation.

Related: rhbz#1399077
2017-03-09 12:59:10 +01:00
Pavel Grunt
61292f3063 virt-viewer: Allow more precise VM selection
Theoretically a VM name can be a valid VM id or uuid. In that case
connecting to the VMs may be problematic since virt-viewer selects
the VM by its id then by uuid if not found then by its name.

Introduce new command line options to cover this situation:
 "--id" to connect to the VM by its id
 "--uuid" to connect to the VM by its uuid
 "--domain-name" to connect to the VM by its name
The options are mutually exclusive

Resolves: rhbz#1399077
2017-03-09 12:59:03 +01:00
Victor Toso
4fc66ec46c Don't define function without oVirt integration
Function is not used without oVirt.

> virt-viewer-window.c:1063:1: warning: 'iso_dialog_response' defined
> but not used [-Wunused-function]

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:06:32 +01:00
Victor Toso
87c63b9f3e Avoid harmless warnings due lack of oVirt on build
> remote-viewer.c: In function 'remote_viewer_get_property':
> remote-viewer.c:227:26: warning: unused variable 'priv' [-Wunused-variable]
>      RemoteViewerPrivate *priv = self->priv;
>                           ^~~~
> remote-viewer.c:224:36: warning: unused parameter 'value' [-Wunused-parameter]
>      GValue *value, GParamSpec *pspec)
>              ^~~~~
> virt-viewer-window.c: In function 'virt_viewer_window_menu_change_cd_activate':
> virt-viewer-window.c:1077:62: warning: unused parameter 'self' [-Wunused-parameter]
>      VirtViewerWindow *self)
>                        ^~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:05:15 +01:00
Victor Toso
2ed3e393b8 Fix build when building without oVirt
As remote_viewer_iso_list_dialog_new() is defined on
remote-viewer-iso-list-dialog.h which is only build with oVirt
integration.

 > undefined reference to `remote_viewer_iso_list_dialog_new'

Note that the callback virt_viewer_window_menu_change_cd_activate() is
only visible if oVirt is built in.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:03:52 +01:00
Pavel Grunt
5af0a37b6b file-transfer: Fix label of the dialog
Display correct text and make it translatable

Resolves:
https://bugs.freedesktop.org/show_bug.cgi?id=99980

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-03 09:37:38 +01:00
Christophe Fergeau
8d64be24fe spice: Remove unneeded braces
Two statements in virt_viewer_session_spice_main_channel_event() are
wrapped in a { } block, but this is unneeded.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-17 13:36:19 +01:00
Christophe Fergeau
cb2be722cf man: Fix qemu+ssh URL in example
The 'system' path was missing: qemu+ssh://example.org/system

Resolves: rhbz#1377283
2017-02-17 13:31:52 +01:00
Christophe de Dinechin
a4509770d1 Show errors generated by connection dialog
When running 'remote-viewer' without arguments,
and selecting a non-supported protocol, e.g. ssh://foo,
the generated error was silently swallowed by the retry loop.
This was introduced in 06b2c382468876a19600374bd59475e66d488af8.

Signed-off-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-02-14 12:25:27 -02:00
Eduardo Lima (Etrunko)
f207dda59f session-spice: Pass hostname to authentication dialog
With this patch the dialog now shows the host we are connecting to.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-09 17:27:11 -02:00
Eduardo Lima (Etrunko)
88a70174fd iso-dialog: Avoid crash when closing dialog early
We must take into account that users can close the dialog at anytime,
even during an operation of fetch or set ISO has not been finished. This
will cause the callbacks for those operations to be invoked with an
invalid object, crashing the application.

To fix this issue we need to pass a GCancellable to the asynchronous
operations, so they can be cancelled if the dialog happens to get closed
before they complete.

NOTE: This patch triggers a deadlock in libgovirt when the dialog is
closed before the operation completes. Bug reported in
https://bugzilla.gnome.org/show_bug.cgi?id=777808. We will need to bump
libgovirt dependency whenever it has a new release.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-09 17:27:11 -02:00
Pavel Grunt
b7f8644429 Do not print password in the debug log
Do not show a length since it is sensitive info as well.

Resolves: rhbz#1410030

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-07 17:29:59 +01:00
Pavel Grunt
a37f952109 iso-dialog: Do not use string directly
Fixes -Werror=format-security used when creating the rpm

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-07 17:00:45 +01:00
Pavel Grunt
7bc259d193 Update for README.md
It is needed to use the 'foreign' init option otherwise autotools
requires README

Fix make distcheck and spec file generation

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-07 16:58:17 +01:00
Pavel Grunt
7f40049780 README: switch to Markdown syntax
To render nicely on the project git page:
 https://pagure.io/virt-viewer

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-27 15:50:47 +01:00
Pavel Grunt
c08f51f5a4 README: Update links
Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-27 15:50:26 +01:00
Eduardo Lima (Etrunko)
6963650581 Run ISO dialog when 'Change CD' menu is activated
Also moves 'Change CD' menu item from the toplevel menu to a subitem
under 'File' toplevel menu.

In order to avoid object interdependency, it is necessary to make the
ovirt foreign-menu pointer from RemoteViewer, accessible via property,
so it can be passed to the dialog as an opaque GObject.

Finally, with this commit, we clean up ovirt foreign menu code, which
only deals with data, leaving the UI bits to be handled properly in the
new ISO list dialog.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-24 09:51:35 -02:00
Eduardo Lima (Etrunko)
dcbb6929d0 Introduce ISO List dialog
The motivation for this dialog started with rhbz #1310624, where it was
reported that foreign menu was causing too many debug messages to be
printed to the console, because remote viewer had a timeout of 5 seconds
to refresh the ISO list automatically.

As a workaround, the timeout was adjusted for 5 minutes, but it could
cause more problems, such as inconsistencies between what was shown by
remote viewer and what the server had configured.

Another issue caused by displaying the ISO files as a menu item was that
if the list was too long, it would take all the available space on the
screen. In the end, a menu item was not the correct choice of UI
component for this use case.

In order to solve both problems, we now present the ISO list as a
dedicated dialog, where the refresh of ISO list is triggered manually by
the user and the list is contained within the dialog, by displaying de
files in a treeview.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-24 09:48:56 -02:00
Eduardo Lima (Etrunko)
2102e05915 ovirt-foreign-menu: Add accessors for current iso and iso list
Also, to keep consistency around the codebase, changed the return value
of ovirt_foreign_menu_get_current_iso_name() from char * to gchar *.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-19 13:27:34 -02:00
Eduardo Lima (Etrunko)
5f50c1420f ovirt-foreign-menu: Fetch ISO names using GTask API
Similar to the previous commit, the ISO dialog will fetch the result
asynchronously, rather than relying on the "notify::files" signal from
OvirtForeignMenu object. It also enables error to be shown if anything
goes wrong.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-18 17:07:14 -02:00
Eduardo Lima (Etrunko)
c39dcbb045 ovirt-foreign-menu: Set new ISO name using GTask API
This is done with the new ovirt_foreign_menu_set_current_iso_name_async
function.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-18 16:55:43 -02:00
Eduardo Lima (Etrunko)
3dd077b060 remote-viewer: Extend #ifdef HAVE_OVIRT block
The #endif is closing a #ifdef HAVE_OVIRT block, while another one is
opened right next, so there is no need to have those lines. Also, due to
the large amount of source code in between, add a small comment on the
last #endif to identify what it refers to.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-13 18:07:49 -02:00
Snir Sheriber
d7ef44d44f app: Update warning msg in virt-viewer's window
Information about connection issues during display
activation will appear in virt-viewer's window

Related: rhbz#1386630
2017-01-10 11:23:55 +01:00
Pavel Grunt
965286d699 Set guest name at the same time as uuid
Avoid showing the "Unknown" name in the guest detail dialog when
waiting for the domain to be started.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-01-05 17:31:05 +01:00
Snir Sheriber
3dba5a1485 spice: Replace g_warning with g_debug
Instead of having a warning message telling the user that they can't
have more displays enabled in fullscreen than the number of physical
displays, let's just have it as a debug message.

Related: rhbz#1368390

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-02 11:41:20 +01:00
Snir Sheriber
d08df78030 spice: Fix display id in the warning log
The display id in the warning log is now consistent with the display
id in the "view->displays->display x" menu item

Related: rhbz#1368390

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2016-12-30 01:09:43 +01:00
Christophe Fergeau
276012ea37 man: Mention that ssh-agent can be useful
When using a tunneled SPICE connection, the user will get a dozen
authentication prompts if they are not using ssh-agent.

https://bugzilla.redhat.com/show_bug.cgi?id=1377283
2016-12-05 10:59:24 +01:00
Daniel P. Berrange
679043cfa4 Post release version bump to 6.0
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 16:23:53 +00:00
Daniel P. Berrange
8e82f5bc0a Add NEWS for 5.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 14:04:39 +00:00
Daniel P. Berrange
8f32f19690 Refresh PO files from zanata
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 14:04:39 +00:00
Jonathon Jongsma
dfeaac75b9 Make new file-transfer ui file translatable 2016-11-02 11:36:00 -05:00
Jonathon Jongsma
61d4a95a91 Add necessary header include
Fixes the build broken by the last patch series.
2016-11-02 11:03:45 -05:00
Jonathon Jongsma
657dbfbfed Show failed file transfers
After all ongoing file transfers are finished, save a list of the file
transfer tasks that had errors and display the list of failed files to
the user so that they know that a failure occurred and can potentially
retry the transfer. Previously, we just failed silently so the user
may not have even been aware that the transfer failed.
2016-11-02 09:59:22 -05:00
Jonathon Jongsma
37459d0488 Simplify file transfer dialog UI
When transferring a large number of files, the file transfer dialog was
unusable because the window size would be larger than the client
desktop. To solve this, remove the list of individual files (and the
ability to cancel each file transfer independantly) and only display
a single overall progress bar that shows the status of all ongoing
transfers.

This also allows us to remove the delayed unref of the task since we
don't need to show the task information about each individual transfer
task until the window is closed. Removes TaskFinishedData type.

This patch requires new API from spice-gtk to calculate the overall
progress:
 spice_file_transfer_task_get_total_bytes()
 spice_file_transfer_task_get_transferred_bytes()
2016-11-02 09:59:22 -05:00
Pavel Grunt
a744f9a5ce app: Inform user about connection failure
Use errno to get the reason of the failure

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1377100
2016-10-05 14:58:43 +02:00
Pavel Grunt
e73947776d build-sys: Check spice-glib version
virt-viewer uses spice-glib api, configure should check
for the required version

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1375429

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-10-05 14:57:55 +02:00
Daniel P. Berrange
8b91f52715 spec: don't distribute both .spec files in dist
rpmbuild -ta only works if the tar.gz contains a single
spec file, so remove the mingw-virt-viewer.spec from
dist.

We should however be including both the spec.in files.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-08-10 15:17:07 +01:00
Victor Toso
813c775cc9 Fix filename leak on transfer dialog
spice_file_transfer_task_get_filename() was wrongly annotated as
transfer none. We can safely free this string after usage.
2016-08-05 10:59:23 +02:00
Eduardo Lima (Etrunko)
dbc8105155 ovirt-foreign-menu: Use g_clear_pointer/g_clear_object
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-07-29 17:53:34 -03:00
Eduardo Lima (Etrunko)
f7b15be770 ovirt-foreign-menu: Rework states logic
Use switch/case instead of lots of conditional blocks

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-07-29 17:53:34 -03:00
Jonathon Jongsma
2d2d7ac2f7 Fix resizing problem with recent gtk versions
When using client-side decorations, as well as in certain other
situations (wayland, and windows in some cases), the window gradually
resizes larger and larger.

This is caused by a change in how gtk interprets the sizes passed to
gtk_window_resize(), particularly when client-side decorations (CSD) are
involved. For example, In the past this size was assumed to include the
size of the CSD, but now it it assumes that the sizes only represent the
size of the window's content, without any decorations. However,
gtk_widget_get_preferred_size() (when called on a GtkWindow*), returns a
size that includes the size of the CSD. So
virt_viewer_window_queue_resize() was essentially growing the window by
the size of the CSD every time it was called.

To work around this issue, we need to calculate the preferred size of
the window's child, not the size of the entire window (including CSD).
Then we add the width of the window's border (just to be safe) and pass
those values to gtk_window_resize().
2016-07-28 11:14:36 -05:00
Daniel P. Berrange
a62827d28c virt-viewer: ensure we close when seeing domain stop event
Normally virt-viewer relies on the VNC/SPICE widget seeing
an EOF on its underlying connection to detect when the
session is closed.

When tunnelling to a remote guest over SSH though, this
EOF can be delayed for a very long time, leaving a dead
session open.

This can be seen with

   virt-viewer -c qemu+ssh://remotehost/system guestname

when on the remote shell run

   virsh destroy guestname

and notice that virt-viewer does not see the shutdown
immediately.

When we get a domain stopped event we know the session
should be dead, so forceably close it, if not already
closed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-12 13:54:15 +01:00
Daniel P. Berrange
35e489d519 virt-viewer: fix display of guest name in title for vnc
The following commit broke the display of the guest name in
the title for VNC displays:

  commit 61a1bc4dcbb056755fe96c5945f84c1312041059
  Author: Pavel Grunt <pgrunt@redhat.com>
  Date:   Wed Apr 15 13:50:35 2015 +0200

    session-vnc: Set window for display to avoid gtk-vnc v0.3.8 crash

    The VNC display widget of gtk-vnc v0.3.8 needs a window at the moment

The problem is that this causes the window to be associated
with the display before the guest name is available. Thus
when ensure_window_for_display() runs, the window is already
configured and so it never invokes the logic to set the title.

The fix is to unconditionally update the title in the
ensure_window_for_display() method, even if the window already
exists.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-12 10:46:06 +01:00
Fabiano Fidêncio
0bba2d07af app,vnc: Don't retry to authenticate when vvfile authentication fails
When connecting to a RHEVM/oVirt machine through an expired vvfile the
user ends up in an endless loop of getting an error message, pressing
"Okay", re-scheduling a new connection retry. getting an error message
due to the expired vvfile and so on.

In order to avoid the issue, let's not re-schedule the connection retry
when the user tries to connect through a vvfile and it fails.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-07-07 17:11:13 +02:00
Daniel P. Berrange
e204c25799 Post-release version bump to 5.0 2016-06-30 15:18:42 +01:00
Daniel P. Berrange
3b036c061e Update NEWS for 4.0 release 2016-06-30 13:54:00 +01:00
Daniel P. Berrange
48de38bd97 Refresh translations from zanata 2016-06-30 13:53:29 +01:00
Eduardo Lima (Etrunko)
49f4b829ff Adjust timer to refresh ovirt foreign menu
This is a temporary solution, as discussed in the bug. We will adjust
the timer to refresh the ISO list from 15 seconds to 5 minutes (300
seconds), while reworking in the UI to replace the menu with a dialog,
which seems a saner way to display the list.

Resolves: rhbz#1347726

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-30 09:01:01 -03:00
Fabiano Fidêncio
271d33e7d8 ui: Use mnemonics for remote-viewer connection UI
Here we added mnemonics for the buttons "Cancel" and "Connect" and also
for the "Connection Address" entry (as it was before moving this dialog
to a .ui file).

The "Recent connections" widget is left behind as GtkRecentChooserWidget
isn't suitable for mnemonic activation.

Resolves: rhbz#1351487

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-30 13:48:43 +02:00
Fabiano Fidêncio
3775e095a5 timed-revealer: listen to the "grab-notify" signal
The "grab-notify" signal lets us know when our widget becomes
shadowed by a Gtk+ grab on another widget, or when it becomes unshadowed
due to a grab being removed.

That's exactly the case we face when dealing with "usb-redirection" and
"close" items of the fullscreen toolbar. And, currently, when these
widgets get closed the timed-revealer stays there forever. From now on
let's take advantage of the "grab-notify" signal and schedule a timeout
for the revealer when these widgets' windows get closed.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-30 11:51:06 +02:00
Eduardo Lima (Etrunko)
8a32e0bfee Get rid of deprecated functions to customize widget colors
Since commit cc455b7f916110d7cfae6b7af753349e070c9494, the background
color has not been set correctly for Gtk+ 3.18 (Fedora 23), while it was
working fine for more recent version 3.20 (Fedora 24). Tracked down to
some changes in GtkNotebook code which can not be easily backported.

Instead of customizing background and foreground colors, let's just
stick with the default colors provided by theme.

Related https://bugs.freedesktop.org/show_bug.cgi?id=94276

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-29 10:30:46 -03:00
Lukáš Venhoda
f212c5a358 package: Add appdata metadata for Gnome Software
Adds metadata to be used with Gnome Software.
Includes name, summary, description and a few screenshots of remote-viewer.

Signed-off-by: Lukáš Venhoda <lvenhoda@redhat.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-29 02:01:42 +02:00
Christophe Fergeau
937693a73a window: Don't take a reference on 'toolbar'
VirtViewerTimedRevealer now derives from GtkEventBox/GtkContainer, so
it follows GTK+ conventions and takes ownership of the floating ref on
'toolbar'. Since VirtViewerWindow and VirtViewerTimedRevealer will have
the same lifespan, we don't need to own a reference on toolbar in
VirtViewerWindow.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-29 02:00:09 +02:00
Fabiano Fidêncio
612f4ffd2f timed-revealer: Inherit from GtkEventBox
As suggested by Christophe, inheriting from GtkEventBox instead of
having one instance of it as a member can help us to get rid of
virt_viewer_timed_revealer_get_overlay_widget().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-06-29 01:59:45 +02:00
Christophe Fergeau
67667cafd7 timed-revealer: Don't release reference we don't own
VirtViewerTimedRevealer::evBox is created in
virt_viewer_timed_revealer_new() and will be passed to
gtk_container_add() through gtk_overlay_add_overlay(overlay,
virt_viewer_timed_revealer_get_overlay_widget(priv->revealer))

This means VirtViewerTimedRevealer does not own a reference on evBox,
and that it should not try to release it in
VirtViewerTimedRevealer::dispose()

Backtrace for the crash:
 #0  0x00007ffff3e92c9d in g_type_check_instance_is_fundamentally_a () at /lib64/libgobject-2.0.so.0
 #1  0x00007ffff3e722a5 in g_object_unref () at /lib64/libgobject-2.0.so.0
 #2  0x000000000041ebe3 in virt_viewer_timed_revealer_dispose (object=0x1127320) at virt-viewer-timed-revealer.c:128
 #3  0x00007ffff3e723b6 in g_object_unref () at  /lib64/libgobject-2.0.so.0
 #4  0x000000000041c040 in virt_viewer_window_dispose  (object=0x981f70) at virt-viewer-window.c:191
 #5  0x00007ffff3e723b6 in g_object_unref () at  /lib64/libgobject-2.0.so.0
 #6  0x0000000000413a58 in virt_viewer_app_display_removed (nth=<optimized out>, self=0x680330) at virt-viewer-app.c:989
 #7  0x0000000000413a58 in virt_viewer_app_display_removed (session=<optimized out>, display=<optimized out>, self=0x680330) at virt-viewer-app.c:1000
 #8  0x00007ffff3e705e0 in g_cclosure_marshal_VOID__OBJECTv () at /lib64/libgobject-2.0.so.0  #9  0x00007ffff3e6d784 in _g_closure_invoke_va () at  /lib64/libgobject-2.0.so.0
 #10 0x00007ffff3e88cd9 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 #11 0x00007ffff3e897eb in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 #12 0x0000000000418973 in virt_viewer_session_remove_display (session=0x9c6de0, display=0x961a90) at virt-viewer-session.c:463
 #13 0x0000000000420934 in destroy_display (data=<optimized out>) at virt-viewer-session-spice.c:851
 #14 0x00007ffff3b6d0eb in g_ptr_array_foreach () at /lib64/libglib-2.0.so.0
 #15 0x00007ffff3b6d180 in ptr_array_free () at /lib64/libglib-2.0.so.0
 #16 0x000000000042072a in virt_viewer_session_spice_clear_displays (self=0x9c6de0) at virt-viewer-session-spice.c:94
 #17 0x000000000042240d in virt_viewer_session_spice_close (session=<optimized out>) at virt-viewer-session-spice.c:459
 #18 0x0000000000414be5 in virt_viewer_app_quit (self=self@entry=0x680330) at virt-viewer-app.c:285
 #19 0x0000000000415500 in virt_viewer_app_maybe_quit (self=0x680330, window=window@entry=0x981a90) at virt-viewer-app.c:481
 #20 0x000000000041c4ad in virt_viewer_window_delete (src=<optimized out>, dummy=<optimized out>, self=0x981a90) at virt-viewer-window.c:771
 #21 0x00007ffff61807f1 in _gtk_marshal_BOOLEAN__BOXEDv () at /lib64/libgtk-3.so.0
 #22 0x00007ffff3e6d784 in _g_closure_invoke_va () at /lib64/libgobject-2.0.so.0
 #23 0x00007ffff3e887b3 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 #24 0x00007ffff3e8933f in g_signal_emit () at /lib64/libgobject-2.0.so.0
 #25 0x00007ffff62dde6c in gtk_widget_event_internal () at /lib64/libgtk-3.so.0
 #26 0x00007ffff617f5ef in gtk_main_do_event () at /lib64/libgtk-3.so.0
 #27 0x00007ffff5c7dd25 in _gdk_event_emit () at /lib64/libgdk-3.so.0
 #28 0x00007ffff5cae672 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
 #29 0x00007ffff3b9895a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 #30 0x00007ffff3b98d10 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
 #31 0x00007ffff3b98dbc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
 #32 0x00007ffff41643cd in g_application_run () at /lib64/libgio-2.0.so.0
 #33 0x000000000040fc1a in main (argc=3, argv=0x7fffffffdec8) at virt-viewer-main.c:41

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-29 01:54:27 +02:00
Christophe Fergeau
68c7073a25 timed-revealer: Fix "revealer" refcounting
virt_viewer_timed_revealer_new calls gtk_container_add on the instance
returned by gtk_revealer_new so VirtViewerTimedRevealer does not own any
ref on this GtkRevealer instance. Unrefing it in _dispose() is thus wrong.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-29 01:53:46 +02:00
Eduardo Lima (Etrunko)
9413c580ef Use more accurate debug messages for foreign menu
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-24 11:36:37 -03:00
Eduardo Lima (Etrunko)
1b3e49ff22 Get ovirt foreign menu item from UI file
Currently the menu item is created manually, while this patch changes it to be
retrieved from the UI file, and decides if it needs to be shown or hidden if the
ISO list is received from ovirt.

This a preparation for a upcoming UI change that will present the ISO list in a
separate dialog, instead of a submenu.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-24 11:35:55 -03:00
Fabiano Fidêncio
cc455b7f91 window: Replace autoDrawer with native Gtk widgets
GtkRevealer was intrudced in Gtk+ 3.10 and, combined with Gtk Overlay
(intoduced in Gtk+ 3.2), can provide a more sustainably implementation
of the AutoDrawer functionality.

This approach is completely based on the approach taken by virt-manager:
dc05600324

Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=94495

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-23 17:35:17 +02:00
Fabiano Fidêncio
3ab81d7617 mingw,spec: Bump msitools version
Fedora 24 has GLib 2.48.0, which brings a new dependency: PCRE.
The new dependency is already added to the wxi file (in msitools) and a
new msitools build including the fix is already done [0].

Let's just bump the version in our spec file and make sure we will be
using the msitools which includes the fix.

[0]: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a7a2db6109

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-23 17:33:58 +02:00
Pavel Grunt
311ea0fd20 Fix missing field initializers
Spotted by clang
2016-06-22 11:21:13 +02:00
Pavel Grunt
f57cfee07f window: Use loop instead of multiple ifs
Binds modifier's mask and key, also fixes a compile time warning
spotted by clang:
 warning: cast from 'gchar *' (aka 'char *') to 'guint *' (aka 'unsigned
  int *') increases required alignment from 1 to 4 [-Wcast-align]
 return (guint*)g_array_free(a, FALSE);
2016-06-22 11:21:13 +02:00
Pavel Grunt
7b5e8ddc3f window: Move definition from header 2016-06-22 11:21:13 +02:00
Pavel Grunt
dac040ef70 window: Use a predefined macro instead of constant 2016-06-22 11:21:13 +02:00
Fabiano Fidêncio
cf26929900 util: Fix resource path
Since commit 1f6f1a48 the resource path for icons has been broken.
The reason is that when moving the .ui files to $(srcdir)/resources/ui
the define used for the resources was changed to reflect the new
directory. However, this change wasn't needed by the icons and ended
up with virt-viewer not displaying a few icons.

Let's fix the issue by setting back the define to the previous one and
then tweaking the virt_viewer_util_load_ui() to add "ui" to the resource
path, for loading the ui files.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-21 22:54:12 +02:00
Fabiano Fidêncio
1f6f1a48e5 ui: Move ui files to $(srcdir)/resources/ui
I'd like to keep our resources all in the same place. In the future we
will be able to have:
$(srcdir)
 |_ resources
    |_ ui: for our {remote,virt}-viewer ui specific files
    |_ gtk: for files that can be automatically handled by Gtk (like
    |       app-menu).
    |_ css: for custom themes (like:
            https://bugs.freedesktop.org/show_bug.cgi?id=94276)

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-20 18:24:16 +02:00
Fabiano Fidêncio
1315f0aa3d ui: Rename UI files to .ui (instead of .xml)
When using GtkApplication, Gtk automatically searches for the menus of
the application at "org/example/app/gtk/menus.ui".

Currently we don't have a "menus.ui", but try to see this commit is a
first step in order to use app-menu.

For now, let's standardize that all our UI files will have the ".ui"
extension instead of the ".xml" one.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-20 17:33:53 +02:00
Fabiano Fidêncio
0e98f93b0e remote-viewer: Add missing chain-up to parent's window_added() method
It hasn't bitten us (so hard) so far but would from the moment we add
support to app-menu/headerbar.

By not chaining-up to the parent's method, gtk_window_set_application()
is never called. This causes GApplication object not being able to load
the app-menu, but using the "fallback" which only contains the "Quit"
item.

By chaining-up to the parent's method, g_application_hold() call on
virt-viewer-app.c can be removed, as it is already called by the
parent's window_added() method.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-20 17:33:15 +02:00
Fabiano Fidêncio
3960828150 window: remove unneeded GTK_WIDGET() casts
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-20 17:09:43 +02:00
Fabiano Fidêncio
f6f2964b9b display: use MIN_DISPLAY_{WIDTH, HEIGHT} as the minimum possible value
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-20 17:09:27 +02:00
Fabiano Fidêncio
bc38771b7c display: Only queue a resize on zoom-level changes
By the comment in the code:
"For the gtk2 build, we need to queue a resize even if the zoom level
 hasn't changed.  This is due to the fact that VirtViewerWindow will
 queue a resize event for itself immediately after calling this
 function (in  order to shrink the window to fit the new display size
 if necessary). If we don't queue a resize here, the window will become
 tiny because we will only request 50x50 during the window resize."

And it doesn't happen on gtk3 at all. So, let's just remove the comment
and just quere the resize when zoom-changes actually happen.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-20 17:09:00 +02:00
Pavel Grunt
cb4ec1fc80 monitor-alignment: Do not crash on NULL display
Since commit 01b66ef88bc142d6716b40b1e384e94a2629a99f virt-viewer
does not crash on connection to a guest using an invalid display
configuration (eg. Cirrus & QXL vga). That commit allowed existence
of NULL display, however the code handling monitors alignment does
not expect this and crashes when virt-viewer is shifting/aligning
its windows.

Avoid crashing by returning early on NULL display.

 #0  0x0000000000411d0a in displays_cmp (p1=p1@entry=0xbad940, p2=p2@entry=0xbad944, user_data=user_data@entry=0x8eb180) at virt-viewer-util.c:544
 #1  0x00007ffff3f16ac5 in msort_with_tmp (p=0x7fffffffd670, b=0xbad940, n=2) at gqsort.c:93
 #2  0x00007ffff3f16ded in msort_r (b=b@entry=0xbad940, n=n@entry=2, s=s@entry=4, cmp=cmp@entry=0x411ce0 <displays_cmp>, arg=arg@entry=0x8eb180) at gqsort.c:278
 #3  0x00007ffff3f16e78 in g_qsort_with_data (pbase=pbase@entry=0xbad940, total_elems=total_elems@entry=2, size=size@entry=4, compare_func=compare_func@entry=0x411ce0 <displays_cmp>, user_data=user_data@entry=0x8eb180) at gqsort.c:303
 #4  0x000000000041277c in virt_viewer_align_monitors_linear (displays=displays@entry=0x8eb180 = {...}) at virt-viewer-util.c:586
 #5  0x000000000041a92d in virt_viewer_session_on_monitor_geometry_changed (self=0x8f38a0 [VirtViewerSessionSpice], display=<optimized out>) at virt-viewer-session.c:373
 #6  0x00007ffff4415908 in g_closure_invoke (closure=0x9306c0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffd960, invocation_hint=invocation_hint@entry=0x7fffffffd900)  at gclosure.c:801
 #7  0x00007ffff4427a1d in signal_emit_unlocked_R (node=node@entry=0x668f80, detail=detail@entry=1551, instance=instance@entry=0x930440, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd960) at gsignal.c:3627
 #8  0x00007ffff442fab1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffdaf0) at gsignal.c:3383
 #9  0x00007ffff442fd9f in <emit signal notify:agent-connected on instance 0x930440 [SpiceMainChannel]> (instance=instance@entry=0x930440, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
 #10 0x00007ffff4419fd4 in g_object_dispatch_properties_changed (object=0x930440 [SpiceMainChannel], n_pspecs=<optimized out>, pspecs=<optimized out> at gobject.c:1061
 #11 0x00007ffff441c4f9 in g_object_notify (pspec=<optimized out>, object=0x930440 [SpiceMainChannel]) at gobject.c:1155
 #12 0x00007ffff441c4f9 in g_object_notify (object=0x930440 [SpiceMainChannel], property_name=<optimized out>) at gobject.c:1202
 #13 0x00007ffff5a63dd0 in notify_main_context (opaque=0x7fffd6fde990) at gio-coroutine.c:240
 #14 0x00007ffff3f07d7a in g_main_context_dispatch (context=0x68da40) at gmain.c:3152
 #15 0x00007ffff3f07d7a in g_main_context_dispatch (context=context@entry=0x68da40) at gmain.c:3767
 #16 0x00007ffff3f080b8 in g_main_context_iterate (context=0x68da40, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #17 0x00007ffff3f0838a in g_main_loop_run (loop=0x710de0) at gmain.c:4032
 #18 0x00007ffff5f53045 in gtk_main () at gtkmain.c:1207
 #19 0x0000000000411a22 in main (argc=1, argv=0x7fffffffdfa8)

Resolves: rhbz#1250820

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-20 17:08:28 +02:00
Pavel Grunt
99d81d2fde Add tests for monitor alignment
Related: rhbz#1250820

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-20 17:08:22 +02:00
Charles Arnold
b64b58b971 window: Fix segault on zooming operations
When virt-viewer is "Waiting for guest domain to start" and
the Ctrl- or Ctrl+ keys are pressed to zoom the blank display
virt-viewer will crash in virt_viewer_display_get_desktop_size
because of a NULL display pointer. To reproduce start virt-viewer
on a VM not running and zoom the display.

Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-20 17:08:18 +02:00
Frediano Ziglio
18e0fa27e3 Revert "Disable IME to allow receiving all keys"
This reverts commit 191f9a8ab49f56aa48781b5eeaa4a1a65d626627.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1342984.

Calling ImmDisableIME disable IME for the entire program.
On Windows 7 this also hide the keyboard application from the task bar
making impossible to switch keyboard while using remote viewer.
A recent commit in spice-gtk (7d881d2193bf5598b888a48bb4d8d7ad2e62f443,
"widget: Disable IME context on display widget") disable IME processing
just for SpiceDisplay. This avoid the above regression on Windows 7.

Not having this spice-gtk commit is not going to cause a huge
regression, so it's fine not to add strong coupling between this
commit and the spice-gtk commit which fixes this differently.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-06-16 17:34:05 +02:00
Michal Privoznik
9f3029291d tests: Fix VPATH build
So test-hotkeys include virt-viewer-app.h which includes
virt-viewer-window.h which includes virt-viewer-display.h which
in turn wants to include virt-viewer-enums.h. But, the enums
header file is generated at build time into builddir not srcdir.
Therefore it may happen if the two are distinct that compiler
fails to find the enums file:

In file included from ../../src/virt-viewer-window.h:29:0,
                 from ../../src/virt-viewer-app.h:28,
                 from ../../tests/test-hotkeys.c:27:
../../src/virt-viewer-display.h:28:31: fatal error: virt-viewer-enums.h: No such file or directory
 #include "virt-viewer-enums.h"
                               ^
compilation terminated.

The fix is to include builddir into paths where header files are
looked for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-04 20:20:45 +02:00
Michal Privoznik
5eb4a82b18 virt-viewer-display-vnc: Include virt-viewer-util.h
In function virt_viewer_display_vnc_new() we are calling
virt_viewer_signal_connect_object() which is defined in
virt-viewer-util module. However, the header file for the module
is never included.

  CC       libvirt_viewer_la-virt-viewer-display-vnc.lo
virt-viewer-display-vnc.c: In function 'virt_viewer_display_vnc_new':
virt-viewer-display-vnc.c:251:5: warning: implicit declaration of function 'virt_viewer_signal_connect_object' [-Wimplicit-function-declaration]
     virt_viewer_signal_connect_object(app, "notify::enable-accel",
     ^
virt-viewer-display-vnc.c:251:5: warning: nested extern declaration of 'virt_viewer_signal_connect_object' [-Wnested-externs]

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-04 20:20:22 +02:00
Pavel Grunt
ffa460b8c6 app: Check validity of hotkey
The hotkey is valid if it has a valid value. The value is valid if it is
not empty and is successfully parsed by gtk_accelerator_parse().

These hotkeys formats are considered invalid:
 "key" - missing value
 "key=" - missing value
 "key=abcd" - value cannot be parsed by gtk_accelerator_parse()

Resolves: rhbz#1339572

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-02 11:04:02 +02:00
Pavel Grunt
9a3041eb00 tests: Add hotkeys test
Check if expected g_warning messages are logged.

Related: rhbz#1339572

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-02 10:59:25 +02:00
Pavel Grunt
7d7e8c2aae app: Use debug to inform about smartcard shortcuts state
Related: rhbz#1339572

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-02 10:59:18 +02:00
Pavel Grunt
bc83803859 vnc-display: Disable default grab sequence
It should be enabled only if the "release-cursor" sequence was not
specified (by using "--hotkeys=release-cursor=sequence"), otherwise
both sequences would release the cursor.

The solution is taken from the spice-display code.

Resolves: rhbz#1339575

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-02 10:58:57 +02:00
Pavel Grunt
40d1fff271 Include virt-viewer-util.h only in source files
It doesn't have any symbols to be used in headers

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-31 16:52:46 +02:00
Pavel Grunt
4b6fc261d0 Add mnemonics for each display item
Related: rhbz#1332545

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-31 16:44:07 +02:00
Christophe Fergeau
4f37332940 ovirt: Use sso-token when set in .vv file
Starting with oVirt 4.0, this replaces the jsessionid field for
automatic authentication with oVirt instances for REST communication.
2016-05-10 09:51:14 +02:00
Christophe Fergeau
c904b1c63a vv-file: Add support for 'sso-token' field in [ovirt]
This is the new way of authenticating with remote oVirt instance
starting with oVirt 4.0.
2016-05-10 09:51:14 +02:00
Christophe Fergeau
9aa7aec9a9 ovirt: Fix OvirtApi memory handling
The oVirt integration code in remote-viewer assumes that
the caller owns a reference on the OvirtApi instance returned
by ovirt_proxy_fetch_api{,finish}.
This is incorrect as these 2 API calls have always been documented as
being (transfer none). This was working so far because libgovirt was
leaking an OvirtApi reference. This bug is fixed upstream, so we now get
a warning on remote-viewer exit about trying to unref an invalid object.

This commit fixes that by taking the ref we expect in OvirtForeignMenu,
and by not releasing a ref we do not own in remote-viewer.c
2016-05-10 09:51:14 +02:00
Christophe Fergeau
7a7143245a ovirt: Error reporting improvements on invalid VM name 2016-05-10 09:51:14 +02:00
Christophe Fergeau
bc77b4776c ovirt: Don't try to use [ovirt] if jsessionid is not set
If jsessionid is not set in the .vv file and we try to use anyway the
REST API, an authentication dialog will be shown by remote-viewer, which
is very unwelcome. If we don't have a jsessionid set, we know we won't
be able to silently login to the REST API, so don't try to set a foreign
menu when it's not set.
2016-05-10 09:51:14 +02:00
Frediano Ziglio
e732fa08c8 Add a program to test redirection on Windows
This program attempt multiple redirection combination:
- passing handles using either CreateProcess or SetStdHandle;
- having a console or not;
- redirection stdout/stderr yes or not.

Worth to mention that for running this test program the user will need
either a native MingW or Wine (with .exe executables enabled in Linux
binfmt).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-04 11:16:05 +02:00
Frediano Ziglio
146e00f5eb Manage redirection in a way similar to Unix
This patch allows remote-viewer to redirect output/error streams to
files.
Also if launched from a console program (for instance from the command
prompt) you are able to see output from the console where you launch
the program.
This allow to launch the program with a syntax like:
  > remote-viewer.exe --debug > log.txt 2>&1
or simply:
  > remote-viewer.exe --debug

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-04 11:16:05 +02:00
Jonathon Jongsma
b917969f75 Add some missing mnemonics to menu items
Fixes: rhbz#1332545
2016-05-03 15:49:05 -05:00
Fabiano Fidêncio
ad40386fa2 msi: Depend on mingw-adwaita-icon-theme
Instead of maintain a file which includes every single icon that we use
from adwaita-icon-theme (adwaita-icons-needed.wxi.in), let's depend on
mingw-adwaita-icon-theme directly.
It reduces considerably the maintainability and the risk to have missing
icons. Although, the size of the final binary gets increased from ~35MB
to ~50MB.

Resolves: rhbz#1301064
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-03 08:04:23 +02:00
Fabiano Fidêncio
c589d8ad35 Remove nsis installer
The only reason for us to keep maintaining the nsis installer was the
activex plugin (spicex), which requires those nsis based installers.
As the next release of RHEV/oVirt won't use the activex plugin (spicex)
let's completely remove the nsis installer from our tree and focus on
only maintain the msi installer.
oVirt/RHEV is shipping virt-viewer based on 2.0 release and, if needed,
they can stick to 3.0 branch in a future update (in case their plan goes
wrong and they end up needing the nsis support).

Related: rhbz#1324885 and rhbz#1316560
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-03 08:04:23 +02:00
Jonathon Jongsma
274e65d6da Add some timeouts to file transfer dialog
In order to avoid the situation where a dialog flashes onto the screen
and then is immediately hidden, I've added a couple timeouts to the
dialog.

The first is a 250ms timeout before showing the dialog. This avoids
showing the dialog at all for very small, quick transfers.

There is also a 500ms timeout before hiding a finished task. This
ensures that even transfers that only take e.g. 251ms to transfer will
get shown to the user for at least 500ms rather than being hidden 1ms
after showing the dialog.

Related: rhbz#1332180, rhbz#1324521
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-05-03 08:04:15 +02:00
Jonathon Jongsma
0856067d79 Add file transfer dialog
This dialog will show the progress of files being transferred from the
client to the guest and allows the user to cancel ongoing file transfer
tasks.  The user can cancel each transfer individually, or cancel all
ongoing transfers at once.

Resolves: rhbz#1332180, rhbz#1324521
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-03 08:04:10 +02:00
Fabiano Fidêncio
01b66ef88b spice: avoid crashing when using invalid video config
virt-viewer _only_ supports guests that have either:

A) a signle graphics device with multiple displays (monitorid=0,
displayid=(0,1,2,3)).

B) multiple graphics device with a single display each
(monitorid=(0,1,2,3), displayid=0).

From now on, avoid crashing connecting to a guest which has a graphics
configuration that violates A or B. However, even avoiding the crash, we
cannot ensure the guest will work as expected.

Resolves: rhbz#1250820

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-04-26 13:58:59 +02:00
Pavel Grunt
4048d28de8 manpage: Mention spice-gtk in See also section 2016-04-22 17:05:07 +02:00
Christophe Fergeau
191f9a8ab4 Disable IME to allow receiving all keys
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1297640

Acked-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-04-19 15:22:17 +02:00
Christophe Fergeau
82589e74e6 spec: Use pkgconfig() in BuildRequires
This is better than hardcoding the name of the development package as
this will not be impacted by package renames.
2016-04-15 18:03:31 +02:00
Eduardo Lima (Etrunko)
a19659eb76 configure: cleanup {GLIB2, GTK}_CFLAGS
Also, remove unecessary AC_SUBST calls, as {GLIB2,GTK}_LIBS are never
touched.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-24 11:49:51 +01:00
Eduardo Lima (Etrunko)
e5239c7cbb Fix spice includes
Spice release version 0.31 requires that only spice-client.h or
spice-client-gtk.h should be included directly. As a result,
compilation is now throwing warnings like:

warning: #warning "Only <spice-client.h> can be included directly" [-Wcpp]
warning: #warning "Only <spice-client-gtk.h> can be included directly" [-Wcpp]

This patch also bumps spice version requirement to 0.31, to ensure
those files are available.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-24 11:49:39 +01:00
Pavel Grunt
3367285c37 util: Remove unused GHashTable key/value 2016-03-15 07:24:03 +01:00
Pavel Grunt
2736081940 Move tests under /tests directory
Keep tests separated from the code
2016-03-14 16:36:37 +01:00
Pavel Grunt
d81f7c047f Add libvirt-viewer-util library an use it in tests 2016-03-14 16:35:43 +01:00
Christophe Fergeau
8ea6a9d923 Don't include libvirt.h in virt-viewer-auth.h
virt-viewer-auth.h does not use any libvirt types, so the #include is
not needed, and virt-viewer-auth.h is used while building remote-viewer,
which do not use libvirt compilation flags. This caused failures on
a freshly installed box without libvirt headers.
2016-03-09 16:59:59 +01:00
Christophe Fergeau
0ea2a674b8 ovirt: Only use active ISO domains for foreign menu
oVirt storage domains can be in various states (inactive, in
maintainance, ...). We only want to show the ISOs it contains in the
foreign menu when the storage domain is actually active, not in the
other states.

https://bugzilla.redhat.com/show_bug.cgi?id=1310450
2016-03-09 16:59:37 +01:00
Pavel Grunt
3e42ec7c39 test: Add tests for monitor mapping 2016-03-08 19:04:12 +01:00
Pavel Grunt
ab603d8e25 virt_viewer_parse_monitor_mappings: Add parameter for client monitors
Drop dependency on gdk. it allows to write tests not depending
on the client's configuration.
2016-03-08 19:04:04 +01:00
Pavel Grunt
e0c6718c3f Move monitor mapping parsing from app to util
It is not specific to VirtViewerApp.
Following commits will add support for tests thanks to this move.
2016-03-08 19:03:53 +01:00
Fabiano Fidêncio
adf1ee3823 app, cosmetic: remove one unneeded level of identation
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-03-07 16:04:01 +01:00
Fabiano Fidêncio
5f26924535 app: monitor-config - do it all or nothing
Don't keep trying to use a monitor config when it already failed for one
monitor, otherwise virt-viewer can end up in a situation where none of
the displays are enabled but the program is still running.
So, in case of any failure, let's skip the whole monitor config, forcing
virt-viewer to use the "fallback" one instead.

Resolves: rhbz#1315206

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-03-07 16:03:52 +01:00
Fabiano Fidêncio
4aac5ca55b Refresh translations from Zanata
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-03-04 11:30:11 +01:00
Fabiano Fidêncio
82e13442b9 Use GResource for loading ui files
Let's take advantage of GResource for loading ui files in a better and
cleaner way than virt_viewer_util_load_ui() was doing.
It also brings the benefit, at least for developers, of being able to
test ui changes without having to "make install" virt-viewer.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:37 +01:00
Fabiano Fidêncio
ad6924aff1 app: Remove useless libxml includes
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:32 +01:00
Fabiano Fidêncio
b7de994156 about: Fix the program's name in the title
Title currently says "About Glade". It's not a big deal because it's not
actually shown anywhere, but just for correctness let's change it to
"About Virt-Viewer".

Thanks Jonathon Jongsma for pointing this out.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:12 +01:00
Eduardo Lima (Etrunko)
d18bbc6f5b Don't open the default display while parsing command line
Since commit a9ce19f it has not been possible to check app version from
a tty without X session running. The issue is that gtk_get_option_group
function opens the default display if passed TRUE as argument.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-26 22:23:07 +01:00
Fabiano Fidêncio
0e0df372cf session-vnc: Avoid depracated warnings on this file
This is a temporary solution for using autobuild.sh, as commit df403f5
introduced the -Wdeprecated-declarations and gtk-vnc provides a callback
for getting authentication credentials which uses GValueArray, forcing
virt-viewer to keep using g_value_array_get_nth(), which is deprecated.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-26 22:21:04 +01:00
Fabiano Fidêncio
45afba8d0b configure: Simplify libvirt/libvirt-glib handling
Merge libvirt and libvirt-glib checking in PKG_CHECK_MODULES, then we
don't nee the LIBVIRT_GLIB_{CFLAGS,LIBS} in Makefile.am

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-25 22:26:59 +01:00
Fabiano Fidêncio
ce0c17b4f5 wxi: virt-viewer depends on libvirt-glib
Since 51ce01d virt-viewer depends again on libvirt-glib.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:18:53 +01:00
Fabiano Fidêncio
151109dbd2 nsis: Add libvirt-glib-1.0-0.dll
Since 51ce01d virt-viewer depends again on libvirt-glib.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:18:13 +01:00
Fabiano Fidêncio
51ce01dfdd Bring back libvirt-glib dependency
libvirt-glib dependency was dropped in commit 296f91c in favor to
maintain the full glib event loop integration into virt-viewer tree.
This decision was taken because libvirt-glib was not mature enough at
that time, which is not the case nowadays.

The libvirt-glib version chosen as dependency (0.1.8) is the first
release that includes the fixes for the glib event loop integration that
were backported to virt-viewer last year.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:17:37 +01:00
Pavel Grunt
c2d85041fb README: update information
Remove info about gtk versions
Fix a typo
Change link for spice-gtk widget
2016-02-25 09:26:57 +01:00
Fabiano Fidêncio
a3e5d0b97a cleanup: Don't use gtk_widget_modify_{fg,bg}()
These function have been deprecated since Gtk 3.0 and is recommended to
use _override_color() and _override_background_color() instead.
As these new functions take a GdkRGBA as parameter, let's use
gdk_rgba_parse() instead of gdk_color_parse().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:58:01 +01:00
Fabiano Fidêncio
af1e42a101 cleanup: Don't use GtkStock
It has been deprecated since Gtk 3.10.

New strings have been added as the GTK_STOCK_* defines had their
translations done inside Gtk itself, but now the translations of the new
added labels must be done by virt-viewer translators.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:37 +01:00
Fabiano Fidêncio
a37127c7cf cleanup: Drop old compatibilty code
A few more pieces of old compatibility code can be dropped, as we
already depend on GLib 2.38.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-02-24 16:57:34 +01:00
Fabiano Fidêncio
4c4a43c61d Use GDK_VERSION_MAX_ALLOWED
In order to avoid using a too new Gtk API.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:23 +01:00
Fabiano Fidêncio
96d120903f Use GLIB_VERSION_MAX_ALLOWED
In order to avoid using a too new GLib API.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:12 +01:00
Fabiano Fidêncio
df403f5aba m4: Use -Wdeprecated-declarations
Let's enable deprecated-declarations warnings as we want to:
1) Avoid insert/maintain deprecated widgets/methods
2) Avoid adding widgets/methods that are too new, what could cause
problems like virt-viewer not being able to build in a specific distro.

Patches for making these two items possible are coming, introducing
_VERSION_MAX_ALLOWED for both GLIB and GDK and removing (as much as
possible) deprecated widgets/methods/structures.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:56:51 +01:00
Fabiano Fidêncio
2c712a0525 mingw: Bump msitools version
Since commit 5d98df3 we depend on msitools 0.95-2.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 08:27:08 +01:00
Fabiano Fidêncio
80ac4d5774 app: Don't leave a window opened in case of connection error
Since commit ed9b3f3 the main window is not hidden when disconnecting.
But it also is not hidden when a connection error occurs, leaving a
black display with a not so accurate message to the users in case they
try to connect to a non-valid address from the remote-viewer connection
window and in this case the main window (display #1) shuldn't be shown.

The impetus for this chance is the following:
- user runs remote-viewer without any argument
- the remote-viewer connection window shows up
- user attempts to connect to a non-valid address
- a dialog pops up indicating a failure connecting to the graphic server
- the main window shows up saying "Connecting to the graphic server"
- user clicks 'Ok'
- the main window stays there with the same message

As a user, I expect the program to not show the main window in
connecting failure cases. This patch accomplishes that.
2016-02-24 07:21:06 +01:00
Fabiano Fidêncio
5d98df3ef1 nsis: update nettle to 3.2.1
Use version 3.2.1, matching what currently is in f23.
2016-02-24 07:20:10 +01:00
Eduardo Lima (Etrunko)
76d2e483d5 Drop old compatibility code
With glib requirements now being 2.38, these functions do not make sense anymore.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
3270ce61af remote-viewer: Remove unused properties
The reason for using properties to access those members was to ensure
that they would only be set during the creation of the object. Now that
we removed that restriction, we set private members directly.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
a9ce19f848 Port to GtkApplication API's
Most of this patch consists in code being shuffled around to fit the
expected flow while using the new APIs. I tried my best to make this
patch the less intrusive as possible. Main changes are:

- Updated build requirements
   * glib version 2.38
   * gtk+ version 3.10
   * gio

- VirtViewerApp is now a subclass of GtkApplication.
  Some mainloop calls were replaced:
   * gtk_main() -> g_application_run()
   * gtk_quit() -> g_application_quit()

- Unified command line option handling.
  The logic has moved from the main functions and split in common
  options, and specific ones for each application. With this, the main
  functions were highly simplified, and now basically responsible for
  instantiating the App object and running the main loop.

- All Window objects must be associated with the Application.
  With this, there is no need to emit our own 'window-added'/'window-
  removed' signals, as those will be emited by GtkApplication whenever
  gtk_application_add_window() and gtk_application_remove_window() are
  called. Also, 'window-removed' was not being used anywhere.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:45:56 +01:00
Uri Lublin
7a54b96dbe spice: vv-file: do not ignore usb-filter
Fixes rhbz#1309634

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-18 16:23:34 +01:00
Eduardo Lima (Etrunko)
40ebfbadee Minor code cleanups
- Reuse #ifdef HAVE_SPICE_GTK block for include.
- Move declaration of vfunc together with others of the same class.
- Move variable declaration to the top of the function.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-15 21:50:19 +01:00
Fabiano Fidêncio
4235ef3453 Drop support to gtk2
The 3.0 release was the last one that still supports GTK2. For the
Windows builds the support to GTK2 was dropped in the previous release.
Let's do the same for the entire project now.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-15 21:49:57 +01:00
Pavel Grunt
c86a4dfa41 display: Use correct variable name
Fix gtk2 build
2016-02-15 17:59:32 +01:00
Pavel Grunt
fd4c721551 display: Remove zoom property
It is possible to get the same info from the "zoom-level" property.
virt_viewer_display_get_zoom() now returns TRUE if zoom level != 100
2016-02-15 14:01:50 +01:00
Pavel Grunt
ca1ad884bd display: Use common code to get preferred size 2016-02-15 14:01:42 +01:00
Pavel Grunt
724744ca20 app: Compute monitor mapping only in fullscreen 2016-02-15 13:51:13 +01:00
Pavel Grunt
529980e8d3 app: Do not show usbredir button without session
The button is visible in the fullscreen toolbar when waiting for a guest.
Clicking on it causes the runtime warning:
virt-viewer-CRITICAL **: virt_viewer_session_usb_device_selection: assertion 'VIRT_VIEWER_IS_SESSION(self)' failed
2016-02-15 10:05:16 +01:00
Pavel Grunt
8c9a968561 app: Add comment only when config file has VM group
Avoid the debug message on close:
virt-viewer-DEBUG: Unable to get comment from key file: Key file does not have group '39cd210d-5d45-478a-91fe-b3680307f2df'
2016-02-15 10:04:42 +01:00
Pavel Grunt
fcb200e3d4 app: Return early on empty monitor mapping
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1304648
2016-02-15 10:04:32 +01:00
Pavel Grunt
422cbb6ea6 display: Set value of desktop width and height property directly
Avoid calling gtk_widget_queue_resize() and emiting
the "display-desktop-resize" signal.
The only user of the properties is virt_viewer_display_spice_set_desktop()
which will call the function and emit the signal after setting both
"desktop-width" and "desktop-height" properties.

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
045174f483 display: Return early and remove a block
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
c2f6412e7a display: Remove unnecessary VIRT_VIEWER_DISPLAY cast
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Fabiano Fidêncio
5fd23329c4 Remove GSLice usage
It's being slowly deprecated in glib
https://bugzilla.gnome.org/show_bug.cgi?id=754687
2016-01-18 11:27:07 +01:00
Jonathon Jongsma
c2046a2992 display: Set useful values for MIN_DISPLAY_{WIDTH, HEIGHT}
Nowadays the value for MIN_DISPLAY_{WIDTH,HEIGHT} is 50. This arbitrary
value doesn't bring any benefit, doesn't provide a useful size for a
desktop to be usable and can actually trigger some undefined behavior
when reaching resolutions that are lower than the ones provided by the
video drivers (as in rhbz#1296878).

In order to avoid these issues and provide a minimum resolution that can
still be useful for our users, let's use the same values for minimum
width and height used by the linux QXL drivers (320x200).

This also requires us to adjust the minimum requested widget size when
zoom is enabled so that we don't accidentally request a size smaller
than the driver can support.

Related: rhbz#1296878
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-01-13 10:36:55 -06:00
Fabiano Fidêncio
907f8c5d33 display: set min value for desktop-{width,height} props as MIN_DISPLAY_{WIDTH,HEIGHT}
Otherwise we can have warnings when resizing the virt-viewer window to
the smallest possible size, like:

(virt-viewer:11187): GLib-GObject-WARNING **: value "50" of type `gint'
is invalid or out of range for property `desktop-height' of type `gint'

Related: rhbz#1296878
2016-01-08 12:38:22 +01:00
Daniel P. Berrange
992df28142 Refresh translations from zanata
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-12-07 14:33:58 +00:00
Daniel P. Berrange
386ceb7778 Update NEWS for release 3.0
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-12-03 13:41:56 +00:00
Daniel P. Berrange
9734cbb8e5 Bump spice-gtk dep to 0.30.0 to avoid dep on git snapshot release 2015-12-03 13:41:56 +00:00
Daniel P. Berrange
d71bb09046 s/mingw62/mingw64/ in RPM spec file 2015-12-03 13:34:55 +00:00
Daniel P. Berrange
0de42b746e Avoid macro in RPM comment 2015-12-03 13:34:55 +00:00
Fabiano Fidêncio
15c97c42a1 autobuild: gtk2 has been dropped for windows
0a7fa73f is the commit that dropped support for gtk2 for the nsis
installer.
03c014cb is the commit that dropped support for gtk2 for the msi
installer.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
f345d27724 specs: add remote-viewer-connect.xml
The file was introduced in commit 0571843d but never added to the spec
files.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
cf228ad54d nsis: add libbz2-1.dll
mingw-bzip2 seems to be a mingw-freetype dependency.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
730a50a67a nsis: update nettle to 3.1.1
Use version 3.1.1, matching what currently is in f23.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
632d9369bc nsis: update libgnutls to 3.4.7
Use version 3.4.7, matching what currently is in f23.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
65aa7e08a5 nsis: update pango to 1.38.1
Use version 1.38.1, matching what is in f23.
An important note is that the removed files were removed in
mingw-pango-1.37.1.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
4b3d30683d docs: fix "make syntaxcheck" 2015-12-01 16:46:07 +01:00
Jonathon Jongsma
428c3e3fdb Add some multimonitor documentation
These two files describe some of the behavior and requirements for
virt-viewer in fullscreen multimonitor mode
2015-12-01 09:00:59 -06:00
Daniel P. Berrange
fdf55b6ce3 autogen: Ensure m4 directory exists
We're telling autoconf to look in the m4/ directory for
files, but this directory doesn't exist in a clean checkout
until libtoolize has run. Older versions of autoconf consider
this to be a fatal error.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-05 14:24:23 +00:00
Daniel P. Berrange
a7861f975b git.mk: fix copyright line and remove use of -o / -a
Any copyright line must use 'Copyright (C) <year> Red Hat'
per the syntax-check rule.

Use of -a / -o args to "test" is non-portable and should
instead be done with 'test ... || test ...'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-05 14:22:35 +00:00
Eduardo Lima (Etrunko)
8684961d2d Remove useless {get,set}_property functions
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
95773ca5e1 Move declaration to the beginning of the file
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
69e0476314 Update MAINTAINERCLEANFILES variables
Makefile.am: Use helper variables from git.mk
man/Makefile.am: This should be $(dist_man_MANS) instead of $(man_MANS)

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
173a8cff4e Update git.mk from latest upstream version
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
03ec5a69d2 Call intltoolize after autoreconf
After removing m4/.gitignore file in previous patch, I started getting
the following error when running autogen.sh.

ln: failed to create symbolic link ‘m4/intltool.m4’: No such file or directory
cp: cannot create regular file ‘m4/intltool.m4’: No such file or directory
intltoolize: cannot copy '/usr/share/aclocal/intltool.m4' to 'm4/intltool.m4'

The problem is that intltoolize requires te m4/ directory to be present,
and this directory is actually created by running autoreconf, so it
should be called before intltoolize.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:15 -02:00
Eduardo Lima (Etrunko)
fbce89dd7f Remove m4/.gitignore file
All .gitignore files are handled by git.mk and should not be part of the
repository.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:16:50 -02:00
Pavel Grunt
7870ea5eff session-spice: Disable extra displays in fullscreen mode
When running in fullscreen it is possible to end up in a situation
where we have more displays enabled than monitors. This can happen
if displays that were enabled in the previous connection to the guest
doesn't match displays requested when entering the fullscreen mode.

This commit solves the problem by disabling displays that should not be
enabled in the fullscreen mode.

Resolves: rhbz#1212802
2015-11-04 14:03:32 +01:00
Pavel Grunt
1f2ef0e9de app: Do not map display to non-existent monitor 2015-11-04 14:03:26 +01:00
Pavel Grunt
4d6f730fce app: Add helper for number of client monitors 2015-11-04 14:03:20 +01:00
Fabiano Fidêncio
96413a6266 util: Fix the size of sorted_displays allocation
As sorted_displays is a vector containing all displays' order, its
allocation size must be the maximum display id + 1 instead of the
maximum display id. Also, fix the size used for sorting and iterating
the sorted_displays vector.

Valgrind log:
==15946== Invalid write of size 4
==15946==    at 0x4169C0: virt_viewer_align_monitors_linear (virt-viewer-util.c:581)
==15946==    by 0x42248B: virt_viewer_session_on_monitor_geometry_changed (virt-viewer-session.c:438)
==15946==    by 0xBB41F03: _g_closure_invoke_va (gclosure.c:831)
==15946==    by 0xBB5BC7C: g_signal_emit_valist (gsignal.c:3214)
==15946==    by 0xBB5C764: g_signal_emit_by_name (gsignal.c:3401)
==15946==    by 0x4328F3: virt_viewer_display_spice_monitor_geometry_changed (virt-viewer-display-spice.c:93)
==15946==    by 0x432D60: virt_viewer_display_spice_size_allocate (virt-viewer-display-spice.c:224)
==15946==    by 0xBB41CD4: g_closure_invoke (gclosure.c:768)
==15946==    by 0xBB53538: signal_emit_unlocked_R (gsignal.c:3549)
==15946==    by 0xBB5BEEF: g_signal_emit_valist (gsignal.c:3305)
==15946==    by 0xBB5C29E: g_signal_emit (gsignal.c:3361)
==15946==    by 0x637D6F6: gtk_widget_size_allocate_with_baseline (gtkwidget.c:6093)
==15946==  Address 0x18c79d4c is 0 bytes after a block of size 12 alloc'd
==15946==    at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==15946==    by 0xBDD36D1: g_malloc0 (gmem.c:127)
==15946==    by 0x41698D: virt_viewer_align_monitors_linear (virt-viewer-util.c:577)
==15946==    by 0x42248B: virt_viewer_session_on_monitor_geometry_changed (virt-viewer-session.c:438)
==15946==    by 0xBB41F03: _g_closure_invoke_va (gclosure.c:831)
==15946==    by 0xBB5BC7C: g_signal_emit_valist (gsignal.c:3214)
==15946==    by 0xBB5C764: g_signal_emit_by_name (gsignal.c:3401)
==15946==    by 0x4328F3: virt_viewer_display_spice_monitor_geometry_changed (virt-viewer-display-spice.c:93)
==15946==    by 0x432D60: virt_viewer_display_spice_size_allocate (virt-viewer-display-spice.c:224)
==15946==    by 0xBB41CD4: g_closure_invoke (gclosure.c:768)
==15946==    by 0xBB53538: signal_emit_unlocked_R (gsignal.c:3549)
==15946==    by 0xBB5BEEF: g_signal_emit_valist (gsignal.c:3305)

Resolves: rhbz#1272650
Related: rhbz#1267184
2015-10-21 16:04:01 +02:00
Fabiano Fidêncio
73b55b3e1b session: Only create a hashtable if apply_monitor_geometry vfunc exists
Creating the monitors hashtable only after checking for the existence of
apply_monitor_geometry vfunc avoids leaking the hashtable in the case
where the vfunc doesn't exist.

Related: rhbz#1267184
2015-10-21 15:43:15 +02:00
Pavel Grunt
50f7d3dff8 app: Use display id instead of 'this' in debug 2015-10-21 08:09:21 +02:00
Christophe Fergeau
c1e72c1be1 Stop polling after reconnecting to libvirtd
When the connection to libvirtd is lost, virt-viewer starts polling for
libvirtd to come back. The polling mechanism is also used when
connecting to very old libvirtd which don't support
virConnectDomainEventDeregisterAny().

Currently, once we could reconnect to libvirtd, virt-viewer will keep
polling, thus behaving as if the libvirtd connection does not support
virConnectDomainEventDeregisterAny(). This commit makes sure we stop
polling once the new libvirtd connection is established.

This has the side-effect of preventing
https://bugzilla.redhat.com/show_bug.cgi?id=1271519 from occurring with
recent libvirt as it's caused by some race occurring when using the
polling code.
2015-10-20 10:20:23 +02:00
Jonathon Jongsma
aff6c79ae0 Use the display ID to configure fullscreen monitors
When starting virt-viewer in fullscreen mode, we generally try to
arrange guest displays exactly the same as client monitors. So if a
client machine has two monitors, we'll try to enable display 0 and 1 on
the guest (in that order). However, when using the configuration file to
map fullscreen displays to different monitors, the guest displays may
not be sequential, or there may be displays missing. For example,
consider the following configuration:

monitor-mapping=1:2;2:1

In virt_viewer_session_spice_fullscreen_auto_conf(), we were building an
array of GdkRectangles for the initial monitors that we want to enable
on the guest. We then configured the guest displays using the index of
the array for the as the id of the guest display. But when displays
are sparse or are out-of-sequence, the array index will not match the
>ntended display ID. This created problems where displays were arranged
incorrectly. By changing the simple array into a GHashTable, we can keep
the display ID together with the GdkRectangle until we need to use it,
and things will be configured correctly.

This regression was introduced by c586dc8c.

Fixes: rhbz#1267184
2015-10-09 09:17:52 -05:00
Jonathon Jongsma
6331757164 SessionSpice: make main-window a property
Make "main-window" a construct-only property of VirtViewerSessionSpice.
This allows us to set it in the constructor and encapsulate all of the
setup within the gobject constructor rather than doing extra work in the
_new() function.
2015-10-09 09:17:52 -05:00
Fabiano Fidêncio
69e29aca56 msi: use the correct id for remote-viewer.exe
As, in theory, file ids are stables, seems that we have been using the
wrong id for remote-viewer.exe (not sure if since forever or if the path
changed).
That's what msidump shows:

ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "fil808B4A5BAB4ACD727D3823632E798743" File.idt
ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "fil808B4A5BAB4ACD727D3823632E798743" Registry.idt
reg29E29C5608128A0192FB9DC3C18562A6 0
VirtViewer.vvfile\shell\open\command
"[#fil808B4A5BAB4ACD727D3823632E798743]" "%1"   CProgIds
ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "remote-viewer.exe" File.idt
fil610DF9E49759B1DEC646290195F96F8A cmp7677A8696936707272DCA43B1BF26760
remote-viewer.exe   855735          512 837

So, let's use the correct id (fil610DF9E49759B1DEC646290195F96F8A) from
now on.

Related: rhbz#1146016
2015-10-08 16:43:16 +02:00
Fabiano Fidêncio
097e1f6c51 msi: {virt,remote}-viewer depends on libxml2
Currently libxml2 is pulled as an indirect dependency when virt-viewer
is built with support to ovirt or libvirt (pulled by rest or libvirt,
respectively). However, {virt,remote}-viewer itself depends on libxml2
and not having it as an explicit dependency will cause errors on opening
remote-viewer when it is built without support to ovirt/libvirt.
2015-10-06 23:06:23 +02:00
Jonathon Jongsma
9c77a78af2 Add new functions to enable/disable a display
Previously, there was a single function for controlling the enabled
state of a display: virt_viewer_display_set_enabled(). Unfortunately,
this function is used for two slightly different things:

 A. It informs the local display widget that the display has become
    disabled or enabled on the server. In other words, it tries to
    synchronize the 'enabled' state of the local widget with the actual
    state of the remote display.

OR

 B. It tries to actively enable a currently-disabled display (or vice
    versa) due to some action by the user in the client application.
    This causes the client to send a new configuration down to the
    server. In other words, it tries to change the state of the remote
    display.

There is some conflict between these two scenarios. If the change is due
to a notification from the server, there is no need to send a new
configuration back down to the server, so this results in unnecessary
monitor configuration messages and can in fact cause issues that are a
little bit hard to track down. Because of this, I decided that it was
really necessary to have two separate functions for these two different
scenarios. so the existing _set_enabled() function will be used for
scenario A mentioned above. I added two new
functions (_enable() and _disable()) that are used to send new
configurations down to the server.
2015-09-10 16:02:13 -05:00
Jonathon Jongsma
344eb9a685 Set enabled status of all displays when we get a monitor update
Previously, when we received a new monitors update from the server, we
only called virt_viewer_display_set_enabled() for the displays that were
enabled. We simply assumed that those that were not enabled were already
set to disabled. This assumption is currently valid, but I have some
changes in the pipeline where this is not true. This change ensures that
we update the enabled state of all monitors when we get an updated
monitors conifguration.
2015-09-08 15:14:35 -05:00
Jonathon Jongsma
6413b645ff Don't emit 'monitor-geometry-changed' for disabled displays
When a display widget receives a new size allocation, we generally emit
a monitor-geometry-changed signal so that we can reconfigure the
displays. But if the widget for a *disabled* display is allocated,
there's no reason to send down a new configuration. We don't need to
emit this signal. This doesn't currently cause any problems, but I ran
into issues while testing some other uncommitted changes.
2015-09-08 15:14:35 -05:00
Fabiano Fidêncio
5001f2b1b1 coverity: result is not floating-point
Coverity says:
Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
interger_division: Dividing integer expressions "preferred->width * 100"
and "zoom", and then converting the integer quotient to type double. Any
remainder, or fractional part of the quotient, is ignored.
2015-08-17 17:53:57 +02:00
Fabiano Fidêncio
1782fdd050 coverity: Copy into fixed sized buffer
Coverity says:
You might overrun the 108 byte fixed-size string "addr.sun_path" by
copying "unixsock" without checking the lenght.
Note: This detect has an elevated risk because the source argument is a
paramenter of the current function.
2015-08-13 15:20:22 +02:00
Pavel Grunt
39b0ce009e session-spice: Use display id instead of monitor id in debug log
Windows guests have monitor id = 0, so the debug log is always the same:
"creating spice display (#:0)" for all the displays.
2015-07-29 22:50:06 +02:00
Pavel Grunt
c8250d0edb configure: Use default error message when package is missing
To make clear why configure failed - e.g.:
 Package requirements (spice-client-gtk-2.0 >= 0.28) were not met
 Requested 'spice-client-gtk-2.0 >= 0.28' but version of spice-client-gtk-2.0 is 0.25
instead of
 spice-gtk requested but not found

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1214577
2015-07-29 17:10:47 +02:00
Pavel Grunt
f33c49f72d configure: Enable spice-gtk when have all necessary spice packages
When neither --with-spice-gtk=yes nor --with-spice-gtk=no is used,
spice-gtk is supposed to be automatically enabled/disabled depending
on its availability. However, this is not perfectly working as once
spice-gtk has been detected as available, configure will fail if
spice-protocol or spice-controller are too old. In this case, spice-gtk
support should just be disabled rather than configure failing
2015-07-29 17:10:41 +02:00
Pavel Grunt
0d81ec2ef8 virt-viewer-window: Change zoom with respect to real zoom
The zoom can be changed by resizing the window (VNC / Spice without
the agent). It is necessary to recalculate the zoom level before
changing it, otherwise zoom operations will not work correctly.

Resolves:
https://bugs.freedesktop.org/show_bug.cgi?id=90582
2015-07-29 17:10:35 +02:00
Pavel Grunt
ae7ce62f1b Show window after its default and preferred sizes are set
Under some circumstances (Xfce desktop environment, gtk3 client,  RHEL6
guest having two monitors running locally) it is possible to create
a loop of resizing windows. It is caused by size request like 1x1 sent
to the guest. These request are created because _window_queue_resize()
is called when the window is being shown.
To avoid the problem, call gtk_widget_show() after its preferred and
default sizes are set.

Resolves:
https://bugs.freedesktop.org/show_bug.cgi?id=91405
2015-07-29 17:10:23 +02:00
Fabiano Fidêncio
b225ef5884 events: don't leak GIOChannel when destroying IO handle
virt_viewer_events_add_handle() creates a GIOChannel in order to watch the
fd it was given for changes.
virt_viewer_events_remove_handle() is freeing all the resources allocated by
virt_viewer_events_add_handle() except for this GIOChannel. This commit adds
the needed g_io_channel_unref() call to virt_viewer_events_remove_handle()

Based on commit 8e95b8d25a3eee6316aff2f83b0c449aaf10984a from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
4ec75ee70c events: allow to remove disabled timers and handles
Trying to remove a disabled timer or handle will cause
virt_viewer_events_remove_{handle,timeout}() to return an error
rather than removing it.

Based on commit 79699d73e6e1b7218e3bd8349d176752f86128b9 from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
3281c47e8b events: don't create glib IO watch for disabled handles
It's possible to create a handle to watch for file events which do not
watch for any file event. Such a handle can be enabled later with
virt_viewer_events_update_handle() by setting some conditions to watch for.

When a handle is disabled after it has been created,
virt_viewer_events_update_handle() makes sure it removes the corresponding
virt_viewer_events_handle::source IO watch if any was set.
virt_viewer_events_add_handle() will always create a
virt_viewer_events_handle::source IO watch even if the handle is not
watching for any events.

This commit makes consistent by only creating a watch with g_io_add_watch()
when the caller asked to watch for some events.

Based on commit d71c143936a35cd6c3f23ae0cbf7f3215d944051 from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
0e0f021dec events: don't hold events lock when dispatching free callbacks
The _event_timeout_remove and _event_handle_remove methods
were holding onto the global lock when invoking the free
callback. This is a violation of the libvirt events API
contract which requires free callbacks to be invoked in
a re-entrant safe context.

Based on commit dd17c3cc587c73a8c915238f9d9a3e200e89c93f from
libvirt-glib.
Original author: Daniel P. Berrange <berrange@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
d2c136b020 events: don't reschedule deleted timeouts/watches
The deletion of libvirt timeouts/watches is done in 2 steps:
- the first step is synchronous and unregisters the timeout/watch
  from glib mainloop
- the second step is asynchronous and triggered from the first step.
  It releases the memory used for bookkeeping for the timeout/watch
  being deleted

This is done this way to avoid some possible deadlocks when
reentering the sync callback while freeing the memory associated
with the timeout/watch.

However, it's possible to call gvir_event_update_handle after
gvir_event_remove_handle but before _event_handle_remove does
the final cleanup. When this happen, _update_handle will reregister
the handle with glib mainloop, and bad things will happen when
a glib callback is triggered for this event after _event_handle_remove
has freed the memory associated with this handle watch.

This commit marks the timeouts and watches as removed in the
synchronous _remove callback and makes sure removed timeouts/watches
are ignored in _update callbacks.

Based on commit 3e73e0cee977fb20dd29db3ccfe85b00cc386c43 from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
3874a3015d events: protect 'handles' and 'timeouts' against concurrent accesses
Timeout and watch deletion is done from an idle callback. However,
we cannot assume that all libvirt event calls (the callbacks passed
to virEventRegisterImpl) will be done from the mainloop thread. It's
thus possible that a libvirt event call will run a thread while
one of the idle deletion callbacks runs.
Given that the 'handles' and 'timeouts' arrays are shared among all
threads, we need to make sure we hold the 'eventlock' mutex before
modifying them.

Based on commit 924178f6b35735458b37d30303fe7bc753dde0b1 from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
31fa350266 events: remove unused virt_viewer_events_find_{handle,timeout} arg
Based on commit 1fb34633ef3b318ea678b775d5e47debc98d2184 from
libvirt-glib.
Original author: Christophe Fergeau <cfergeau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
7805b67b68 events: allow zero timeouts for timer
In libvirt, it's perfectly possible and widely used to have disabled
timers (timeout=-1) and fire them up 'randomly' with timeout=0.
However, with current mapping into glib mainloop it's not possible
and causing troubles.

Based on commit a40a1732e0d53fcc44b8d348cec97152dafd2b88 from
libvirt-glib.
Original author: Michal Privoznik <mprivozn@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
a7050b7d2c glib-compat: Use g_new0(GMutex, 1) if GLib >= 2.31
Since 2.31, g_mutex_new() is deprecated.

Based on commit 2dc7476d32a9e158e688486e8f184c719c53bb4c from
libvirt-glib.
Original author: Daniel P. Berrange <berrange@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
d71efee014 glib-compat: group definitions and functions
There is no need to have more than one glib version checking for the
same version, in the same file. Let's just group them all.
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
d28077ad08 events: remove timeout and handle from arrays
Otherwise, it will crash next time it goes find()

Backtrace:
(gdb) where
 #0  0x00007efcae715095 in g_io_create_watch () from
 /lib64/libglib-2.0.so.0
 #1  0x00007efcae7150ef in g_io_add_watch_full () from
 /lib64/libglib-2.0.so.0
 #2  0x00000000004275ba in virt_viewer_events_update_handle
 (watch=<optimized out>, events=1) at
 virt-viewer-events.c:158
 #3  0x00007efcb1a62dce in virNetSocketUpdateIOCallback (sock=0x1e75c00,
 events=1) at rpc/virnetsocket.c:1981
 #4  0x00007efcb1a50113 in virNetClientIOUpdateCallback
 (client=<optimized out>, enableCallback=<optimized out>) at
 rpc/virnetclient.c:1639
 #5  0x00007efcb1a50f82 in virNetClientIO (thiscall=0x20e0170,
 client=0x1f2e060) at rpc/virnetclient.c:1793
 #6  virNetClientSendInternal (client=client@entry=0x1f2e060,
 msg=msg@entry=0x20e0100,
 expectReply=expectReply@entry=false, nonBlock=nonBlock@entry=true) at
 rpc/virnetclient.c:1962
 #7  0x00007efcb1a52413 in virNetClientSendNonBlock (client=0x1f2e060,
 msg=msg@entry=0x20e0100) at
 rpc/virnetclient.c:2036
 #8  0x00007efcb1a5243d in virNetClientKeepAliveSendCB (opaque=<optimized
 out>, msg=0x20e0100) at
 rpc/virnetclient.c:293
 #9  0x00007efcb1a5ba02 in virKeepAliveTimer (timer=<optimized out>,
 opaque=0x20d3d00) at rpc/virkeepalive.c:176
 #10 0x00000000004272e9 in virt_viewer_events_dispatch_timeout
 (opaque=0x1e6cd30) at virt-viewer-events.c:233
 #11 0x00007efcae7231b3 in g_timeout_dispatch () from
 /lib64/libglib-2.0.so.0
 #12 0x00007efcae72279a in g_main_context_dispatch () from
 /lib64/libglib-2.0.so.0
 #13 0x00007efcae722ae8 in g_main_context_iterate.isra.24 () from
 /lib64/libglib-2.0.so.0
 #14 0x00007efcae722dba in g_main_loop_run () from
 /lib64/libglib-2.0.so.0
 #15 0x00007efcb054a045 in gtk_main () from /lib64/libgtk-3.so.0
 #16 0x0000000000410a9c in main (argc=1, argv=0x7ffde58a7978) at
 virt-viewer-main.c:124

Based on commit cff5f1c46f4b9661e112b85159fb58ae473a9a89 from
libvirt-glib.
Original author: Marc-André Lureau <marcandre.lureau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
0a464aae9a events: register event using GOnce to avoid multiple initializations
Based on commit 8f8d9ce5238dbcbce40aa04ba55b8c55f97c79c0 from
libvirt-glib.
Original author: Marc-André Lureau <marcandre.lureau@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Fabiano Fidêncio
8a2420ecdf events: ensure event callbacks are threadsafe
Take a global lock whenever changing any event callbacks to ensure
thread safety.

Based on commit f1fe67da2dac6a249f796535b8dbd155d5741ad7 from
libvirt-glib.
Original author: Daniel P. Berrange <berrange@redhat.com>

Related to: rhbz#1243228
2015-07-22 14:56:57 +02:00
Pavel Grunt
3cbb6232f3 virt-viewer-window: Allow to resize window to any size
The function virt_viewer_window_resize restricts window to be bigger
than a client's screen. It avoids extending the window to more client's
screens, it causes changes of the zoom level if the guest does not fit
into a screen.

Lets remove virt_viewer_window_resize (its behaviour was introduced
by the commit 6acb3856b6d8007752388f22f97aa8aaffdb7a5e). It will let
the window managers to handle resizing of the window.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1221501
https://bugzilla.redhat.com/show_bug.cgi?id=1205804
2015-07-22 14:52:28 +02:00
Pavel Grunt
c645a99267 Remove unnecessary parameter from virt_viewer_window_resize()
Since c3cbdef888cc823e92140027d38378f40ccd4174 virt_viewer_window_resize
is always called with keep_win_size = FALSE.
2015-07-22 14:51:26 +02:00
Pavel Hrdina
08378ec4dc virt-viewer: set keepAlive on libvirt connection
Setting the keepAlive on libvirt connection is needed in order to
receive the CloseCallback event.

Resolves: rhbz#1164052
2015-07-09 02:45:12 +02:00
Jonathon Jongsma
ba5bf67288 Build an intermediate convenience library
Instead of building every single source file twice (once for
virt-viewer, and once for remote-viewer), just build them into a
temporary library and link the final executables against that.

The one possible drawback to this approach is that we now use the same
log domain for both executables: 'virt-viewer'. Previously, the
remote-viewer executable used 'remote-viewer' for its log domain.
2015-06-30 14:31:11 -05:00
Jonathon Jongsma
1716c1a7b9 Build: put one file on a line
For easier maintenance, put a single source file per-line in the
makefile
2015-06-30 14:31:11 -05:00
Jonathon Jongsma
bdd3b7af74 Remove spice-controller flags from virt-viewer build
Virt-viewer does not use spice-controller, only remote-viewer does. So
there's no need to ad SPICE_CONTROLLER_CFLAGS to the virt-viewer build.
2015-06-30 14:31:11 -05:00
Fabiano Fidêncio
cd2d9acc41 mingw,spec: Fix mingw-gstreamer1-plugins-bad-free name
The package was created with a wrong name (mingw-gstreamer1-plugins-bad)
and then fixed (mingw-gstreamer1-plugins-bad-free) for f22 and newer.
2015-06-24 14:34:48 +02:00
Fabiano Fidêncio
03c014cb38 msi: drop gtk2 support
As virt-viewer builds for Windows are using GTK3 nowadays, we can easily
drop GTK2 support and avoid maintenance effort in something that is not
used/tested anymore.
2015-06-23 17:39:04 +02:00
Fabiano Fidêncio
0a7fa73f6c nsis: drop gtk2 support
As virt-viewer builds for Windows are using GTK3 nowadays, we can easily
drop GTK2 support and avoid maintenance effort in something that is not
used/tested anymore.
2015-06-23 17:39:00 +02:00
Fabiano Fidêncio
3e47ae0383 mingw-spec: Update msitools dependency
The new msitools release includes the necessaries changes for fixing
mingw-virt-viewer build (on fedora22).

These fixes are:
- an updated libvirt.wxi, removing storageencryption.rng file
- a new included libeproxy.wxi, a new dep for gtk3 since its 3.15.3
  version.
2015-06-23 16:43:03 +02:00
Fabiano Fidêncio
9f96eabdeb nsis: add libepoxy-0.dll (a new gtk3 dependency)
The new dependecy was introduced in gtk+ 3.15.3.
2015-06-23 16:43:03 +02:00
Jonathon Jongsma
c33f37efe3 Don't wait for reconnect when user cancels auth
When starting virt-viewer with the --reconnect switch to a guest that
has a password, if the user cancels the authentication dialog (e.g.
pressing 'Esc'), the window will display "Waiting for guest domain to
restart".  Obviously, the domain will never restart because it's already
running.

After this fix, the application will simply exit when the user cancels
authentication, even if the --reconnect switch is used.
2015-06-19 14:39:48 -05:00
Jonathon Jongsma
999bd67675 Automatically retry auth failures for VNC
There's no reason that we need to ask if the user wants to retry auth
failures for VNC sessions but not ask for spice sessions. If the user
doesn't want to retry, she can simply click 'cancel' when the auth
dialog pops up, just as they do with spice.
2015-06-19 14:39:48 -05:00
Jonathon Jongsma
592d8c6bb2 VNC session: emit session-cancelled signal
When the user cancells an authentication dialog (e.g. by pressing 'Esc',
emit the session-cancelled signal to be consistent with the spice
session implementation.
2015-06-19 14:39:48 -05:00
Jonathon Jongsma
be279c8388 Rename session-auth-failed to session-auth-unsupported
Now that VNC and Spice both return the same signal on normal
authentication failures ('session-auth-refused'), the
'session-auth-failed' signal is too confusingly similar. Rename it to
-unsupported to make it obvious that it's a different type of
(unrecoverable) error.
2015-06-19 14:39:48 -05:00
Jonathon Jongsma
271c51d8de Fix inconsistencies in session auth failures
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. This results in the following
inconsistent behavior:

VNC session:
 - emits a 'session-auth-failed' signal when the client does not support
   a particular authentication type (i.e.: a non-recoverable error)
Spice session:
- emits a 'session-auth-failed' signal when user enters an incorrect
  password, and immediately retries auth internally

VNC session:
 - emits a 'session-auth-refused' error when user enters an invalid
   password (i.e.: a recoverable error)
Spice Session:
- never emits a 'session-auth-refused' signal

Because of these differences, the VirtViewerApp code to handle authentication
failures is a bit confusing and difficult to maintain. To fix this issue, make
both the spice and VNC sessions emit the same signal when similar errors occur.
We use the new session API added in the last commit to determine whether the
session supports automatic retries so we know how to handle the signal.
2015-06-19 14:39:48 -05:00
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
Jonathon Jongsma
bac799c6e9 Move SpiceSession setup to create_spice_session()
Most of the setup (connecting to signals, etc) for the SpiceSession was
done in create_spice_session(), but some was done afterwards in
virt_viewer_session_spice_new(). Consolidate all session configuration
in one place.

In addition to making it easier to maintain, create_spice_session() is
also called in virt_viewer_session_spice_close(). which results in a
spice session that is configured slightly differently than the first
session created in _new(). Consolidating everything in
create_spice_session() avoids that inconsistency.
2015-06-19 14:39:47 -05:00
Daniel P. Berrange
795d499a0f Add config.h include to remote-viewer-connect.c file 2015-06-19 09:37:23 +01:00
Lukas Venhoda
0fdfd6cbfc remote-viewer-connect: Address entry is now required
Connect button is now non-sensitive when address entry is empty.
Pressing enter will now also NOT connect, when address entry is empty.
2015-06-16 14:11:00 +02:00
Lukas Venhoda
78b1fa977a remote-viewer-connect: Fixed reselecting in recent chooser
Recent chooser didn't unselect on loosing focus.
Selecting recent connection, then modifying address in entry and
doubleclicking on the same recent connection caused remote-viewer to
connect to address in the entry,

Recent chooser now unselects on loosing focus, forcing to re-select when
doubleclicking the recent connection, which will now properly set the
address to connect to.
2015-06-16 14:11:00 +02:00
Lukas Venhoda
0571843d7f remote-viewer-connect: Changed hardcoded UI into XML
Hardcoded UI removed in favor of XML.
Added the new XML file for translation.
2015-06-16 14:11:00 +02:00
Lukas Venhoda
ce31441c73 remote-viewer-connect: Changed dialog into a window
Changed connect dialog from GtkDialog to a GtkWindow.
Added the necessary signals and buttons, to keep the
behaviour of a dialog. (ESC to close, ENTER to submit)
2015-06-16 14:10:53 +02:00
Lukas Venhoda
ee785d3352 remote-viewer-connect: Check if uri is NULL
URI should be NULL before passing it to remote_viewer_connect_dialog.
2015-06-16 14:10:03 +02:00
Lukas Venhoda
e7dcc5a497 remote-viewer-connect: Changed response to gboolean
remote_viewer_connect_dialog now returns TRUE and FALSE, instead of 0 and -1.

Added a doxygen style comment to document this in code also.
2015-06-16 14:10:03 +02:00
Lukas Venhoda
f4018a8dbe remote-viewer: Connect dialog moved to its own file
Connect dialog from remote-viewer is now in its own file.
Most other dialog also have their own files.
This will make changing the dialog into a window easier.

Renamed connect_dialog to remote_viewer_connect_dialog.
2015-06-16 14:10:03 +02:00
Pavel Grunt
655f5693fd configure: Require spice-protocol 0.12.7
We are already using SPICE_CHANNEL_WEBDAV from spice/enums.h
2015-06-16 09:28:27 +02:00
Christophe Fergeau
21c71767e3 Enable hotkeys after setting them in virt_viewer_app_set_hotkeys
Enabling hotkeys will trigger a rebuild of the 'send keys' menu
containing the new hotkeys. virt_viewer_app_set_hotkeys() was clearing
and then enabling the hotkeys before parsing the string containing the
new hotkeys. This was causing these hotkeys to be missing from the 'Send
keys' menu when they are set through the spice controller because the
'send keys' menu was rebuilt before the new hotkeys are set.

Resolves: rhbz#1055600
2015-06-15 11:08:40 +02:00
Fabiano Fidêncio
9c1f0dccde nsis: Ship libwinpthread even without libvirt support
Without libwinpthread, remote-viewer complains about missing this dll,
when built using --without-libvirt
2015-06-11 14:09:16 +02:00
Sandy Stutsman
2088585143 Add InstallScope="perMachine" to virt-viewer.wxs.in
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1146016
Without this parameter the installer will place the start menu icon in the
Admin users path rather than the 'AllUsers'.  Unprivileged users are unable
to use the menu to start the remote-viewer.

N.B. Because previous installations mixed Users and PerMachine (AllUsers)
paths, this installation will *NOT* properly upgrade them.  They must be
manually uninstalled first.
2015-06-10 13:55:23 +02:00
Daniel P. Berrange
f3642a33d7 Add missing config.h header file 2015-06-10 09:32:02 +01:00
Christophe Fergeau
8884608104 vv-file: Show 'newer-version-url' when version check fails
We currently display a generic error message when the current binary is
older than the minimum version specified in the vv file. The previous
commit added a 'newer-version-url' field to these .vv file. This commit
adds that URL to the error message if it's set.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
a9967fd2f6 vv-file: Add 'newer-version-url' key to .vv files
If set, this URL will be displayed when one of the version checks
('version' of 'versions' key fail). This URL should contain explanations
about how to get an updated remote-viewer version.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
c9a6a27061 test: Add test case for virt_viewer_compare_buildid 2015-06-09 18:06:39 +02:00
Christophe Fergeau
e2df5a739a util: Replace virt_viewer_compare_version with _compare_buildid
This allows us to do a more accurate version check if the .vv file
producer wants to allow builds newer than x.y-z because they contain an
important bug fix.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
809d097cfd vv-file: Use "versions" in min version check
This tries to use the list of versions added to .vv files by the
previous commit. If remote-viewer was built with an os-id specified, and
if it's found in the 'versions' .vv file key, then the version
associated with it is used for version checks, otherwise the 'version'
field is used if present.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
1856dbfa24 Show osid in remote-viewer --version 2015-06-09 18:06:39 +02:00
Christophe Fergeau
fa805bc36c build-sys: Add --with-osid
This new configure flag allows to specify a string ID (eg fedora22,
ubuntu10.04, ..) identifying the OS this remote-viewer build will be
for. This will be used in combination with the new 'versions' field in
.vv files in order to make it possible for the creator of the .vv file
to specify which version it expects for the various OSes which may
connect.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
fd1052ad5d vv-file: Add VirtViewerFile::versions
Specifying a single minimal version in the .vv file is not enough as
the client version will be highly dependent on the OS it's running in.
Windows versioning is not the same as linux versioning, Fedora 21 and
Fedora 22 may have different release numbers for the same version,
and we may want to force a specific minimal release in case of a
critical bug fix.

This commit adds supports for a 'versions' field in .vv files where a
list of os-id:version couples can be stored.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
f94a64d759 vv-file: Refactor virt_viewer_file_check_min_version
Reorganize the code a bit so that it's easier to extend it.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
7a69a239e7 vv-file: Move version checking code in its own function
This moves the version checking code in a
virt_viewer_file_check_min_version helper so that it can be
reused/extended more easily.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
b43f4f2779 build-sys: Always prepend '-' to BUILDID
This was removed by commit 28a6bd6 as WINDOWS_PRODUCTVERSION
needs a buildid without a dash. Apart from this variable,
all other uses of buildid/BUILDID in virt-viewer source tree
need a dash between the version number and the buildid to avoid getting
output like "3.01" instead of "3.0-1"

Rather than patching every location where BUILDID is used, this commit
appends the "-" before substituting/defining BUILDID in configure.ac.
This does not modifies the buildid configure.ac variable, this way
WINDOWS_PRODUCTVERSION won't get an unwanted '-'.
2015-06-09 18:06:39 +02:00
Christophe Fergeau
0401199b9c build-sys: Don't substitute buildid when it was not set
Since it defaults to being 0, we'll get a spurious 0 on remote-viewer
--version if we AC_DEFINE/AC_SUBST it when the user did not specify it.
2015-06-09 18:06:39 +02:00
Pavel Grunt
233c61eaea monitor-mapping: Do not allow to skip a display
Skipping a display does not have an effect because displays will be
reconfigured and shifted on the guest side anyway.

these monitor mappings are not valid:
 'monitor-mapping=1:2;3:1' - display #2 is not specified
 'monitor-mapping=4:2;2:1' - displays #1, #3 are not specified
 'monitor-mapping=3:3'     - displays #1, #2 are not specified
2015-06-04 10:58:09 +02:00
Fabiano Fidêncio
ad438e0b96 session-spice: Only update displays geometry if the agent is connected 2015-06-02 17:29:03 +02:00
Lukas Venhoda
596aea6912 virt-viewer: Fix choose VM dialog alt-tab in gnome2
Choose VM dialog was not visible in taskbar and alt-tab when running on
system with gnome2.

rhbz#1223285
2015-05-21 13:06:31 +02:00
Fabiano Fidêncio
921318e42f Revert "display-vnc: fix zoom-level set by command line"
This reverts commit 68148e1bd1a47ff370c78e2569a57ae0f3d8a400.

The commit in question was causing a regression about a tiny window
being displayed when opening a vnc guest.
The issue only happens with the gtk2 version of virt-viewer.

rhbz#1170071 that was solved by the reverted commit is avoided by
the commit c45a30e909656434aa842d48d828ef038ec7364a.

Resolves: rhbz#1201679
2015-05-21 13:06:31 +02:00
Pavel Grunt
61a1bc4dcb session-vnc: Set window for display to avoid gtk-vnc v0.3.8 crash
The VNC display widget of gtk-vnc v0.3.8 needs a window at the moment
it is initialized otherwise it would crash.

Resolves: rhbz#1196517
2015-05-21 13:06:31 +02:00
Lukas Venhoda
fc2add5827 virt-viewer-display-vnc: Set uuid when using VNC
Notify user, that VNC does not provide uuid.

Set uuid to string "VNC does not provide guid".
This is more informative then just plain "Unknown".
User will now know WHY the GUID is unknown, when using remote-viewer.
2015-05-21 13:06:30 +02:00
Lukas Venhoda
772698a8a6 virt-viewer-display-vnc: Set guest name when using VNC
If it's not already set, set guest name field in virt-viewer-app when using VNC.

Wait for VNC to be initialized (virt_viewer_display_vnc_initialized()).
In this callback get field guest name from app and check whether it
was already set before (FE from libvirt).
If not, set the guest name to name provided by VNC from
vnc_display_get_name().

This fill fix issue in remote-viewer: Guest name is Unknown when using VNC.
2015-05-21 13:06:30 +02:00
Michal Privoznik
35c5f7f745 Fix syntax-check
Commit c45a30e9 broke syntax-check:

trailing_blank
src/virt-viewer-window.c:1478:
maint.mk: found trailing blank(s)
maint.mk:700: recipe for target 'sc_trailing_blank' failed
make: *** [sc_trailing_blank] Error 1

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-29 10:29:52 +02:00
Pavel Grunt
4219a7ec69 virt-viewer-window: Set initial zoom only once
It is not needed to do it more times as it may cause unnecessary resize
events especially when leaving the fullscreen mode

related: rhbz#1206460
2015-04-22 15:20:05 +02:00
Pavel Grunt
41645a0eb5 virt-viewer-window: Make sure that minimum zoom level is lower than NORMAL_ZOOM_LEVEL
The minimum size of the desktop is 100x100 if the minimum window size
is greater than this, the zoom level is greater than NORMAL_ZOOM_LEVEL

related: rhbz#1206460
2015-04-22 15:20:05 +02:00
Lukas Venhoda
82d6280e5c virt-viewer: Set toolbar buttons not sensitive when needed
File->Screenshot, File->Preferences, View->Zoom and Send keys are now
sensitive only while quest is connected.

Changed behaviour of zoom:

Previously, zoom could be set while quest wasn't connected. The zoom
would then be set on connection. There was no indication of current zoom
level while not connected to guest.

Now, the menu is not sensitive while not connected to guest. Zoom can
now be only modified while connected to guest, or from the command line.
2015-04-22 11:03:13 +02:00
Lukas Venhoda
2b7d8717f9 app/window: Set display menu not sensitive when needed
Displays menu must be sensitive only when at least one display is
enabled.
2015-04-22 10:46:02 +02:00
Fabiano Fidêncio
7a32e58f2d cosmetic: move the "break" to inside the {} block 2015-04-22 10:40:29 +02:00
Fabiano Fidêncio
64e7b604d3 spice-session: use the error message, when available, on _channel_destroy() 2015-04-22 10:40:29 +02:00
Fabiano Fidêncio
f3fe9ffe7b session-spice: Destroy the channel instead of emit a "session-disconnect" signal
Whenever we reach these branches, we will abort or have to create a new
spice session (from the dialog showed to the user). So, destroying the
channel on these situations seems sane enough.
It also avoids an error dialog to be popped out twice with (basically)
the same information.
2015-04-22 10:40:29 +02:00
Fabiano Fidêncio
98d892d811 session-spice: Do not use _UNUSED for used attributes
channel attribute is actually used for error treatment
2015-04-22 10:40:29 +02:00
Fabiano Fidêncio
70569de4d8 display: remove useless identation level 2015-04-22 10:40:29 +02:00
Jonathon Jongsma
f0c6bb27f4 SessionSpice: Protect against unreffing window twice
In theory, the dispose method can be called multiple times, so any
member variables that are unreffed should be set to NULL so that we
don't accidentally unref them multiple times.
2015-04-15 09:18:16 -05:00
Christophe Fergeau
d316c04345 build-sys: Ship mingw-virt-viewer.spec in tarballs
virt-viewer.spec is already shipped in tarballs, it's convenient to have
a pregenerated mingw-virt-viewer.spec in there as well.
2015-04-15 11:51:08 +02:00
Pavel Grunt
69a5077a8a virt-viewer-main: '--wait' should not be used without domain name
Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain
name to be placed just after the '--wait' option. It broke the
command line api, because running 'virt-viewer $vm --wait' was considered
as the error.

This patch rather checks whether the domain name was specified.

Related: rhbz#1209398, rhbz#1211573
2015-04-14 18:22:01 +02:00
Pavel Grunt
d71c2a673d Revert "virt-viewer-main: Require domain name as argument for '--wait'"
This reverts commit a830275344c88aef12166661b68ea2b4429c7212.

Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain
name to be placed just after the '--wait' option. It broke the
command line api, because running 'virt-viewer $vm --wait' was considered
as the error.

Related: rhbz#1209398, rhbz#1211573
2015-04-14 18:21:38 +02:00
Pavel Grunt
ea42d03027 Revert "man: document that '--wait' requires domain as parameter"
This reverts commit 9ba2d28a0f35b69befd26d7c122bbe4cd626422f.

Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain
name to be placed just after the '--wait' option. It broke the
command line api, because running 'virt-viewer $vm --wait' was considered
as the error.

Related: rhbz#1209398, rhbz#1211573
2015-04-14 18:21:11 +02:00
Pavel Grunt
5c95093c82 Revert "virt-viewer-main: exit when domain names doesn't match"
This reverts commit 10264d0d1ecbd67d3e59e3a1a3032936b0635eda.

Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain
name to be placed just after the '--wait' option. It broke the
command line api, because running 'virt-viewer $vm --wait' was considered
as the error.

Related: rhbz#1209398, rhbz#1211573
2015-04-14 18:20:20 +02:00
Pavel Grunt
10264d0d1e virt-viewer-main: exit when domain names doesn't match
Since the domain name is required as a parameter for the '--wait'
option (commit a830275344c88aef12166661b68ea2b4429c7212 ), it is
neccessary to check whether all domains names are the same. Otherwise
it wouldn't be clear which name should be used.

related: rhbz#1211573
2015-04-14 15:05:11 +02:00
Pavel Grunt
9ba2d28a0f man: document that '--wait' requires domain as parameter
related: rhbz#1211573
2015-04-14 15:05:11 +02:00
Pavel Grunt
5fa7ef636e man: document usage of domain name as optional
related: rhbz#1211573
2015-04-14 15:05:11 +02:00
Pavel Grunt
0443bd113f ovirt: Allow to cancel authentication without showing error dialog
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1201604
2015-04-14 15:03:48 +02:00
Christophe Fergeau
0c8f07ea64 ovirt: Add support for an 'admin' key in vv file
When using a user with administrator rights, the VMs this user can
access from the user portal and the admin portal are different, and
REST API users must indicate which set of VMs they want through a
specific header. libgovirt already has support for that in its API, but
virt-viewer was not making use of that API.
This commit adds support for an 'admin' field in the [ovirt] section of
.vv files so oVirt can indicate remote-viewer whether this header should
be set or not.
2015-04-09 11:34:48 +02:00
Pavel Grunt
07def4d4aa virt-viewer-app: Do not show error dialog twice for unknown graphic
Related: rhbz#1085216
2015-04-09 10:49:47 +02:00
Jonathon Jongsma
c543941a17 Cleanup: only add display when it's created
This wasn't causing any problems because the _add_display() function has
an early return for the case that the display has already been added to
the session, but it's quite confusing when reading the code to see this
_add_display() function being called for every display every time we get
a monitor configuration update.
2015-04-09 10:47:57 +02:00
Jonathon Jongsma
7ddbd28756 Emit one show-hint notification when enabling a display
Freeze notifications before setting the show hints to prevent multiple
notification signals from being emitted.
2015-04-09 10:47:57 +02:00
Pavel Grunt
3109799475 display-spice: Do not ignore change of position
Positions of displays can be changed by guest, it is important to
react to this change by rearranging client's windows otherwise
mouse actions can be assigned to a wrong window.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206216
2015-04-09 10:47:57 +02:00
Pavel Grunt
01249f7032 virt-viewer-window: Return early when zoom of window and zoom of display are same
The zoom level should be changed when zoom levels of the window and
the display are different. It is wrong to check the previous value of
the window because it could be set just for the window and not for
the display (e.g. when setting zoom level using the command line).

Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
2015-04-09 10:47:57 +02:00
Pavel Grunt
998b13c881 virt-viewer-window: Set zoom when display is enabled and ready.
The display has default dimensions (100x100) when it is disabled.
Calculating the minimal zoom for the display will give wrong value
for the newly opened display.

It is better to wait for setting the zoom level to the moment when
the display is enabled and ready.

Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
2015-04-09 10:47:57 +02:00
Pavel Grunt
a830275344 virt-viewer-main: Require domain name as argument for '--wait'
As since 88f634179e56742a21fb4c7efc270e4203322d74 virt-viewer can be
used without a domain-name, let's require it when using --wait.

Resolves: rhbz#1209398
2015-04-07 12:32:02 +02:00
Christophe Fergeau
8f5c9969f3 Fix leak in virt_viewer_session_spice_clear_displays()
The GList returned by spice_session_get_channels() must be freed after
use.
2015-04-07 12:30:39 +02:00
Fabiano Fidêncio
26c2eccd96 Fix crash when disabling last enabled display
Using virt_viewer_signal_connect_object() instead of g_signal_connect()
ensures that menu_display_visible_toggled_cb() won't be executed after
the display object be disposed.

Backtrace for the crash:

 #0  0x00007ffff070592b in g_type_check_instance_is_a (type_instance=0x8851f0, iface_type=<optimized out>) at gtype.c:4016
 #1  0x000000000041ee06 in virt_viewer_display_get_session (self=0x8851f0) at ../../src/virt-viewer-display.c:702
 #2  0x0000000000417be7 in menu_display_visible_toggled_cb (checkmenuitem=0x93f790 [GtkCheckMenuItem], display=0x8851f0) at ../../src/virt-viewer-app.c:2187
 #6  0x00007ffff06fe29f in <emit signal ??? on instance 0x93f790 [GtkCheckMenuItem]> (instance=instance@entry=0x93f790, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3361
 #3  0x00007ffff06e3b9f in g_closure_invoke (closure=0x93faa0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fffffffc230, invocation_hint=invocation_hint@entry=0x7fffffffc1b0) at gclosure.c:768
 #4  0x00007ffff06f54c9 in signal_emit_unlocked_R (node=node@entry=0x6d73e0, detail=detail@entry=0, instance=instance@entry=0x93f790, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc230) at gsignal.c:3549
 #5  0x00007ffff06fded0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc3f0) at gsignal.c:3305
 #7  0x00007ffff5eb6158 in gtk_check_menu_item_activate (check_menu_item=0x93f790 [GtkCheckMenuItem]) at gtkcheckmenuitem.c:299
 #8  0x00007ffff5eb6158 in gtk_check_menu_item_activate (menu_item=0x93f790 [GtkCheckMenuItem]) at gtkcheckmenuitem.c:419
 #12 0x00007ffff06fe29f in <emit signal ??? on instance 0x93f790 [GtkCheckMenuItem]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3361
 #9  0x00007ffff06e3b9f in g_closure_invoke (closure=closure@entry=0x6d5aa0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fffffffc6b0, invocation_hint=invocation_hint@entry=0x7fffffffc630) at gclosure.c:768
 #10 0x00007ffff06f51bd in signal_emit_unlocked_R (node=node@entry=0x6d5ba0, detail=detail@entry=0, instance=instance@entry=0x93f790, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc6b0) at gsignal.c:3479
 #11 0x00007ffff06fded0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc870) at gsignal.c:3305
 #13 0x0000000000417c5e in menu_display_visible_toggled_cb (checkmenuitem=0x93f790 [GtkCheckMenuItem], display=0x8851f0) at ../../src/virt-viewer-app.c:2200
 #17 0x00007ffff06fe29f in <emit signal ??? on instance 0x93f790 [GtkCheckMenuItem]> (instance=instance@entry=0x93f790, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3361
 #14 0x00007ffff06e3c45 in g_closure_invoke (closure=0x93faa0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fffffffcb50, invocation_hint=invocation_hint@entry=0x7fffffffcad0) at gclosure.c:768
 #15 0x00007ffff06f54c9 in signal_emit_unlocked_R (node=node@entry=0x6d73e0, detail=detail@entry=0, instance=instance@entry=0x93f790, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcb50) at gsignal.c:3549
 #16 0x00007ffff06fded0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffcd10) at gsignal.c:3305
 #18 0x00007ffff5eb6158 in gtk_check_menu_item_activate (check_menu_item=0x93f790 [GtkCheckMenuItem]) at gtkcheckmenuitem.c:299
 #19 0x00007ffff5eb6158 in gtk_check_menu_item_activate (menu_item=0x93f790 [GtkCheckMenuItem]) at gtkcheckmenuitem.c:419
 #23 0x00007ffff06fe29f in <emit signal ??? on instance 0x93f790 [GtkCheckMenuItem]> (instance=instance@entry=0x93f790, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3361
 #20 0x00007ffff06e3c45 in g_closure_invoke (closure=closure@entry=0x6d5aa0, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7fffffffcfd0, invocation_hint=invocation_hint@entry=0x7fffffffcf50) at gclosure.c:768
 #21 0x00007ffff06f51bd in signal_emit_unlocked_R (node=node@entry=0x6d5ba0, detail=detail@entry=0, instance=instance@entry=0x93f790, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcfd0) at gsignal.c:3479
 #22 0x00007ffff06fded0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd190) at gsignal.c:3305
 #24 0x00007ffff608648e in IA__gtk_widget_activate (widget=widget@entry=0x93f790 [GtkCheckMenuItem]) at gtkwidget.c:5048
 #25 0x00007ffff5f6cacd in IA__gtk_menu_shell_activate_item (menu_shell=0x70ece0 [GtkMenu], menu_item=0x93f790 [GtkCheckMenuItem], force_deactivate=<optimized out>) at gtkmenushell.c:1303
 #26 0x00007ffff5f6ce96 in gtk_menu_shell_button_release (widget=0x70ece0 [GtkMenu], event=<optimized out>) at gtkmenushell.c:730
 #31 0x00007ffff06fe29f in <emit signal ??? on instance 0x70ece0 [GtkMenu]> (instance=instance@entry=0x70ece0, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3361
 #27 0x00007ffff5f578ad in _gtk_marshal_BOOLEAN__BOXED (closure=0x6c7180, return_value=0x7fffffffd4e0, n_param_values=<optimized out>, param_values=0x7fffffffd540, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gtkmarshalers.c:86
 #28 0x00007ffff06e3c45 in g_closure_invoke (closure=closure@entry=0x6c7180, return_value=return_value@entry=0x7fffffffd4e0, n_param_values=2, param_values=param_values@entry=0x7fffffffd540, invocation_hint=invocation_hint@entry=0x7fffffffd4c0) at gclosure.c:768
 #29 0x00007ffff06f5cef in signal_emit_unlocked_R (node=node@entry=0x6c73f0, detail=detail@entry=0, instance=instance@entry=0x70ece0, emission_return=emission_return@entry=0x7fffffffd660, instance_and_params=instance_and_params@entry=0x7fffffffd540) at gsignal.c:3587
 #30 0x00007ffff06fdac2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd710) at gsignal.c:3315
 #32 0x00007ffff608790c in gtk_widget_event_internal (widget=widget@entry=0x70ece0 [GtkMenu], event=event@entry=0x944f90) at gtkwidget.c:5017
 #33 0x00007ffff6087be7 in IA__gtk_widget_event (widget=widget@entry=0x70ece0 [GtkMenu], event=event@entry=0x944f90) at gtkwidget.c:4814
 #34 0x00007ffff5f55b94 in IA__gtk_propagate_event (widget=0x70ece0 [GtkMenu], event=0x944f90) at gtkmain.c:2501
 #35 0x00007ffff5f55f5b in IA__gtk_main_do_event (event=0x944f90) at gtkmain.c:1696
 #36 0x00007ffff5bae7dc in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkevents-x11.c:2425
 #37 0x00007ffff03e40ba in g_main_context_dispatch (context=0x693d50) at gmain.c:3122
 #38 0x00007ffff03e40ba in g_main_context_dispatch (context=context@entry=0x693d50) at gmain.c:3737
 #39 0x00007ffff03e4450 in g_main_context_iterate (context=0x693d50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
 #40 0x00007ffff03e4772 in g_main_loop_run (loop=0x748980) at gmain.c:4002
2015-04-03 01:13:48 +02:00
Pavel Grunt
6c8ec50c15 session-spice: Remove spice-gtk version checks
Since 77ac0d8892837a117f9ca10020c1ac7f1944fca7 virt-viewer requires
spice-gtk v0.28
2015-04-02 09:21:32 +02:00
Pavel Grunt
a66a8fbc92 virt-viewer-app: Set hotkeys when app is constructed
virt_viewer_app_set_hotkeys() calls virt_viewer_app_set_enable_accel()
which notify the display about "enable-accel". However the display
begins to exist after the virt_viewer_app initialization.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206106
2015-04-02 09:21:32 +02:00
Pavel Grunt
c45a30e909 virt-viewer-window: Change zoom of the display only when it is possible
Do not allow to zoom out if it is not possible due to the width of
the top menu. It avoids emitting size allocation events that will
change the display resolution of the spice guest.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
2015-04-02 09:21:32 +02:00
Pavel Grunt
5d4d1fe54c virt-viewer-window: Return NULL instead of FALSE for display 2015-04-02 09:21:32 +02:00
Pavel Grunt
0b653558ad virt-viewer-display: Use MIN_DISPLAY_WIDTH/HEIGHT instead of numbers 2015-04-02 09:21:32 +02:00
Pavel Grunt
2e5ae1550f Use ZOOM constants instead of numbers 2015-04-02 09:21:31 +02:00
Christophe Fergeau
30b7e299b0 Fix virt-viewer --reconnect crash with SPICE VMs
When using virt-viewer --reconnect, virt-viewer currently crashes when
a SPICE VM is destroyed with "virsh destroy"

What happens is that when the guest is destroyed, virt-viewer receives a
SPICE_CHANNEL_ERROR_IO notification in
virt_viewer_session_spice_main_channel_event().  This triggers the
emission of the "session-disconnected" signal, which will end up calling
spice_session_disconnect() (indirectly through
virt_viewer_app_disconnected/virt_viewer_app_deactivate).

Since spice-gtk commit ff25f3e, the actual session disconnection is
done from an idle.  When the "session-disconnected" emission stops, the
VirtViewerSession instance is destroyed. However, the associated
VirtViewerDisplaySpice are still alive as the various SpiceChannels
instances hold a reference through the "virt-viewer-displays" GObject
data.
These channels are destroyed when the idle queued by spice_session_disconnect()
run. The associated VirtViewerDisplay are in turn destroyed too, but
this causes attempts to use the VirtViewerSession associated with the
displays, which has already been destroyed. This causes a crash.

This commit adds a virt_viewer_session_spice_clear_displays() which is
similar to virt_viewer_session_clear_displays(), but makes sure the
"virt-viewer-displays" references are dropped too. This ensures the
VirtViewerDisplay instances don't outlive the VirtViewerSession
they are associated with.

Backtrace for the crash:

 #0  0x0000000000413f0f in display_show_hint (display=0x85ab50 [VirtViewerDisplaySpice], pspec=0x939bd0 [GParamFlags], user_data=0x0) at virt-viewer-app.c:949
 #4  0x00000031ff22a29f in <emit signal notify:show-hint on instance 0x85ab50 [VirtViewerDisplaySpice]> (instance=instance@entry=0x85ab50, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3361
     #1  0x00000031ff20fc45 in g_closure_invoke (closure=0xa98f50, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffc700, invocation_hint=invocation_hint@entry=0x7fffffffc680) at gclosure.c:768
     #2  0x00000031ff2214c9 in signal_emit_unlocked_R (node=node@entry=0x674f80, detail=detail@entry=1678, instance=instance@entry=0x85ab50, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc700) at gsignal.c:3549
     #3  0x00000031ff229ed0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc8d0) at gsignal.c:3305
 #5  0x00000031ff214175 in g_object_dispatch_properties_changed (object=0x85ab50 [VirtViewerDisplaySpice], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1056
 #6  0x00000031ff216661 in g_object_notify (pspec=0x939bd0 [GParamFlags], object=0x85ab50 [VirtViewerDisplaySpice]) at gobject.c:1149
 #7  0x00000031ff216661 in g_object_notify (object=0x85ab50 [VirtViewerDisplaySpice], property_name=<optimized out>) at gobject.c:1197
 #8  0x000000000041e5ab in virt_viewer_display_set_show_hint (self=0x85ab50 [VirtViewerDisplaySpice], mask=1, enable=0) at virt-viewer-display.c:691
 #9  0x000000000042b62d in update_display_ready (self=0x85ab50 [VirtViewerDisplaySpice])
     at virt-viewer-display-spice.c:145
 #13 0x00000031ff22a29f in <emit signal notify:ready on instance 0x898590 [SpiceDisplay]> (instance=instance@entry=0x898590, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3361
     #10 0x00000031ff20fc45 in g_closure_invoke (closure=0x99b280, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffcc50, invocation_hint=invocation_hint@entry=0x7fffffffcbd0) at gclosure.c:768
     #11 0x00000031ff2214c9 in signal_emit_unlocked_R (node=node@entry=0x674f80, detail=detail@entry=1696, instance=instance@entry=0x898590, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcc50) at gsignal.c:3549
     #12 0x00000031ff229ed0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffce20) at gsignal.c:3305
 #14 0x00000031ff214175 in g_object_dispatch_properties_changed (object=0x898590 [SpiceDisplay], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1056
 #15 0x00000031ff216661 in g_object_notify (pspec=0xa83370 [GParamBoolean], object=0x898590 [SpiceDisplay]) at gobject.c:1149
 #16 0x00000031ff216661 in g_object_notify (object=0x898590 [SpiceDisplay], property_name=<optimized out>) at gobject.c:1197
 #17 0x00007ffff7522525 in update_ready (display=0x898590 [SpiceDisplay]) at spice-widget.c:236
 #18 0x00007ffff752257e in set_monitor_ready (self=0x898590 [SpiceDisplay], ready=0)
     at spice-widget.c:244
 #19 0x00007ffff75274e6 in primary_destroy (channel=0x89f5c0 [SpiceDisplayChannel], data=0x898590)
     at spice-widget.c:2169
 #20 0x00007ffff7528918 in channel_destroy (s=0x909fa0 [SpiceSession], channel=0x89f5c0 [SpiceDisplayChannel], data=0x898590) at spice-widget.c:2484
 #24 0x00000031ff22a29f in <emit signal ??? on instance 0x909fa0 [SpiceSession]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3361
     #21 0x00000031ff20fc45 in g_closure_invoke (closure=0xa9bda0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffd280, invocation_hint=invocation_hint@entry=0x7fffffffd200) at gclosure.c:768
     #22 0x00000031ff2214c9 in signal_emit_unlocked_R (node=node@entry=0x9c17d0, detail=detail@entry=0, instance=instance@entry=0x909fa0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd280) at gsignal.c:3549
     #23 0x00000031ff229ed0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd450) at gsignal.c:3305
 #25 0x00007ffff71c3248 in spice_session_channel_destroy (session=0x909fa0 [SpiceSession], channel=0x89f5c0 [SpiceDisplayChannel]) at spice-session.c:2217
 #26 0x00007ffff71bd8b2 in session_disconnect (self=0x909fa0 [SpiceSession], keep_main=0)
     at spice-session.c:281
 #27 0x00007ffff71c1b27 in session_disconnect_idle (self=0x909fa0 [SpiceSession]) at spice-session.c:1853
 #28 0x00000031fee4a0ba in g_main_context_dispatch (context=0x6a4400) at gmain.c:3122
 #29 0x00000031fee4a0ba in g_main_context_dispatch (context=context@entry=0x6a4400) at gmain.c:3737
 #30 0x00000031fee4a450 in g_main_context_iterate (context=0x6a4400, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
 #31 0x00000031fee4a772 in g_main_loop_run (loop=0x9890f0) at gmain.c:4002
 #32 0x0000003babc05f75 in gtk_main () at gtkmain.c:1219
 #33 0x000000000043143b in main (argc=1, argv=0x7fffffffda48) at virt-viewer-main.c:12
2015-04-01 14:27:57 +02:00
Fabiano Fidêncio
69dcde3c89 virt-viewer: Make update_display() more readable 2015-03-27 16:53:44 +01:00
Fabiano Fidêncio
dc2dd055d4 virt-viewer: Do not wait for a guest that will never show up
All the situations where virt_viewer_update_display() can fail are
those when we won't be able to connect regardless of what changes on the
remote host. So, propagate the error instead of waiting for the guest to
start.

Related: rhbz#1085216
2015-03-27 16:52:54 +01:00
Fabiano Fidêncio
f580f1ea54 remote-viewer: Avoid simple_message_dialog() when errors can be propagated
Remove the dialog used to report errors when create_session() fails,
propagating the error is enough and it is already done.

Related: rhbz#1085216
2015-03-27 16:49:53 +01:00
Fabiano Fidêncio
ffe19f6ece virt-viewer: Avoid simple_message_dialog() when errors can be propagated
Remove all the dialogs used to report errors on extract_connect_info()
and just propagate the errors we got from it.
The only exception is virt_viewer_domain_event(), that is a callback
that doesn't have GError as argument. In this specific case, we show the
error dialog instead of propagating it.

Related: rhbz#1085216
2015-03-27 16:48:31 +01:00
Fabiano Fidêncio
f1204f0e69 virt-viewer-app: create_session() should return a boolean
By convention functions that take GError parameters should return FALSE
(or NULL) or error.

Related: rhbz#1085216
2015-03-27 16:35:35 +01:00
Fabiano Fidêncio
f9c4a03bd7 virt-viewer-app: Add a GError arg to create_session()
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).

Related: rhbz#1085216
2015-03-27 16:12:58 +01:00
Fabiano Fidêncio
cab8f7450b virt-viewer: Add a GError arg to update_display()
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).

Related: rhbz#1085216
2015-03-27 16:06:27 +01:00
Fabiano Fidêncio
2c03eacc2d virt-viewer: Add a GError arg to extract_connect_info()
This is part of a small re-factoring that will have all connection
errors, when we won't be able to connect regardless of what changes on
the remote host, being treated by virt_viewer_app_initial_connect(),
avoiding weird behaviors as we have nowadays (like more than one error
dialog being shown or having the virt-viewer waiting forever for a guest
that will never show up).

Related: rhbz#1085216
2015-03-27 16:05:05 +01:00
Fabiano Fidêncio
e212514b13 Do not use comments that are not in English 2015-03-26 14:26:05 +01:00
Pavel Grunt
66afac53b6 virt-viewer: Clean up if no vm was chosen
It is safe to clean up when running virt-viewer without specifying
vm name if no vm was chosen. It brings back behavior before 88f6341.

The 'if (dom == NULL && err != NULL)' part was affected by commits
824c4b9, 1eaaf8c, 15c7d17 so the check for 'err' is not needed anymore.
2015-03-24 08:04:19 +01:00
Pavel Grunt
1a619f2383 Report errors in one place
Since the error is propagated to the main, report the error there.
To make it work GError VIRT_VIEWER_ERROR_FAILED is set for all
failing states and it is reported using virt_viewer_app_simple_message_dialog().
2015-03-23 19:32:02 +01:00
Pavel Grunt
526e882368 Clear GError in cleanup section 2015-03-23 19:32:02 +01:00
Pavel Grunt
1bcd8d0fe6 Exit normally when canceling dialog
This applies for:
 libvirt authentication dialog (e.g. virt-viewer --attach guest)
 'recent connection' dialog (e.g. remote-viewer)
 'vm choose' dialog when connecting without specifying the vm name

This is done by using a new GError VIRT_VIEWER_ERROR_CANCELLED.
2015-03-23 19:32:02 +01:00
Pavel Grunt
aec2248cf8 virt-viewer: Bring back debug log about nonexistent guest
Although commit 88f6341 allowed to use virt-viewer with a wrong guest name,
the user is informed about the nonexistent guest only by a dialog showing
the list of running machines or informing about the connection error.

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1201177
2015-03-23 19:32:02 +01:00
Jonathon Jongsma
c586dc8c2b Monitor config at sometimes leaves additional monitors enabled
When using the configuration file to specify which remote monitors should be
enabled when using the --full-screen option, it sometimes left additional
displays enabled, or didn't place the displays on the right monitor, or didn't
fullscreen them.

This was especially true when not enabling the first display on the remote
host. For example:

  monitor-mapping=2:2;3:3

(note that configuration file uses 1-based indexes, rather than 0-based
indexes, so the numbers used below will be 1 less than those above)

Previously, when performing fullscreen auto-conf, we were configuring displays
starting at #0 and ending at ndisplays. So for the previous configuration, we
looped from i = 0 to i < 2 (i.e. display #0 and #1) even though we should have
configured display #1 and #2. After this fix, we configure the exact displays
that were specified in the monitor-mapping configuration.

Resolves: rhbz#1200750
2015-03-23 10:15:03 -05:00
Jonathon Jongsma
b368761ea1 Use 'constructed' vfunc instead of 'constructor'
We don't need the added complexity of 'constructor', since we only want
to do some final initializing after all of the properties have been set,
etc. So just use the simpler 'constructed'.
2015-03-23 10:11:51 -05:00
Jonathon Jongsma
3b8be76459 VirtViewerApp: create main window after constructor
When using the configuration file to specify which remote monitors
should be enabled when using the --full-screen option, it sometimes left
additional displays enabled, or didn't place the displays on the right
monitor, or didn't fullscreen them.

Part of the problem was that we were creating the first display window before
loading the monitor mapping configuration from the settings file. So even if
the first display was disabled in the configuration, the first window will
still be created with an id of 0, and therefore didn't get set to fullscreen.
Moving the main window creation to the 'constructor' vfunc instead of the
object init func ensures that the configuration is all loaded before we attempt
to do any fullscreen autoconf.

Related: rhbz#1200750
2015-03-23 10:10:07 -05:00
Fabiano Fidêncio
4de3379f34 Update geometry when enabling/disabling displays
_update_displays_geometry() must be called every time a display is
enabled/disabled, avoiding gaps (when a display is disabled) or overlaps
(when a display is enabled) between the monitors.

This is what happens when we have 3 displays enabled (each one
represented by: width x height + x position + y position) ...

  Display #0       Display #1         Display #2
 +---------+      +----------+       +---------+
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 +---------+      +----------+       +---------+
(680x804+0+0)   (504x804+680+0)    (408x804+1184+0)

Whether the Display #1 is disable, a message will be sent down to the
vdagent, representing the new arrangement of the monitors:

  Display #0     Display #2
 +---------+     +---------+
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 +---------+     +---------+
(680x804+0+0)  (408x804+1184+0)

However, taking a look on the x position, a gap can be identified as
Display #0 starts at position (0,0) and has 680 pixels of width. But
Display #1 only starts at position (1184, 0), leaving 504 pixels as a
gap. The proper message, however, should represent the following
arrangement ...

  Display #0       Display #2
 +---------+      +---------+
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 +---------+      +---------+
(680x804+0+0)   (408x804+680+0)

... avoiding then gaps and overlaps.

Resolves: rhbz#1111425
https://bugzilla.redhat.com/show_bug.cgi?id=1111425
2015-03-16 20:54:05 +01:00
Christophe Fergeau
1e63a40014 Deal with NULL gport in virt_viewer_app_set_connect_info()
virt_viewer_app_set_connect_info() has a debug statement printing
gport/gtlsport. It checks that gtlsport is not NULL before printing it,
but makes no similar check for gport. Since it's possible to get a NULL
gport when using ovirt:// after the previous commit, it's better to check
it too.
2015-03-13 15:51:58 +01:00
Christophe Fergeau
1eafd0407e ovirt: Don't try to use invalid port numbers
If a remote oVirt VM don't specify a port/secure port number, we'd still
try to pass it down to spice-gtk, which would then complain that 0 (the
default value) isn't a valid port number.
This commit make sure we filter out the default port/secure-port value
and pass NULL to spice-gtk instead when we get these values.
2015-03-13 15:51:58 +01:00
Christophe Fergeau
32d0ae09b8 foreign-menu: Don't show empty foreign menu on secondary displays
When using ovirt://, the foreign menu will only be shown in the primary
window after getting notified about OvirtForeignMenu::files (ie when
it managed to fetch some ISO files to show in the foreign menu).

However, for secondary windows, the foreign menu will be added to the
window even if there are no files to show. This commit makes sure we
destroy the window foreign menu whenever it would be empty.
2015-03-13 15:51:58 +01:00
Fabiano Fidêncio
f2967d0d88 POTFILES: Add virt-viewer-preferences.xml
The file was introduced in commit
73b80ba99fb80140cadd07bbbf09a412bb9a0098
2015-03-12 18:09:28 +01:00
Fabiano Fidêncio
d366f20180 spec: Add virt-viewer-preferences.xml
The file was introduced in commit
73b80ba99fb80140cadd07bbbf09a412bb9a0098
2015-03-12 18:09:28 +01:00
Christophe Fergeau
ccafa32fe0 ovirt: Fail gracefully when hostname is missing
When parsing info returned by oVirt REST API, the hostname should be
present. However, I recently run remote-viewer against a buggy oVirt
instance where the hostname was missing. This commit handles better this
situation by displaying an error message and exiting.
2015-03-12 17:48:36 +01:00
Christophe Fergeau
f9577b9197 ovirt: Take into account SPICE proxy
VMs managed by oVirt can be hidden behind a proxy. This commit allows
remote-viewer to make use of this information when it's available
A recent oVirt instance is needed so that it's available through the
REST API, as well as libgovirt 0.3.3 or newer.
With older oVirt/libgovirt versions, the worst that can happen is a
runtime warning in the console, and an impossibility to connect to VMs
behind a proxy, so this commit is not raising the minimum libgovirt
requirement.
2015-03-12 17:48:22 +01:00
Fabiano Fidêncio
21306d13f9 Take --direct into consideration when checking if a guest is reachable
When connecting to a remote host (using qemu+ssh://...) that has a
virtual machine listening to "127.0.0.1", virt_viewer_is_reachable() must
take --direct into account, otherwise it can end up connecting to a local
virtual machine listening to "0.0.0.0" instead of returning that the
guest is not reachable.

Resolves: rhbz#1085216
2015-03-12 01:54:30 +01:00
Fabiano Fidêncio
3d5a295354 Add G_SOURCE_REMOVE to vir-glib-compat
G_SOURCE_REMOVE was introduced in GLib 2.32 and has its value defined as
FALSE.
2015-03-11 11:52:43 +01:00
Fabiano Fidêncio
fa952ad9b2 Avoid 'Dereference of a null pointer'
Caught by Covscan.
2015-03-11 11:52:43 +01:00
Marc-André Lureau
618e22d71a Enable share folder widgets if supported by session 2015-03-05 21:31:31 +01: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
7254b0256a Sync preferences widgets with session properties 2015-03-05 21:31:31 +01:00
Marc-André Lureau
31b23e7f0a Show preferences dialog
Add a menu item Preferences under File and show the preferences dialog
2015-03-05 21:31:31 +01:00
Marc-André Lureau
73b80ba99f Add preferences dialog UI file 2015-03-05 21:31:30 +01:00
Marc-André Lureau
e426599d86 spice: enable/disable share folder
Connect/disconnect webdav channel to enable or disable sharing folder
2015-03-05 21:31:26 +01:00
Marc-André Lureau
73f70899e4 spice: sync share folder preferences with session 2015-03-04 16:39:14 +01:00
Marc-André Lureau
77ac0d8892 Bump spice-gtk to 0.28
The following patches will only work with spice-gtk >= 0.28.
2015-03-04 16:39:14 +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
Marc-André Lureau
5d0771f704 misc: add a missing "static" for function 2015-03-04 16:39:14 +01:00
Daniel P. Berrange
f627630086 Switch over to use zanata for managing translations
Push new pot with

  cd po
  make virt-viewer.pot
  zanata push

Pull new translations with

  cd po
  zanata pull

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-02-23 13:21:12 +00:00
Pavel Grunt
45c6fc9b06 Do not add "https://" and "/api" to oVirt URI
It is deprecated since govirt 0.3.1 (and virt-viewer already depends on
govirt 0.3.2).

Silences:
(remote-viewer:19420): libgovirt-WARNING **: Passing a full http:// or https:// URI to ovirt_proxy_new() is deprecated
(remote-viewer:19420): libgovirt-WARNING **: Passing an URI ending in /api to ovirt_proxy_new() is deprecated
2015-02-18 14:07:50 +01:00
Daniel P. Berrange
a7d62c285a Bump release to 3.0 for next dev cycle 2015-01-12 18:01:35 +00:00
Daniel P. Berrange
ddd9bba0b5 Update NEWS for 2.0 release 2015-01-12 17:39:20 +00:00
Marc-André Lureau
668c52775f wixl: use a versionized installation directory
It turned out that not only the current MSI broke the "component rule",
but also that our files are not versionized correctly. Windows Installer
applies some file versioning rules before replacing a file
http://msdn.microsoft.com/en-us/library/aa368599%28v=vs.85%29.aspx

Since msitools doesn't extract version from files and populate the Version
field of the File table, it "usually" keep the current file installed.

It's practically impossible to rely on version information from
files (from a quick look, only 5% of the files are versionized and even
less correctly, libgcrypt seems to do non-monotonic buildid for example)

So the rule that applies when files are not versionized is to check the
file hash, and the modified date. File hash was added recently in
msitools, but doesn't apply when the installed file itself has a
version.

In order to solve the above problems, it's simpler to just have a
different installation prefix. Windows Installer will see files with
different component guid, and won't be checking any file update rule.  I
have verified the upgrade is working, not leaving any file behind and
updating registry correctly with this solution. Until the files are
correctly versionized, it looks like the only sensible thing to
do. Furthermore, this make it simpler to have several versions installed
in parallel later on (when we change productid)
2015-01-12 17:04:46 +00:00
Daniel P. Berrange
29f2d8a8e8 Update LINGUAS file from translation refresh 2015-01-12 11:29:33 +00:00
Daniel P. Berrange
625677c589 Tweak autobuild.sh to facilitate release builds 2015-01-12 11:27:56 +00:00
Daniel P. Berrange
675e47f0b4 Refresh translations from transifex 2015-01-12 11:25:52 +00:00
Daniel P. Berrange
a2a38b2721 Add deps on mingw glib-networking RPMs needed by libsoup 2015-01-09 11:13:30 +00:00
Daniel P. Berrange
d7e524fa75 Update mingw RPM deps to refer to gstreamer1 2015-01-09 10:51:45 +00:00
Daniel P. Berrange
83d0ea485e Fix typo s/SPICE_GTK3_REQUIRED/SPICE_GTK_REQUIRED/
There is no separate version constant for SPICE GTK2 vs GTK3
2015-01-08 18:05:53 +00:00
Fabiano Fidêncio
a51c70771a virt-viewer: set transient parent for connection's error dialog
Commit c3d24f8b sets transient parent for the most part of the
GtkDialogs, but seems like this one was forgotten.
2015-01-08 16:13:35 +01:00
Christophe Fergeau
5a07c59e8f virt-viewer: Don't connect to localhost displays with qemu+tcp://
When connecting to a remote libvirt instance, a VM may only be listening
on localhost for SPICE/VNC connections. In such a situation, virt-viewer
then tries to connect to localhost, which is not correct as this
'localhost' referred to the remote libvirt host it connected to.
This commit adds a couple of tests on the libvirt URI used and the
<graphics> listen address to error out in this situation.

Resolves: rhbz#1108523
2015-01-06 15:38:09 -06:00
Jonathon Jongsma
c2eb85c712 Remove 'map' handler for VirtViewerDisplay
In order to solve several problems with sizing and resizing displays, a
'map' handler was added to VirtViewerDisplay. The first time the map
handler runs, its queues a resize to attempt to ensure that the window
gets created at its desired size. Subsequent map events generate a call
to _make_resizable(), which was an attempt to ensure that the window was
always 'shrinkable' on the Microsoft Windows platform. Recent testing
suggests that this _make_resizable() is not actually necessary on
Windows anymore, since it is possible to shrink the display even when
this call is removed.

In addition, the call to _queue_resize() is a bit of an indirect
solution to the problem of ensuring the proper size at startup. What we
really want is to guarantee that the very first size request negotiation
returns the desired size rather than the minimum size. In order to do
this, we've added a flag to determine whether we've ever received a size
request, and if not, we return our desired size, even if 'dirty' is not
set.
2015-01-06 09:13:50 -06:00
Fabiano Fidêncio
f05f30d7de spec: Update mingw in order to use gstreamer1 2015-01-05 23:28:26 +01:00
Victor Toso
3bbf1ded1c nsis: use gstreamer-1.0 instead of gstreamer-0.10
Spice-gtk now is able to use gstreamer-1.0 for playback and record
audio. This patch updates the installer to use the latest version.
2015-01-05 23:28:26 +01:00
Christophe Fergeau
719352e608 win: Use correct format string for intptr_t
Using %d as a format-specifier for intptr_t causes a warning with
mingw64:
virt-viewer-events.c: In function 'virt_viewer_events_add_handle':
virt-viewer-events.c:103:5: warning: format '%d' expects argument of
type 'int', but argument 5 has type 'intptr_t' [-Wformat=]
     g_debug("Converted fd %d to handle %d", fd, _get_osfhandle(fd));
2015-01-02 13:49:05 +01:00
Fabiano Fidêncio
ca1dac5ba9 spec: Update mingw in order to use ovirt 2014-12-23 00:57:44 +01:00
Fabiano Fidêncio
25a236473a spec: Update mingw in order to use gtk3 2014-12-23 00:55:58 +01:00
Fabiano Fidêncio
2cbfd08b09 nsis: use gtk-vnc conditionally
Only include gtk-vnc as dep when it's explicitly done in the configure.
2014-12-23 00:42:05 +01:00
Fabiano Fidêncio
c7cbf57efc nsis: use spice-gtk conditionally
Only include spice-gtk as dep when it's explicitly done in the configure.
2014-12-23 00:42:05 +01:00
Fabiano Fidêncio
979eab69f2 nsis: use libgovirt conditionally
Only include libgovirt as dep when it's explicitly done in the configure.
2014-12-23 00:42:02 +01:00
Fabiano Fidêncio
6baccb2b78 nsis: add missing file needed to use virsh.exe 2014-12-23 00:40:37 +01:00
Fabiano Fidêncio
5159956305 nsis: use libvirt conditionally
Only include libvirt as dep when it's explicitly done in the configure.
2014-12-23 00:40:05 +01:00
Fabiano Fidêncio
de700d09ef msi: use gtk-vnc conditionally
Only include gtk-vnc as dep when it's explicitly done in the configure.
2014-12-21 22:52:49 +01:00
Fabiano Fidêncio
57c4ebcaad msi: use spice-gtk conditionally
Only include spice-gtk as dep when it's explicitly done in the configure.
2014-12-21 22:50:06 +01:00
Fabiano Fidêncio
b8b64e67dc msi: use libgovirt conditionally
Only include libgovirt as dep when it's explicitly done in the configure.
2014-12-21 22:47:56 +01:00
Fabiano Fidêncio
befd4608e4 msi: use libvirt conditionally
Only include libvirt as dep when it's explicitly done in the configure.
2014-12-21 22:42:06 +01:00
Fabiano Fidêncio
dba01112e8 cosmetic: use $(VAR) instead of ${VAR} 2014-12-21 22:36:07 +01:00
Pavel Grunt
c3d24f8bb6 Set a transient parent for GtkDialogs
Silence the Gtk 3.14 message:
"GtkDialog mapped without a transient parent. This is discouraged."
2014-12-19 17:39:53 +01:00
Marc-André Lureau
7e4921f161 msi/nsis: fix keyboard-shortcuts icon location
The /usr/share/icons/gnome icon theme location has been replaced with
Adwaita in f21, fix the path.
2014-12-15 18:11:33 +01:00
Fabiano Fidêncio
c3179a4c69 msi: add gtk3 support
Add support to build the virt-viewer's msi using GTK3.
For the GTK3 build, in order to provide all used icons for Windows
systems we have to include manually all the icons we want to or add
adwaita-icon-theme as dependency. I've decided to go with the first
approach, what can be improved when we have "foreach" support in
msitools (https://bugzilla.gnome.org/show_bug.cgi?id=741296).
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
ee1ad5797d msi: add libgovirt as dependency
libgovirt is used to provide support to foreign menu using ovirt.
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
0fd0ccc129 nsis: add missing 24x24 icons 2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
4db8e8f67f nsis: add gtk3 support
Add support to build the virt-viewer's nsis using GTK3.
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
59019cc4a3 nsis: remove $INSTDIR\etc 2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
c46f42eafc nsis: remove $INSTDIR\etc\libvirt 2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
6bd9b280b5 nsis: remove dup entries 2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
80601c6131 nsis: add libgovirt (and its dependencies)
libgovirt is used to provide support to foreign menu using ovirt.
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
69aed2eb9f nsis: add libwinpthread-1.dll
libwinpthread-1.dll is a dependency of libvirt
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
0202f83c7a nsis: add libopus-0.dll
libopus-0.dll is a dependency of spice-glib
2014-12-15 17:36:10 +01:00
Fabiano Fidêncio
8dbefb1aca nsis: add libnettle-4-7.dll (and its dependencies)
libgcc_s_sjlj-1 is needed by libgmp (on x86)
libgcc_s_seh-1 is needed by libgmp (on x86_64s)
libgmp-10.dll is needed by libnettle
libhogweed-2-5.dll is provided by libnettle
libnettle-4-7.dll is needed by gnutls
gnutls is needed by gvnc and libvirt

An interesting point here that worth to mention is the usage of /nonfatal
when including libgcc_s_{sjlj,seh}-1.dll. As we only have the _seh in x64
the build breaks trying to add "not found" files. A check for arch was
one option to solve the problem, but _sjlj may exist in x64 as well, when
using an old gcc. An explicit check if the file exists (in compile time)
was another idea, but for some reason the "-" part of the filename was
interpreted as a math operand, breaking the build.
With all that in mind, adding /nonfatal was the most convenient solution.
2014-12-15 17:36:09 +01:00
Fabiano Fidêncio
a5b8266295 nsis: update libgnutls version
Use version -28 instead of -26, matching what currently is in f21.
2014-12-15 17:36:09 +01:00
Fabiano Fidêncio
cf6b2c5695 nsis: update libtasn1 version
Use version -6 instead of -3, matching what currently is in f21.
2014-12-15 17:36:09 +01:00
Fabiano Fidêncio
a58a1885c0 nsis: update libpng version
Use libpng15-15 instead of libpng16-16, matching what currently is in
f21.
2014-12-15 17:36:09 +01:00
Fabiano Fidêncio
df4450112a nsis: update libgcrypt version
Use version -20 instead of -11, matching what currently is in f21.
2014-12-15 17:36:09 +01:00
Pavel Grunt
68148e1bd1 display-vnc: fix zoom-level set by command line
Setting the zoom-level using the command line option '--zoom' is not
working for vnc guests. This problem can be solved by emitting
the "display-desktop-resize" signal when vnc is initialized.

https://bugzilla.redhat.com/show_bug.cgi?id=1170071
2014-12-10 14:11:57 +01:00
Marc-André Lureau
824c4b9c0d Do not show twice error dialog when no VM are found
When running virt-viewer without argument, and no VM are found, you get
two error dialogs. Only one is enough.
2014-12-01 11:09:14 +01:00
Marc-André Lureau
c0774f725a spice: calling VirtViewerSession:close() can destroy self
SpiceSession in spice-gtk v0.27 will remove channels from session during
disconnect (and not when they are actually disposed). When no channels
are left, session-disconnected is emitted, and the VirtViewerSession
will be unref from the application. Use a weak reference to self to
avoid crashing after calling spice_session_disconnect()

As a workaround for existing clients, spice-gtk v0.27 will defer the
disconnection to idle time.  But the fix still makes sense and would
prevent potentially future issues if spice-gtk changes back to sync
disconnection.

(the alternative of calling ref/unref would needlessly recreate a
SpiceSession with a call to create_spice_session(), which is something
we can avoid when leaving the application)
2014-12-01 11:07:57 +01:00
Marc-André Lureau
3d5627d79a virt-viewer: allow connection to unix socket only server
Even when the server doesn't provide a display connection address,
virt-viewer is able to connect to guest with libvirt attach.
2014-11-25 15:07:32 +01:00
Marc-André Lureau
8addab251e Report error on attach-only display
Provide error details if the display can only be access through libvirt
--attach method.
2014-11-25 13:00:50 +01:00
Marc-André Lureau
1eaaf8c3ab Report error in dialog
Use a UI dialog to inform of connection error.
2014-11-25 13:00:50 +01:00
Marc-André Lureau
6100d08dd3 Simplify virt_viewer_initial_connect()
- do not overwrite err if ->initial_connect() sets it
- remove need for waitvm if the display server isn't yet started (note:
  this function might be untested, I am not sure relying on libvirt events
  is enough)
2014-11-25 13:00:50 +01:00
Marc-André Lureau
9e2f9ea064 Simplify virt_viewer_initial_connect()
- remove need for waitvm if the display server isn't yet started (note:
  this function might be untested, I am not sure relying on libvirt events
  is enough)
2014-11-25 13:00:50 +01:00
Marc-André Lureau
7931161d59 Simplify virt_viewer_initial_connect()
Some refactoring to make the code easier to read, mostly code
movement/reindenting and introduction of a "wait" label which has the
same purpose as "done".
This also adds a "goto wait" within an if block, but this does not
change the initial code flow, just makes it more explicit.
2014-11-25 13:00:50 +01:00
Marc-André Lureau
15c7d17b96 Remove VIRT_VIEWER_VM_CHOOSE_DIALOG_CANCELLED
This error type isn't really an error, it is used to skip error report
code. The functions can simply return FALSE on failure, without GError
set, to indicate that program should quit normally.
2014-11-25 13:00:49 +01:00
Marc-André Lureau
71f156caf5 Limit HAVE_SOCKETPAIR to directly concerned code 2014-11-25 13:00:49 +01:00
Marc-André Lureau
5a444f106d Move libvirt reconnect polling to VirtViewer
This is libvirt specific, no need to share it in the VirtViewerApp base
class.
2014-11-25 13:00:49 +01:00
Marc-André Lureau
dbbd72676a spice: use virt_viewer_signal_connect_object
This isn't required, but makes it easier to track reference issues, as
you have guarantee that callbacks won't be executed if the objects are
disposed.
2014-11-25 12:56:51 +01:00
Fabiano Fidêncio
2e7e6f6748 Add virt-viewer-usb.png
Windows XP (at least) doesn't recognize .svg files
2014-11-24 14:14:14 +01:00
Fabiano Fidêncio
a7e95e8f3c Replace priv->withEvents usage for priv->domain_event
Once we have priv->domain_event, we don't need priv->withEvents anymore
2014-11-20 11:15:05 +01:00
Fabiano Fidêncio
fe95067c85 Prefer to use virConnectDomainEventRegisterAny()
The usage of virConnectDomainEventRegister() is no longer recommended
according to the libvirt's documentation.
2014-11-20 11:15:05 +01:00
Fabiano Fidêncio
333ba4fe51 Set freed priv->dom to NULL in _dispose()
Avoid a possible use/free after the object has been freed.
2014-11-20 11:15:05 +01:00
Fabiano Fidêncio
de8b381fa4 Make sure conn exists before use it
Although all the used functions have a explicit check for a valid
virConnPtr, let's be safe and only use priv->conn when its value is
non-NULL.
2014-11-20 11:15:05 +01:00
Christophe Fergeau
1c69f3cf40 VirtViewerApp: Never remove main window
It's currently possible to destroy any virt-viewer window, including the
main window. However, some part of the code expects that the main window
is always present, for example to present status messages.

In particular, stopping the guest (or running virsh destroy) will close
all windows: virt_viewer_session_clear_displays will get called, which
will call into virt_viewer_app_remove_display_removed, and finally into
virt_viewer_app_remove_nth_window, which will destroy the window being
removed if it holds the last reference to it.

So going through virt_viewer_session_clear_displays, all
VirtViewerWindow instances and their corresponding GtkWindow have been
destroyed. This is already an issue as VirtViewerApp::main_window will
be pointing to freed memory.

When using virt-viewer --reconnect, this will cause a crash when
restarting the guest in virt_viewer_app_create_session as it tries to
get a valid GtkWindow through:
GtkWindow *window = virt_viewer_window_get_window(priv->main_window);

This commit avoids this issue by special casing the main window in
virt_viewer_app_remove_nth_window to ensure it never gets removed.
This is similar to what is done in virt_viewer_app_hide_all_windows.
2014-11-18 14:30:01 +01:00
Christophe Fergeau
1c341e8cb3 Fix check of virt_viewer_app_initial_connect return value
Commit 13f493200 changed virt_viewer_app_initial_connect to return a
gboolean rather than an int, but one call site was not updated to the
new convention, and was still checking for a negative value rather than
for FALSE in order to detect failures.
2014-11-14 10:32:31 +01:00
Daniel P. Berrange
b94859e30d Check for spice-gtk 0.26 instead of a git snapshot of 0.25
As spice-gtk macro for checking the version numbers was broken, let's
check for 0.26 and avoid to have virt-viewer broken on a few distros
for a good long time.
2014-11-04 00:06:08 +01:00
Christophe Fergeau
161de0fd32 Don't use virGetLastErrorMessage()
This was introduced in libvirt 1.0.6 but we only require libvirt 0.10.0
2014-10-31 13:46:43 +01:00
Christophe Fergeau
ffd2065724 Don't call local variable 'select'
This causes warnings with older compilers
virt-viewer-vm-connection.c:52: warning: declaration of 'select' shadows
a global declaration
/usr/include/sys/select.h:109: warning: shadowed declaration is here
2014-10-31 13:46:43 +01:00
Daniel P. Berrange
80a3ee5d5a Avoid log message warning messages due to incorrect int format
The G_N_ELEMENTS() type is size_t but this was being passed to
a format string with '%lu' which is of a different size on many
platforms. Just delete this part of the warning message since
it was not hugely useful.
2014-10-27 16:53:57 +00:00
Daniel P. Berrange
acc9d72ba7 Add new ui files to the RPMs 2014-10-27 16:53:48 +00:00
Daniel P. Berrange
041a39f97f Avoid use of non-literal string with g_debug 2014-10-27 16:43:13 +00:00
Daniel P. Berrange
6b72c98cff Fix typo s/to to/to/ 2014-10-27 16:39:06 +00:00
Daniel P. Berrange
bd6fd964f9 Remove useless 'if (...)' before free()
The 'free()' function accepts NULL, so you should not
check for NULL before calling it.
2014-10-27 16:38:06 +00: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
Christophe Fergeau
7bc8ceea38 man: Improve documentation for 'version' field in vv files 2014-10-23 13:47:11 +02:00
Rex Dieter
862dd22362 spec: Update/optimize mime scriptlets 2014-10-23 13:47:11 +02:00
Fabiano Fidêncio
ccc3fbe16a Check for the right spice version in session-spice.c
We have to check for the spice version where the
SPICE_CLIENT_ERROR_AUTH_NEEDS_PASSWORD_AND_USERNAME was introduced and
not for the one where spice_channel_get_error() was introduced.
2014-10-16 16:25:23 +02:00
Jonathon Jongsma
65560fa466 Don't disable "send key" menu when display isn't ready
The ability to send a keystroke should not depend on whether a display
is ready or not, it only depends on whether the display exists or not.

See https://bugzilla.redhat.com/show_bug.cgi?id=1152574
2014-10-16 16:09:25 +02:00
Jonathon Jongsma
c64a3c8f70 Fix bug with initial placement of fullscreen windows
The function app_window_try_fullscreen() will lookup the initial monitor
for the nth monitor internally, so we should pass in the display ID to the function
rather than the mapped monitor ID. This was causing 2 monitors on the
same monitor with a configuration like this:

    monitor-mapping=1:2;2:1
2014-10-15 23:48:50 +02:00
Fabiano Fidêncio
910ee34248 Force display_show_hint() when the display is set
Since a window is not created at startup for each display, the first
display(s) set when the application is opened will never receive and
treat the "notify::show-hint" signal on VirtViewerWindow, once the
callback is only set when the display is set to the specific window.
It causes problems like the "Send Key" menu not activated till an extra
display is added. To avoid this problem, let's force a call to
display_show_hint() everytime a display is set.

Resolves: rhbz#1152468
https://bugzilla.redhat.com/show_bug.cgi?id=1152468
2014-10-15 23:48:50 +02:00
Marc-André Lureau
3eaecbb3a4 Use socat instead of nc if possible
It turns out that nc does not leave on server disconnect, and there
doesn't seem to be any option to do that, leaving client open, and
a bunch of idle processes.

Replacing nc with socat solves that, client is disconnected when
the VM is shut down, when the sever connection is closed.

https://bugzilla.redhat.com/show_bug.cgi?id=1030487
2014-10-10 15:14:18 +02:00
Fabiano Fidêncio
9886055a4a Prefill the username in the authentication dialog
Lets prefill the username entry using the user name of the
current user.
2014-10-10 12:57:08 +02:00
Fabiano Fidêncio
69b3096f51 Use 'username' property from .vv file for spice-session 2014-10-10 12:57:08 +02:00
Fabiano Fidêncio
04e02148b2 Ask for username when connecting with SASL
When connecting with SASL for authentication, some authentication
mechanisms need a username (the plain text and md5 ones, for example).
2014-10-10 12:57:08 +02:00
Pavel Grunt
88f634179e Show VM chooser dialog when starting virt-viewer with no arg
When user starts virt-viewer without specifying VM domain name
or with a wrong name a list of running machines is shown
and user may choose one of them.
2014-10-10 12:57:08 +02:00
Pavel Grunt
7a47a4da08 Show VM chooser dialog when oVirt VM name is missing
When a user tries to connect to ovirt without specifying
VM name (remote-viewer ovirt://ovirt.example.com) or with
wrong VM name a list of available virtual machines is shown,
and the user may pick a machine he wants to connect to.
2014-10-10 12:57:08 +02:00
Christophe Fergeau
334169749e man: Document [ovirt] section in .vv files
Add documentation for these options even though they are mainly meant to
be set by the oVirt portal when it generates the .vv file.
2014-10-09 17:21:26 +02:00
Christophe Fergeau
53b347c92c man: Improve doc for 'ca' in .vv files
Make it clearer that this CA will be used to validate the certificate
presented by the remote SPICE host when using TLS.
2014-10-09 17:21:26 +02:00
Christophe Fergeau
d2fb85642a Fix 'seperate' typo in man page/comments 2014-10-09 17:21:26 +02:00
Christophe Fergeau
9803f9cb42 ovirt: Allow to remove CD images
It turns out this is supposed to be done through update requests with a
CD image with an empty name, which is what the current code tries to do.
The only reason it's not working is because of server-side bugs with
oVirt < 3.5
The requirement on libgovirt is raised to 0.3.2 as
a small change is needed as well in libgovirt to allow empty filenames:
https://git.gnome.org/browse/libgovirt/commit/?id=bdb788fcc

Without this change, nothing too bad will happen, but the CD won't be
removed and warnings will be logged in the console.
2014-10-09 17:19:12 +02:00
Ján Tomko
bb44ce0a1f Prefer virDomainOpenGraphicsFD for --attach
The virDomainOpenGraphics API cannot label the socket
we pass to it. Prefer virDomainOpenGraphicsFD (if building
with libvirt 1.2.8 or later) which creates the socket for us
and works with SELinux too.

Fall back to the old API if the new one is unsupported
(i.e. the libvirtd on the host is older than the libvirt version
virt-viewer was compiled against).

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1141228

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2014-10-01 18:58:13 +02:00
Fabiano Fidêncio
ec5a661469 Let the user cancel the SPICE auth dialog
virt_viewer_auth_collect_credentials() was recently changed to return
a boolean instead of an integer (2561c171). This change introduced a
regression in the authentication dialog behavior, making it impossible
for the user to cancel.
2014-09-26 16:30:43 +02:00
Fabiano Fidêncio
141d69b7f5 Improve authentication error messages
Adding a better error message to our default error message, based on the
libvirt error. Also, the libvirt error is shown as debug.

https://bugzilla.redhat.com/show_bug.cgi?id=1142742
2014-09-26 16:30:43 +02:00
Fabiano Fidêncio
42ffe6f8b4 Simplify virt_viewer_auth_libvirt_credentials() return value logic
As the function should return < 0 in error cases, let's explicitly
return/set the return value to -1 in error cases. Otherwise, the
function will return 0.

This patch also fixes a regression introduced by (a5ce2ed3).

https://bugzilla.redhat.com/show_bug.cgi?id=1142742
2014-09-26 16:30:43 +02:00
Jonathon Jongsma
0107214070 Add example of an oVirt URI to the manpage
https://bugzilla.redhat.com/show_bug.cgi?id=1142769
2014-09-26 09:22:12 -05:00
Jonathon Jongsma
882a59596d Add documentation for fullscreen monitor mapping
see https://bugzilla.redhat.com/show_bug.cgi?id=1142769
2014-09-26 09:22:12 -05:00
Jonathon Jongsma
55172bd8a7 Initialize fullscreen display map to fallback
If uuid was never set, we never checked the 'fallback' monitor map.
Initializing the monitor map to the fallback value at startup solves
this issue. This allows fallback mode to work with older servers that
don't send the UUID.
2014-09-26 09:22:12 -05:00
Jonathon Jongsma
c4d1347a6d Unset app 'fullscreen' when leaving fullscreen
Previously, the fullscreen floating toolbar and the "toggle-fullscreen"
hotkey (which maps to the menu item action) had slightly different
methods of exiting fullscreen. The floating toolbar method unset the
'fullscreen' property on the application (which causes all windows to
simultaneously exit fullscreen), whereas the hotkey did not. This had a
side-effect of preventing the display from auto re-sizing if it was
fullscreened again.  After this change, both the hotkey and the toolbar
button will unset the application-level 'fullscreen' property when
exiting fullscreen mode.

Resolves: rhbz#1022608
2014-09-26 09:20:55 -05:00
Jonathon Jongsma
804564e246 VirtViewerDisplayVnc: set 'session' property
Set the display's session property in the constructor. If the session is
not set, then virt_viewer_display_get_session() doesn't return anything
useful.
2014-09-24 10:21:22 -05:00
Jonathon Jongsma
a15bbac320 Make default window size a bit more useful
Currently, windows have a default size of 400x400 pixels. This is a
strange aspect ratio for a display, and it is also too small to be
useful for much. Since the default window size determines the initial
size of newly-enabled displays, it would be nice if we used a slightly
better size.
2014-09-24 10:21:22 -05:00
Jonathon Jongsma
29c8cadd40 Set initial window size to display desktop size
When setting the 'display' for a VirtViewerWindow, the initial size for
that window should be the size of the remote display. So we synthesize a
desktop resize event when setting a new display for a window.  This is
only done for enabled displays. Disabled displays generally have a size
of 0x0, which would result in the window being at it's minimum size, so
just allow the window to use its default size.
2014-09-24 10:21:22 -05:00
Jonathon Jongsma
f03285ba8d Create windows on demand, not at startup
Previously, a window was created at startup for each display, even if
the display was not enabled. This resulted in a fixed 1:1 association
between windows and remote displays. Since there was always one window
created at startup to display status messages (the "main window"), this
was always associated with remote display #1. But if the first remote
display was not enabled, we ended up with a extra black window with a
message saying ("Waiting for display 1...").

By creating windows on demand, we can re-use the "main window" for any
arbitrary display, even if it's not display #1.

Resolves: rhbz#1032939
2014-09-24 10:21:22 -05:00
Jonathon Jongsma
4537047890 VirtViewerApp: store windows in a list
Use a list to store the application's windows.  This is another step
towards separating the window from the guest display ID.
2014-09-24 10:21:22 -05:00
Jonathon Jongsma
0e6735b4a4 VirtViewerDisplay: add convenience API for getting nth
g_object_get(...) can be cumbersome, so add convenience API for getting
the display ID ("nth-display") property:

    virt_viewer_display_get_nth()
2014-09-24 10:20:12 -05:00
Jonathon Jongsma
573c1cfc91 App: keep hash table of displays
This is part of a re-factoring that will de-couple the client window
from the remote display id.
2014-09-24 10:20:12 -05:00
Jonathon Jongsma
f26a5fe16c Don't show extra screens in fullscreen mode
When using the fullscreen display mapping configuration file, extra
monitors could end up enabled by mistake. This was because
virt_viewer_app_get_initial_monitor_for_display would end up returning
Nmonitor = Ndisplay when the display map hash lookup failed. In
reality, when a display map is specified, but the hash lookup fails,
the display should not be enabled. This function now returns -1 to
distinguish this case, and the display is not enabled when this value is
returned.

Resolves issue described at
https://bugzilla.redhat.com/show_bug.cgi?id=1129477#c9
2014-09-24 10:19:29 -05:00
Jonathon Jongsma
f317e95096 Move monitor mapping into app_window_try_fullscreen()
Rather than requiring all callers to calculate the initial monitor
mapping before calling app_window_try_fullscreen, move the
responsibility for calculating the correct monitor into this function.
This makes it less likely that somebody will forget and a display will
get placed on the wrong monitor.
2014-09-24 09:43:46 -05:00
Christophe Fergeau
5d6b1b8cce Don't unref 'display' in VirtViewerDisplaySpice::finalize
Right after being created, the SpiceDisplay 'display' private member is
added to the VirtViewerDisplaySpice GTK+ container with
gtk_container_add. This call will take ownership of the floating
reference that SpiceDisplay got upon creation.
This means VirtViewerDisplaySpice::display is a pointer to SpiceDisplay,
but it must not be unref'ed when the object is destroyed as we don't own
that reference.
As the container which owns the reference is the
VirtViewerDisplaySpice instance itself, we don't need to take an
additional reference here.

This fixes a crash when exiting remote-viewer after connecting to a
SPICE VM:
  #0  0x00007ffff3f33a81 in g_type_check_instance_is_fundamentally_a (type_instance=0x874500, fundamental_type=80) at gtype.c:3981
  #1  0x00007ffff3f19f96 in g_object_unref (_object=0x874500) at gobject.c:3067
  #2  0x000000000042a1ea in virt_viewer_display_spice_finalize (obj=0x6ebc30) at virt-viewer-display-spice.c:65
  #3  0x00007ffff3f1a257 in g_object_unref (_object=0x6ebc30) at gobject.c:3170
  #4  0x0000000000428de7 in destroy_display (data=0x6ebc30) at virt-viewer-session-spice.c:649
  #5  0x00007ffff3bbb51b in g_ptr_array_foreach (array=0x7e12a0, func=0x428d71 <destroy_display>, user_data=0x0) at garray.c:1502
  #6  0x00007ffff3bbaadf in ptr_array_free (array=0x7e12a0, flags=FREE_SEGMENT) at garray.c:1088
  #7  0x00007ffff3bbaa10 in g_ptr_array_unref (array=0x7e12a0) at garray.c:1036
  #8  0x00007ffff3bcf9bd in g_data_set_internal (datalist=0xa0adb0, key_id=1622, new_data=0x0, new_destroy_func=0x0, dataset=0x0) at gdataset.c:407
  #9  0x00007ffff3bcfe74 in g_datalist_id_set_data_full (datalist=0xa0adb0, key_id=1622, data=0x0, destroy_func=0x0) at gdataset.c:670
  #10 0x00007ffff3f1a771 in g_object_set_data (object=0xa0ada0, key=0x437252 "virt-viewer-displays", data=0x0) at gobject.c:3461
  #11 0x0000000000429b56 in virt_viewer_session_spice_channel_destroy (s=0x6eb910, channel=0xa0ada0, session=0x8cb3a0) at virt-viewer-session-spice.c:854
  #12 0x00007ffff3f12d81 in g_cclosure_marshal_VOID__OBJECT (closure=0x8e8fd0, return_value=0x0, n_param_values=2, param_values=0x7fffffffcd80, invocation_hint=0x7fffffffccc0, marshal_data=0x0) at gmarshal.c:1272
  #13 0x00007ffff3f0e143 in g_closure_invoke (closure=0x8e8fd0, return_value=0x0, n_param_values=2, param_values=0x7fffffffcd80, invocation_hint=0x7fffffffccc0) at gclosure.c:768
  #14 0x00007ffff3f2aef0 in signal_emit_unlocked_R (node=0x7c1f20, detail=0, instance=0x6eb910, emission_return=0x0, instance_and_params=0x7fffffffcd80) at gsignal.c:3553
  #15 0x00007ffff3f2a1f3 in g_signal_emit_valist (instance=0x6eb910, signal_id=219, detail=0, var_args=0x7fffffffd058) at gsignal.c:3309
  #16 0x00007ffff3f2a746 in g_signal_emit (instance=0x6eb910, signal_id=219, detail=0) at gsignal.c:3365
  #17 0x00007ffff529d784 in spice_session_channel_destroy (session=0x6eb910, channel=0xa0ada0) at spice-session.c:1990
  #18 0x00007ffff529ed25 in spice_channel_dispose (gobject=0xa0ada0) at spice-channel.c:153
  #19 0x00007ffff52acd26 in spice_display_channel_dispose (object=0xa0ada0) at channel-display.c:136
  #20 0x00007ffff3f1a132 in g_object_unref (_object=0xa0ada0) at gobject.c:3133
  #21 0x00007ffff52a4afb in spice_channel_delayed_unref (data=0xa0ada0) at spice-channel.c:2156
  #22 0x00007ffff3bf21d1 in g_idle_dispatch (source=0xa35a00, callback=0x7ffff52a49f3 <spice_channel_delayed_unref>, user_data=0xa0ada0) at gmain.c:5320
  #23 0x00007ffff3bef8eb in g_main_dispatch (context=0x68a920) at gmain.c:3064
  #24 0x00007ffff3bf0661 in g_main_context_dispatch (context=0x68a920) at gmain.c:3663
  #25 0x00007ffff3bf0853 in g_main_context_iterate (context=0x68a920, block=1, dispatch=1, self=0x6c8c60) at gmain.c:3734
  #26 0x00007ffff3bf0c7c in g_main_loop_run (loop=0x889b20) at gmain.c:3928
  #27 0x00007ffff69be44f in gtk_main () at gtkmain.c:1207
  #28 0x0000000000431896 in main (argc=1, argv=0x7fffffffd648) at remote-viewer-main.c:183
2014-09-23 15:19:47 +02:00
Fabiano Fidêncio
a5ce2ed3ae Do not fail when the auth dialog is cancelled
https://bugzilla.redhat.com/show_bug.cgi?id=1145460
2014-09-23 15:06:27 +02:00
Fabiano Fidêncio
e86e885380 Revert changes related to numpad accelerators
Due to a GTK+ limitation and bad testing from my side, I've pushed
two patches trying to add support to use Ctrl + {+, -, 0} from numpad
to control zoom-in, zoom-out and zoom-reset.
Unfortunately, with the first patch (3a168815) I've duplicated the menu
items related to the zoom functions. With the second one (55cdb986),
provided to not show the duplicated menu items, we came back to the
initial state, where the numpad accelerators don't work.

So, in resume, multiple accelerators in a GTK+ widget are only supported
on applications using GApplication, what is not our case and won't be
till we drop the GTK+2 support.

Revert "Do not show duplicated menu items" and
Revert "Add support to use numpad accelarators for zoom-{in.out,reset}"

This reverts commits 55cdb9867df05f1c4f6c8e569a6f0c1e0bc28d99 and
3a168815b738076526ba0f3e9a82e6fb1db482e9.
2014-09-23 15:00:19 +02:00
Christophe Fergeau
56cda33ff8 Remove inaccurate G_GNUC_UNUSED
The 'user_data' variable is used in the callback.
2014-09-22 14:18:12 +02:00
Fabiano Fidêncio
276ca0f753 Add support to view the password entry content
Allow users to check if the entered password is right and/org modify
the password easily in case it's wrong.
2014-09-17 13:45:46 +02:00
Fabiano Fidêncio
e825e183a1 Mark all strings for translation in the auth dialog
A few strings weren't marked for translation in the authentication
dialog.
2014-09-15 14:54:02 +02:00
Fabiano Fidêncio
55cdb9867d Do not show duplicated menu items
When the support to use numpad accelerators for zoom-{in,out,reset}
was added (3a168815), by mistake, we have added duplicated buttons
in View -> Zoom.
2014-09-15 14:53:53 +02:00
Christophe Fergeau
69eccb59f9 Fix --without-spice-gtk --with-ovirt build
The oVirt foreign menu support reused some existing bits from the older
SPICE controller foreign menu code. However, this controller code is
only built when spice-gtk support is built, while the oVirt foreign menu
code could be used with VNC as well. Trying to build the ovirt foreign
menu code without spice-gtk causes build issues due to missing
functions, or missing declarations, ...

The libgovirt/spice-gtk code which is entangled is the code to update
the foreign menu when its content changes, or when a new window is
opened. Making the oVirt-specific code independant from the
spice-gtk-specific code is not too complicated, but this comes at the
expense of a bit of code duplication, but this is only simple code
iterating over the GHashTable storing the opened windows.

Resolves: rhbz#1127156
2014-09-12 17:08:42 +02:00
Christophe Fergeau
fe7927733c Add translatable file to POTFILES.in 2014-09-12 17:08:42 +02:00
Jonathon Jongsma
8f16b38f9e Remove extra ref on SpiceDisplay
There's no need to ref the SpiceDisplay widget when adding it to a
container. The container will take its own ref.
2014-09-11 09:30:23 -05:00
Jonathon Jongsma
401906afd7 VirtViewer: Fix memory leaks
Don't leak priv->uri or priv->domkey from VirtViewer class
2014-09-11 09:30:17 -05:00
Jonathon Jongsma
75b7ff0fa2 Don't print warning for missing comment in config file
Change g_warning to g_debug as suggested by Marc-Andre
2014-09-05 11:15:52 -05:00
Jonathon Jongsma
2561c171e7 Change collect_credentials() to return a boolean
Instead of returning 0 for success and -1 for failure, change to a
boolean success value to be more consistent with the rest of the
virt-viewer code.
2014-08-26 16:54:01 -05:00
Jonathon Jongsma
b7c8049460 Auth: fix leak of username
When collect_credentials() returns a failure status, 'username' was
potentially leaked.
2014-08-26 16:54:01 -05:00
Jonathon Jongsma
ad8966ccf9 remote-viewer: oVirt username review fixes
Minor fixes from patch review

rhbz#1061826
2014-08-19 14:15:53 -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
Fabiano Fidêncio
4767491532 Fix gcc warning (unused-parameter) 2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
729ce99023 Fix gcc warning (missing-prototypes) 2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
3a168815b7 Add support to use numpad accelarators for zoom-{in.out,reset}
As virt-viewer uses GtkAccelMap for shortcuts and that GTK only can have
one key binding per accelerator (in accel_map_add_entry), let's also add
support specificly for the numpad keys in the virt-viewer code

https://bugzilla.redhat.com/show_bug.cgi?id=883433
2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
dc3db6302e Don't check for NULL when it never can happen 2014-08-19 18:10:03 +02:00
Christophe Fergeau
6ab5444c81 Create foreign menu from .vv file information
When the .vv file has an [ovirt] section, we should try to create a foreign
menu out of it. This will allow remote-viewer to offer a menu to change the
currenty inserted cdrom.

Contrary to the ovirt:// case when we already have fetched an OvirtAPI
and OvirtVm instance in order to get the SPICE/VNC connection details,
when working from a .vv file, we'll need to get them from the REST API.
Authentication should happen through the JSESSIONID cookie, if that
fails we want to give up on using the foreign menu, so we don't need to
set up authentication callbacks.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
eb4a7e4a84 Add ovirt-specific properties to VirtViewerFile
They will be useful to implement foreign menu support through
oVirt REST API
2014-08-18 13:20:42 +02:00
Christophe Fergeau
c7a8bcdb63 Add 'group' argument to VirtViewerFile helpers
For foreign menu support, we'll need a way to pass oVirt-specific
information in the .vv file. This will be done through an additional
[ovirt] section, this commit is in preparation for that.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
3df1e5a17a ovirt: Use OvirtForeignMenu class
After the previous commit which introduced the OvirtForeignMenu
class, we can now make use of it in the remote-viewer UI code.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
894396d6b5 ovirt: Add OvirtForeignMenu class
This class is used to implement the so-called oVirt 'foreign menu'
which is a menu populated with ISO images available on the
oVirt instance that the user can dynamically insert into the
virtual machine he is currently viewing.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
914f75ee8d ovirt: Remove extra '/' from oVirt URI
The 'path' part of the URI will always start with a '/' when present as
this is what separates it from the hostname. When rebuilding the final
URI, the current code inserts a '/' by itself between the hostname and
the path, which results in URIs with an extra '/':
https://ovirt.example.com//some/path/api

This is not only cosmetic as this can cause issues with cookie handling
if libgovirt accesses //some/path/api while the cookie is set for
/some/path/api.
2014-08-18 13:20:42 +02:00
Jonathon Jongsma
49abd71dae remote-viewer: allow username in ovirt URIs
When the user launches remote-viewer with an ovirt URI of the form

        ovirt://user@host/vmname

Pre-populate the authentication dialog with the specified username. We
don't support specifying the password on the commandline, since that is
a potential security risk.

rhbz#1061826
2014-08-18 13:20:42 +02:00
Jonathon Jongsma
8b7f5db573 Don't use fallback ca-file when launching vv-file
When launching from a vv-file, we want to use the ca specified in the vv
file and not load additional certs from the fallback ca-file. This
ensures that the ca-file property of the spice session is unset when
loading a ca from a vv-file.

Resolves: rhbz#1127762
2014-08-15 11:22:59 -05:00
Jonathon Jongsma
0ca9959f00 Write vm name to config file as comment 2014-08-07 08:51:15 -05:00
Jonathon Jongsma
539e672437 Change per-guest fullscreen config format
use <display>:<monitor>;<display>:<monitor> instead of simply implying the
display from the array index (e.g. <monitor>;<monitor>). This allows you to set
up sparse guest displays (e.g. display 1 + 3).

For example, to configure display 1 to be fullscreen on monitor 2 and display 2
to be fullscreen on monitor 3:

    monitor-mapping=1:2;2:3
2014-08-07 08:51:15 -05:00
Jonathon Jongsma
b684a76fa4 Add a dialog showing details of the current guest
This allows the user to obtain the GUID and vm name of the currently-connected
guest.  Obviously, this only works with spice. In the future, it will allow them
to set guest-specific configuration options (using a GUID as a key)
2014-08-07 08:51:15 -05:00
Christophe Fergeau
7d8abf3957 Fix warning when going in/out of fullscreen
Going to fullscreen, and then exiting causes these messages to show up
on the console:
(remote-viewer:14481): GLib-CRITICAL **: Source ID 784 was not found
when attempting to remove it
2014-08-04 17:41:50 +02:00
Christophe Fergeau
5dcd46c0b1 Remove unused RemoteViewerPrivate members 2014-08-04 17:41:50 +02:00
Christophe Fergeau
4eaeab65a3 Remove incorrect G_GNUC_UNUSED from remote_viewer_window_added
The 'app' parameter is used in the function.
2014-08-04 17:41:50 +02:00
Christophe Fergeau
7d2dc19717 Remove unused VirtViewerNotebook::dispose
The vfunc implementation is only chaining to its parent, removing it
will achieve the same result.
2014-08-04 17:41:50 +02:00
Christophe Fergeau
e7418992ea Chain up to parent's dispose at the end of VirtViewerWindow::dispose
glib documentation says this should be the last thing done in the
dispose() call, which makes sense as this could invalidate still-needed
data in the parent object.
2014-08-04 17:41:50 +02:00
Marc-André Lureau
808715491b virt-viewer.xml: remove zoom-{in,out} accelerators
The XML menu accelerators conflict with accelerator set in the code and
prevent using them. This is a regression from d29fc63d.
2014-07-22 13:22:12 +02:00
Marc-André Lureau
6b997e5696 Only filter virt-viewer debug messages
Filter only our own debug messages.

https://bugzilla.redhat.com/show_bug.cgi?id=1118365
2014-07-21 18:47:36 +02:00
Marc-André Lureau
2262d4b5b4 Always set ask-quit setting
Avoid creating empty settings files, always set the ask-quit key.

https://bugzilla.redhat.com/show_bug.cgi?id=1006737
2014-07-21 18:46:58 +02:00
Marc-André Lureau
4c65848526 spice: avoid crash if connection failed without error
spice_channel_get_error() is not guarantee to return a GError.
2014-07-21 18:46:58 +02:00
Daniel P. Berrange
507f426a7f Bump version to 2.0 for next dev cycle 2014-07-21 15:34:13 +01:00
Daniel P. Berrange
50536e7b58 Update NEWS for 1.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-07-21 11:07:31 +01:00
Daniel P. Berrange
2575ab49f2 Refresh translations from transifex
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-07-21 11:06:33 +01:00
Marc-André Lureau
d29fc63dc2 Make ctrl-[+-] zoom in/out in fullscreen
Make ctrl-[+-] zoom in/out in fullscreen
with mouse over the control bar.

https://bugzilla.redhat.com/show_bug.cgi?id=987549
2014-07-08 16:36:52 +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
Marc-André Lureau
df28177c67 app: add virt_viewer_app_make_dialog()
Add a function to create an application dialog. In the following
commit, we will add more details for connection failures.
2014-07-08 16:36:52 +02:00
Jonathon Jongsma
abb888bce7 Use GOptionGroup for VirtViewerApp options
Encapsulate things a bit better by adding
virt_viewer_app_get_option_group() which provides a GOptionGroup rather
than exposing an array of options.  This option is then set as the main
option group, and additional options can be added by subclasses, so the
effect to the user should be equivalent.
2014-07-02 15:59:39 -05:00
Jonathon Jongsma
de3e27b333 Set help output summary correctly
Use g_option_context_set_summary() to provide a brief description of the
executable instead of tacking the summary onto the end of the
commandline.
2014-07-01 15:14:38 -05:00
Jonathon Jongsma
657d490e93 remote-viewer: mention vv-file in help output
The man page already has a description of the vv-file format, but the
--help output didn't mention it how to use it.

References: rhbz#970825
2014-07-01 15:14:08 -05:00
Christophe Fergeau
4cf0a83781 build-sys: Use automake 'subdir-objects' option
This silences an automake 1.14 warning:

src/Makefile.am:35: warning: source file 'view/autoDrawer.c' is in a
subdirectory,
src/Makefile.am:35: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the
'subdir-objects'
automake: automake option hasn't been enabled.  For now, the
corresponding output
automake: object file(s) will be placed in the top-level directory.
However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same
subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option
throughout your
automake: project, to avoid future incompatibilities.
2014-06-26 21:22:27 +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
eaaa4f5106 rhbz#1111514: Fix un-shrinkable displays on windows guests
Commit 6edde5786 introduced a regression wrt shrinking windows on windows
guests. This seems to be because resizing a display often causes the notebook
widget to switch to the status page temporarily (often so quickly that it's not
noticeable to the eye). This causes a quick 'unmap' and 'map' event sequence on
the display widget. Apparently the timing of these events varies enough between
linux and windows guests that it is only noticeable on windows gueststhe timing
of these events varies enough between linux and windows guests that it is only
noticeable on windows guests. The exact sequence that causes the bug appears to
be as follows:

1 user resizes window smaller
2 display widget gets a new allocation, which causes it to send a display
  reconfiguration to the guest
3 client receives a new show-hint for the display which causes it to switch
  temporarily to the 'status' notebook page
4 display widget gets unmapped
5 Client receives another new show-hint, which causes the display widget to get
  re- mapped, which causes client to send a display reconfiguration to the guest
  (using the old size)
6 client receives new (smaller, from step 2) display size and temporarily
  changes to the new size
7 client receives new (larger, from step 5) display size and changes back to
  original size.

To fix the issue, we only explicitly request a resize in response to the very
first map event, and for any subsequent map events, we simply call
_make_resizable() as before.
2014-06-23 13:26:53 -05:00
Daniel P. Berrange
28a6bd6cf4 Bump version 1.0 to simplify Windows MSI versioning
The Windows MSI product version is restricted to a 3 component
version number, whose fields are a max value of 255.255.65536

Since the main virt-viewer version takes up 3 components already,
we have the munge the micro version together with the first
component of the release version. eg we have

   $VERSION[0].$VERSION[1].($VERSION[2] << 8 + $RELEASE[0])

This causes problems for RHEL which needs to have 2-component
release versions to deal with z-stream builds.  eg a RHEL
version might be virt-viewer-0.5.6-2.el6_4.3 and we've
no easy way of adding the final '.3' to the Windows product
version.

If we reduce the primary virt-viewer version to just 2 components,
then we can leave the 3rd component for exclusive use by the RPM
release number. eg so we'd make product version up using

   $VERSION[0].$VERSION[1].($RELEASE[0] << 8 + $RELEASE[1])

In course of normal development, we'd increase the $VERSION[0]
for each release. ie next release is 1.0, then 2.0, then 3.0.
This means we retain the ability to put out "stable" branch
releases for any historical version by doing 1.1, 1.2 instead
of having to re-add a 3rd component.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-23 16:16:01 +01:00
Marc-André Lureau
687b9e0bfa man: fix zoom level range
https://bugzilla.redhat.com/show_bug.cgi?id=1111428
2014-06-20 13:36:04 +02:00
Marc-André Lureau
fc39687374 Fix a floating display warning
You can reproduce the error by starting the client in kiosk and shuting
down the guest.

 #0  0x000000317e432915 in raise (sig=6) at
 ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 #1  0x000000317e4340f5 in abort () at abort.c:92
 #2  0x000000317fc4a98a in g_logv (log_domain=0x318730e657 "Gtk",
 log_level=<value optimized out>, format=
     0x31873a50a8 "A floating object was finalized. This means that
     someone\ncalled g_object_unref() on an object that had only a
     floating\nreference; the initial floating reference is not owned by
     anyone\nand must be remo"..., args1=0x7fffffffd5f0)
     at gmessages.c:557
 #3  0x000000317fc4aa23 in g_log (log_domain=<value optimized out>,
 log_level=<value optimized out>,
     format=<value optimized out>) at gmessages.c:577
 #4  0x000000318717ba72 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
 #5  0x0000000000426eb5 in
 virt_viewer_display_spice_finalize (obj=0x6fec20
 [VirtViewerDisplaySpice])
     at virt-viewer-display-spice.c:67
 #6  0x0000003180c106a4 in g_object_unref (_object=0x6fec20) at
 gobject.c:2712
 #7  0x0000000000425b5d in destroy_display (data=0x6fec20) at
 virt-viewer-session-spice.c:596
 #8  0x000000317fc1667b in g_ptr_array_foreach (array=0x74a040,
 func=0x425ae7 <destroy_display>, user_data=0x0)
     at garray.c:1306
 #9  0x000000317fc16e7b in g_ptr_array_free (farray=0x74a040,
 free_segment=1) at garray.c:938
 #10 0x000000317fc2906a in g_data_set_internal (datalist=<value optimized
 out>, key_id=1297, data=0x0, destroy_func=0)
     at gdataset.c:351
 #11 g_datalist_id_set_data_full (datalist=<value optimized out>,
 key_id=1297, data=0x0, destroy_func=0) at gdataset.c:598
 #12 0x00000000004268d0 in
 virt_viewer_session_spice_channel_destroy (s=0x800000 [SpiceSession],
 channel=
2014-06-16 21:54:33 +02:00
Marc-André Lureau
43221fa108 kiosk: remove invalid unref
This unref doesn't seem to be related to any reference, although it
was probably introduced in the first place to clear the floating ref,
wrongly. See following commit for a working solution.
2014-06-16 21:54:33 +02:00
Marc-André Lureau
48d8fa788d util: fix glib_check_version() condition
glib_check_version() returns NULL if version is higher or equal.
2014-06-12 12:01:38 +02:00
Jonathon Jongsma
b707b4524f Fix tiny window when resetting zoom factor in gtk2 build
rhbz#1104064 had a couple of symptoms. The first was fixed in
6edde57862ac30e74ce6412c93a2fa925ae4ea67.

The second symptom is that displays could also become tiny when clicking 'View >
Zoom > Normal Size'. This was because VirtViewerDisplay returned early from
_display_set_zoom_level() if the zoom level was being set to the current zoom
setting. However, the calling function (_window_set_zoom_level()) also tries to
queue a resize event for itself after setting the zoom level on the display. If
the display doesn't queue a resize event for itself, its size request will only
be 50x50 during the window resize negotiation. This causes the display to become
tiny and zoomed out. Queueing a resize on the display widget ensures that it
will request the proper size during the next allocation.
2014-06-11 15:17:53 -05:00
Marc-André Lureau
d1b2840997 window: take zoom-level into account for display limits
Fixes guest can not be resized to expected window size after zoom out.

https://bugzilla.redhat.com/show_bug.cgi?id=1105528
2014-06-11 22:17:08 +02:00
Jonathon Jongsma
6edde57862 Fix tiny windows for secondary displays in gtk2 build
When enabling a new display on linux guests, the new window would be tiny
(50x50) and zoomed way out. This was caused by the fact that when the display
widget received the 'map' event, it unconditionally cleared the 'dirty' flag,
which meant that it would only request 50x50 size. This behavior was intended to
fix a bug on the windows client which wprevented windows from resized smaller
than the guest display resolution. Unfortunately, due to the timing of the 'map'
and allocate events, the widget became very small.

Instead of clearing the 'dirty' flag directly when a widget is mapped, we
now queue a resize event, which will guarantee that the widget attains its
desired size and will then clear its dirty flag (allowing it to be resized).
Testing on windows indicates that this fix still solves the 'unshrinkable
window' problem while also preventing the tiny secondary display bug.

Resolves: rhbz#1104064
2014-06-10 14:33:40 -05:00
Marc-André Lureau
8b8afec099 util: get rid of ARRAY_CARDINALITY 2014-06-10 18:13:56 +02:00
Marc-André Lureau
2bd835fb05 Use a custom log handler to silence debug messages
On RHEL6, with old glib, all g_log messages are printed.
Filter the messages with a custom handler instead.

https://bugzilla.redhat.com/show_bug.cgi?id=1107518
2014-06-10 18:13:56 +02:00
Marc-André Lureau
fc610f5c98 kiosk: don't attempt to hide windows when disconnecting
Get rid of the following warning:
(virt-viewer:7262): virt-viewer-WARNING **: Can't hide windows in kiosk mode

https://bugzilla.redhat.com/show_bug.cgi?id=1107518
2014-06-10 18:13:56 +02:00
Marc-André Lureau
ed939ad00d Replace DEBUG_LOG with g_debug
https://bugzilla.redhat.com/show_bug.cgi?id=1107518
2014-06-10 18:13:37 +02:00
Marc-André Lureau
78c9612257 Remove warning when removing display
Some display have no associated window (for ex, if it doesn't fit
on client monitors).

(remote-viewer:22275): remote-viewer-CRITICAL **: virt_viewer_window_set_display: assertion `VIRT_VIEWER_IS_WINDOW(self)' failed

(remote-viewer:22275): remote-viewer-CRITICAL **: virt_viewer_app_remove_nth_window: assertion `win != NULL' failed

https://bugzilla.redhat.com/show_bug.cgi?id=1107518
2014-06-10 15:45:18 +02:00
Marc-André Lureau
f7bbf51458 msi: move up micro version in x.x.build productversion
This allows 12 bits to form a buildid, ex in RHEVM builds:
--with-buildid=$(release << 4 + zrelease)

https://bugzilla.redhat.com/show_bug.cgi?id=1105650
2014-06-10 15:35:52 +02:00
Christophe Fergeau
e214d6b1d5 Don't connect to localhost when using --direct
Trying to connect to a remote virtual machine using
virt-viewer -c qemu+ssh://example.com/system --direct $vm_name
will currently fail with an error message saying it's not possible to
localhost. This happens with VMs which listen on a wildcard address (eg
'0.0.0.0').
This was introduced by commit 74b1b62 which changes the host to connect to
to 'localhost' when trying to connect through ssh to a VM listening on a
wildcard address. This is only valid when using a ssh tunnel, and should
not be done with --direct. The fallback code which uses the hostname from
the libvirt URI is what makes the most sense in this situation (wildcard
listen address + --direct).
This commit introduces a virt_viewer_app_get_direct() so that this can be
implemented.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1079211
2014-06-10 11:46:05 +02:00
Christophe Fergeau
854dbf7ad0 Fix 'title' leak in virt_viewer_file_fill_app()
virt_viewer_file_get_title() returns a newly allocated string.
2014-06-10 09:15:22 +02:00
Jonathon Jongsma
e23f6fa4c4 Set freed variables to NULL in remote_viewer_start()
Coverity warns that 'type' can sometimes be used or free after already having
been freed.  This can happen when open_recent_dialog is true and we jump back up
to the retry_dialog label.  To prevent this, make sure the freed variables are
set to NULL after freeing.
2014-06-03 11:13:14 -05:00
Jonathon Jongsma
3e9d9266d9 Improve remote-viewer connection dialog
Based on the new design for the 'connect to server' dialog from Nautilus.
2014-06-03 11:11:09 -05:00
Marc-André Lureau
7e13de0c32 Fix race with metacity in fullscreen
To avoid some races with metacity, the window should be placed as
early as possible, before it is (re)allocated & mapped (rhbz#809546).
2014-04-17 11:48:01 +02:00
Marc-André Lureau
5ab6eb7b33 build-sys: man Makefile.am misc improvements
Make it silent.
Ship man files in tarball.
Use maintainer-clean instead of distclean (which is for files generated
by configure in general).
2014-04-17 11:48:01 +02:00
Marc-André Lureau
e423cb4879 man: remove Perl header
Remove "User Contributed Perl Documentation" header.
2014-04-17 11:48:00 +02:00
Jonathon Jongsma
d098eee198 Fix gtk2 build
Previous commit accidentally broke gtk2 build by using
gtk_widget_get_preferred_size().  We can't simply use gtk_widget_size_request()
for the gtk2 build since this will generally return 50x50 whenever we're not in
the middle of a resize, so we need to add a compatibility function.
2014-04-08 10:21:02 -05:00
Christophe Fergeau
125ee741ae man: Use nicer link to GPLv2
As pointed out by Eric Blake,
https://www.gnu.org/licenses/gpl-2.0.html and
https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
both point to the same location, with the former being nicer to read.
2014-04-07 09:08:32 +02:00
Christophe Fergeau
de91f40ca4 man: Fix 'concatonated' typo
This also removes an extra 'are' in the same sentence.
2014-04-04 14:49:20 +02:00
Christophe Fergeau
6d5f3936d0 man: Fix link to GPLv2 text
The unversionned http links point to the GLPv3 text while virt-viewer is
still licensed under the GPLv2.
2014-04-04 14:49:20 +02:00
Christophe Fergeau
08eacf3181 man: Add missing '.' at end of one sentence 2014-04-04 14:49:20 +02:00
Christophe Fergeau
7f0656a861 Update user-visible copyright information
Years in copyright notices in the about dialog and man pages is at most
2012, let's set it to 2014
2014-04-04 14:49:20 +02:00
Christophe Fergeau
3232dd743b build-sys: Always prepend '-' to build id
When using the --with-buildid configure paramater, the build id which is
substituted in the MSI wxs file is automatically prepended by a '-', but
the build id which is used in the C files does not get this '-'
automatically.

Currently, the linux and mingw spec files prepend a '-' on their own to the
--with-buildid argument, but this causes the MSI installer to show 2 '-'
during installation: "Please wait while Windows configures VirtViewer
0.6.0--1"

This commit always prepends a '-' to the buildid strings, and removes the
'-' from the spec files. This is to ensure the separator between version
number and buildid is not forgotten, which could give a confusing version
number.
2014-04-04 14:49:20 +02:00
Jonathon Jongsma
f1cadccb9a Fix regression with enabling additional displays
Commit 8fa942 broke enabling of additional displays. We don't want to send down
display re-configurations due to events that happen while setting up windows for
enabled displays that we recieve from the server. However, by ignoring
allocations on unmapped windows, we fail to send display configurations for new
displays that a user is attempting to enable via the window menu. To
discriminate between these two cases, we check whether the display is in the
'ready' state or not.
- Unmapped displays with the 'ready' hint set can be assumed to be displays
  that are enabled on the server that we are attempting to create windows for on
  the client. In this case, we should *not* send a display configuration to the
  server
- Unmapped displays with the 'ready' hint cleared can be assumed to be displays
  that are not yet enabled on the server that we are trying to enable in the
  client. In this case, we *should* send a display configuration to the server
2014-03-27 09:43:00 -05:00
Martin Kletzander
b6d2744bae Fix building with older spice-gtk
Due to spice-gtk-0.23 missing SPICE_GTK_CHECK_VERSION macro, the
condition:

causes the following error:

virt-viewer-session-spice.c: In function 'virt_viewer_session_spice_main_channel_event':
virt-viewer-session-spice.c:525:64: error: missing binary operator before token "("
 #if defined(SPICE_GTK_CHECK_VERSION) && SPICE_GTK_CHECK_VERSION(0, 23, 21)
                                                                ^
Also one more warning is fixed in this patch:

virt-viewer-session-spice.c:476:19: warning: unused variable 'error'
[-Wunused-variable] const GError *error;
                                  ^

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-03-14 09:09:13 +01:00
Christophe Fergeau
e0e25be56d Fix 'silentely' typo in remote-viewer man page 2014-03-14 09:01:50 +01:00
Christophe Fergeau
eb65226a9d Don't show 'do you want to quit' dialog in kiosk mode
In some situation, (for example, guest without vdagent running), it's
possible to pass key combinations to virt-viewer. When using alt+f4,
this can cause the 'do you want to quit?' dialog to show while it's
non-functional.
This commit moves the check for kiosk mode to before we show this dialog.
2014-03-14 09:01:31 +01:00
Jonathon Jongsma
fe167a6668 Fix broken 'release-cursor' accel when not specified in --hotkeys
When the --hotkeys option is given, all hotkeys that are not explicitly
specified are disabled.  The method used to disable hotkeys is to change the
accel map entry to key=0, mods=0. However, when we decide whether to set a grab
sequence on the spice dispay widget, we simply use the return value for
gtk_accel_map_lookup_entry and assume that a TRUE value returned from this
function means that the hotkey is enabled.  In reality, this function will
return TRUE for disabled hotkeys, but the 'key' variable will be set to key=0,
mods=0. The result is that if I start virt-viewer like this:

    virt-viewer --hotkeys secure-attention=ctrl+alt+end ...

and the guest that I'm attached to uses server mouse mode, it will be impossible
to release the grab on the spice widget.  Because we will explicitly disable the
grab keys in the spice widget and handle the 'release-cursor' hotkey in
virt-viewer, but the hotkey is an empty accel key.

Instead of simply checking the return value of gtk_accel_map_lookup_entry, we
have to inspect the return value for 'key' and check whether any keys are
actually assigned.
2014-03-13 10:13:42 -05:00
Jonathon Jongsma
02fb004a8e Don't create new windows at startup when kiosk mode is false
virt_viewer_app_set_kiosk creates a new window at startup for each client
monitor (regardless of whether the guest supports more than one display).  This
seems unnecessary.  Only do this if kiosk mode is actually enabled.
2014-03-13 10:13:42 -05:00
Jonathon Jongsma
91e772b5e6 Remove special-case for getting window n=0
virt_viewer_app_get_nth_window() will return the proper window when passed 0 for
the 'nth' argument, so there's no need to avoid calling it in this case.  It
just complicates the code logic.
2014-03-13 10:13:42 -05:00
Jonathon Jongsma
8fa9423bd8 Don't resize guest display on zoom change
When the zoom level is changed, the virt-viewer window gets resized. But we
don't want this to trigger a resize of the guest display. But occasionally
rounding errors cause the guest display to be reconfigured when zooming out.  To
fix this, we first check whether the current size is the preferred size.  If it
is, we don't send down a resize command to the guest.

In addition to preventing guest resizes in response to zooming, it also improves
the behavior when the guest display resolution is changed from within the guest.
Before this change, we'd have the following behavior:
    A. guest changes display to WxH
    B. client gets notified of change and resizes the window to WxH
    C. client responds to window resize by sending a new monitor config command to the guest

With this change, the extra step C will be avoided because we're already at the
preferred size.

Resolves: rhbz#1004051
2014-03-13 10:13:42 -05:00
Marc-André Lureau
d33e6b1a49 Use a USB icon in the fullscreen toolbar
Replace the generic GTK_STOCK_PREFERENCES with a more appropriate USB icon.

The icon was provided by Jakub Steiner <jsteiner@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=804184
2014-03-13 12:57:14 +01:00
Marc-André Lureau
c3cbdef888 Remove "Automatically resize" menu
Remove "Automatically resize" menu item (always enabled for Spice
display now)

https://bugzilla.redhat.com/show_bug.cgi?id=1007649
2014-03-13 12:57:14 +01:00
Marc-André Lureau
4b283b26a9 Silence a message about missing configuration file
Do not print a g_debug() error when the configuration file is missing,
unless given the --debug option.

https://bugzilla.redhat.com/show_bug.cgi?id=1006737
2014-03-13 12:57:14 +01:00
Daniel P. Berrange
f2c4a99b6e Fix scaling of window upon resize
The code to determine scaling of windows was incorrectly
using the original desktop size instead of the host screen
size. The 128 pixel fudge factor was also causing windows
to be scaled when there was no need for them to be.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-03-12 17:34:47 +00:00
Jonathon Jongsma
03035cf69e Revert "Don't resize guest display on zoom change"
This reverts commit 895ef8029e794e7b74a45f27c7c741d1332bc02b.
2014-03-06 14:12:52 -06:00
Christophe Fergeau
8f0dd93e8f spec: Don't disable spice support on some archs
Nowadays spice-gtk no longer has an ExclusiveArch: x86 x86_64 %{arm}
virt-viewer can be built with spice-gtk support on all arches.
2014-02-27 10:06:40 +01:00
Jonathon Jongsma
895ef8029e Don't resize guest display on zoom change
When the zoom level is changed, the virt-viewer window gets resized. But we
don't want this to trigger a resize of the guest display. But occasionally
rounding errors cause the guest display to be reconfigured when zooming out.  To
fix this, we first check whether the current size is the preferred size.  If it
is, we don't send down a resize command to the guest.

In addition to preventing guest resizes in response to zooming, it also improves
the behavior when the guest display resolution is changed from within the guest.
Before this change, we'd have the following behavior:
    A. guest changes display to WxH
    B. client gets notified of change and resizes the window to WxH
    C. client responds to window resize by sending a new monitor config command to the guest

With this change, the extra step C will be avoided because we're already at the
preferred size.

Resolves: rhbz#1004051
2014-02-26 13:50:58 -06:00
Marc-André Lureau
7212c8745a spice: do not open in fullscreen with CONTROLLER_AUTO_DISPLAY_RES
This flag is always set when using the rhevm user portal. Best is
probably to ignore it, now that fullscreen has simplified unique
behaviour.
2014-02-26 12:42:20 +01:00
Marc-André Lureau
d1d53d0c8b spice: ask credentials for proxy
If Spice proxy requires authentication, ask credentials and try
connecting again.
2014-02-24 16:36:09 +01:00
Marc-André Lureau
57d1175051 Fix a gcc warning when compiling with mingw32 2014-02-24 16:36:09 +01:00
Daniel P. Berrange
843910a522 Fix german translation of send key
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-02-24 10:20:44 +00:00
Daniel P. Berrange
7d7d324387 Improve docs for --attach flag in virt-viewer
People seem to have a hard time understanding the --attach flag.
Rewrite the docs in the hope that people figure it out this time.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-02-24 10:19:58 +00:00
Jonathon Jongsma
74b532f1ec rhbz#1007306 - Don't free session if we're re-trying auth
deactivate() is called in response to a failed authentication attempt. If the
session is cleared here, when a user attempts to re-authenticate, it will issue
a warning and will not actually work. So only clear the session here if we're
not going to re-try authentication.
2014-02-13 09:09:13 -06:00
Jonathon Jongsma
51c3a0decf Don't set VNC display to ready until vnc is initialized
We were setting the show_hint to READY as soon as we got the vnc-connected
signal.  But there may be an authentication step between vnc-connected and
vnc-initialized.  In this case, we switch to an empty black display during the
authentication step instead of showing the 'waiting for display N' status.
2014-02-13 09:09:13 -06:00
Jonathon Jongsma
ed9b3f3450 Don't hide the main window when disconnecting
The main window (display #1) is treated a bit differently from other windows,
since it is opened at app start and displays status messages while we attempt to
connect to the remote guest.  As such, it should really stay open as long as the
app is running.

The impetus for this change is the following:
- user attempts to connect to a remote VNC display with a password
- user types the wrong password
- A dialog pops up indicating that authentication failed and asking if the user
  would like to try to re-connect.
- User clicks 'Yes'
- Because the connection was disconnected, all windows are closed
- remote-viewer tries to reconnect again, at which point a new display window is
  opened, and the window gets placed by the window manager (possibly on another
  monitor altogether).

As a user, I expect the program to simply re-use the existing window when trying
to re-authenticate, instead of having the window disappear and then re-appear at
a different location.  This patch accomplishes that.
2014-02-13 09:09:13 -06:00
Jonathon Jongsma
dce19b379a Move vnc-specific auth logic to VirtViewerSessionVnc 2014-02-13 09:09:13 -06:00
Jonathon Jongsma
0383cc4c9b Improve window title when connected to newer spice-server
Recent spice servers send the guest vm name and uuid to the client.  We can use
these values to display the proper vm name in the window title if a title is not
specified on the commandline. We can also be smarter about the title in
virt-viewer as well.

If a title is specified on the comamndline (-t/--title=foo), we use that.  If not,
we fall back to the vm name.  If that is empty, we fall back to the uri of the
connection.

Comparison between old behavior and new behavior

Using new spice-server
Command                                     Old title                   New title
-------                                     ---------                   ---------
remote-viewer -t xyz spice://host:port      xyz                         xyz
remote-viewer spice://host:port             spice://host:port           <vmname>
virt-viewer <vmname>                        <vmname>                    <vmname>
virt-viewer <uuid>                          <uuid>                      <vmname>

Using old spice-server
Command                                     Old title                   New title
-------                                     ---------                   ---------
remote-viewer -t xyz spice://host:port      xyz                         xyz
remote-viewer spice://host:port             spice://host:port           spice://host:port
virt-viewer <vmname>                        <vmname>                    <vmname>
virt-viewer <uuid>                          <uuid>                      <vmname>
2014-02-11 11:56:43 -06:00
Jonathon Jongsma
bee13a6a59 Display warning if UI file fails
When trying to load ui files, we try to find the file in several directories.
If a file is not found in one directory, try to load it from the next directory.
However, if a file is found in a directory but we are not able to load it (e.g.
due to unsupported versions of glade used to generate it, etc), we should print
a warning to the terminal to help the developer debug the issue.

This is an unexpected failure (whereas not finding the file in that directory at
all is an 'expected' failure).
2014-02-11 11:56:37 -06:00
Daniel P. Berrange
03a3ba68a5 Update for 0.6.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-24 17:36:27 +00:00
Daniel P. Berrange
278fc60ef4 Refresh translations
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-24 17:36:27 +00:00
Daniel P. Berrange
ec31b4fd99 Fix virt-viewer.exe on win32
Libvirt uses gnulib for making winsock look like POSIX
sockets. This means that in the libvirt event handle
callbacks the application will be given a file descriptor
rather than a winsock HANDLE object. The g_io_channel_unix_new
method will detect that it is an FD and delegate to the
g_io_channel_win32_new_fd method. Unfortunately the glib Win32
event loop impl is not very good at dealing with FD objects,
simulating poll() by doing a read() on the FD :-(

The API docs for g_io_channel_win32_new_fd say

 "All reads from the file descriptor should be done by
  this internal GLib thread. Your code should call only
  g_io_channel_read()."

This isn't going to fly for libvirt, since it has zero
knowledge of glib at all, so is just doing normal read().

Fortunately we can work around this problem by turning
the FD we get from libvirt back into a HANDLE using the
_get_osfhandle() method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-24 16:51:04 +00:00
Daniel P. Berrange
b2a233b711 Don't use --nodeps for developer builds
Only use --nodeps when running under the autobuild engine

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-24 16:50:58 +00:00
Jonathon Jongsma
9f6878c35a Load ui files first from installed location
virt_viewer_util_load_ui() looks first in the current directory, and then looks
in the system data dirs for a ui file to load, but if you install virt-viewer in
a different prefix, it will load the system UI file rather than the one from the
install prefix. Try to load the ui file from pkgdatadir first.
2014-01-20 16:10:12 -06:00
Marc-André Lureau
9e2d9ba857 Clear global zoom-reset hotkey too 2014-01-07 14:42:34 +01:00
Marc-André Lureau
529cd490b8 Fix rebuild of accelerators menu when loading from file
It's not enough to set the property to notify of its change. Add a
virt_viewer_app_set_enable_accel() helper, and call it after the changes
to accelerators are made when loading from file.

I verified the menu is correctly built when connection from controller
or command line too.
2014-01-07 14:41:04 +01:00
Christophe Fergeau
a6d5acdf6a Disable mime database update during make distcheck
Updating the mime database creates files in the install directory, and
these files are not cleaned up on make uninstall, so this causes a make
distcheck failure.
2013-12-19 10:06:13 +01:00
Christophe Fergeau
71eac4bc67 spec: Get BuildRequires min versions from configure.ac
We currently duplicate the minimum requirements for the various virt-viewer
dependencies in configure.ac, virt-viewer.spec.in and mingw-virt-viewer.spec.in
This commit uses the versions set in configure.ac in the 2 .spec.in files
so that it's easier to keep them in sync

Before/after diff of the .spec files are:

--- virt-viewer.spec.or 2013-12-18 14:14:14.304285905 +0100
+++ virt-viewer.spec    2013-12-18 14:19:20.217072678 +0100
@@ -47,14 +47,14 @@
 BuildRequires: libtool
 %endif

-BuildRequires: glib2-devel >= 2.22
+BuildRequires: glib2-devel >= 2.22.0
 %if %{with_gtk3}
-BuildRequires: gtk3-devel >= 3.0.0
+BuildRequires: gtk3-devel >= 3.0
 %else
-BuildRequires: gtk2-devel >= 2.12.0
+BuildRequires: gtk2-devel >= 2.18.0
 %endif
-BuildRequires: libvirt-devel >= 0.9.7
-BuildRequires: libxml2-devel
+BuildRequires: libvirt-devel >= 0.10.0
+BuildRequires: libxml2-devel >= 2.6.0
 %if %{with_gtk3}
 BuildRequires: gtk-vnc2-devel >= 0.4.0
 %else

--- mingw-virt-viewer.spec.or   2013-12-18 14:14:23.656401693 +0100
+++ mingw-virt-viewer.spec      2013-12-18 14:20:57.007270507 +0100
@@ -12,22 +12,22 @@

 BuildRequires:  mingw32-filesystem >= 23
 BuildRequires:  mingw64-filesystem >= 23
-BuildRequires:  mingw32-glib2 >= 2.22
-BuildRequires:  mingw64-glib2 >= 2.22
+BuildRequires:  mingw32-glib2 >= 2.22.0
+BuildRequires:  mingw64-glib2 >= 2.22.0
 BuildRequires:  mingw32-gstreamer-plugins-bad-free
 BuildRequires:  mingw64-gstreamer-plugins-bad-free
 BuildRequires:  mingw32-gstreamer-plugins-good
 BuildRequires:  mingw64-gstreamer-plugins-good
-BuildRequires:  mingw32-gtk2
-BuildRequires:  mingw64-gtk2
+BuildRequires:  mingw32-gtk2 >= 2.18.0
+BuildRequires:  mingw64-gtk2 >= 2.18.0
 BuildRequires:  mingw32-libusbx
 BuildRequires:  mingw64-libusbx
-BuildRequires:  mingw32-libvirt >= 0.9.7
-BuildRequires:  mingw64-libvirt >= 0.9.7
-BuildRequires:  mingw32-libxml2
-BuildRequires:  mingw64-libxml2
-BuildRequires:  mingw32-gtk-vnc >= 0.4.3
-BuildRequires:  mingw64-gtk-vnc >= 0.4.3
+BuildRequires:  mingw32-libvirt >= 0.10.0
+BuildRequires:  mingw64-libvirt >= 0.10.0
+BuildRequires:  mingw32-libxml2 >= 2.6.0
+BuildRequires:  mingw64-libxml2 >= 2.6.0
+BuildRequires:  mingw32-gtk-vnc >= 0.3.8
+BuildRequires:  mingw64-gtk-vnc >= 0.3.8
 BuildRequires:  mingw32-readline
 BuildRequires:  mingw64-readline
 BuildRequires:  mingw32-spice-glib
2013-12-18 15:42:24 +01:00
Christophe Fergeau
ae14b5b390 Update spice-gtk requirement everywhere
d1c2bc1 updated configure.ac spice-gtk requirement to 0.22, but did not
update the various places which duplicated this requirement, namely the
.spec.in files and the README file.
2013-12-18 15:42:24 +01:00
Christophe Fergeau
abf13d38b3 Update shared mime database on install/uninstall
remomte-viewer installs a file to $datadir/share/mime to register a
mime-type for its .vv files. However, after installing this file,
update-mime-database must be run in order to update the shared mime
database. This commit (inspired by what Nautilus/planner are doing) adds
what is needed for that.
If the mime type is not correctly registered, gvfs-info console.vv will not
return the correct mime type, and xdg-open console.vv will fail to start
remote-viewer, and will fall back to running gedit as the .vv file is a
text file.

https://bugzilla.redhat.com/show_bug.cgi?id=1044209
2013-12-18 14:20:39 +01:00
Jonathon Jongsma
8ae2199aa7 Enable the display before showing the window
This ensures that the display is enabled when it gets its first Allocate event
(which causes a display reconfiguration).  If the display is not enabled at this
point, it won't send down a new monitors_config message until the second
allocation, which may result in the display being disabled until a window is
resized.
2013-12-16 11:24:19 -06:00
Marc-André Lureau
d1c2bc17fa build-sys: require spice-gtk >= 0.22
Require 0.22 fro spice_uuid_to_string()
2013-12-16 18:10:39 +01:00
Christophe Fergeau
63671a00b3 Disable govirt support on f19
The govirt package in f19 is an older one, and does not have some of the
functions used since the switch to govirt 0.3.0. As 0.3.0 broke ABI, it's
not convenient to backport it to f19.
Update the spec file to reflect the fact that oVirt support in git is no
longer buildable on f19.
2013-12-13 16:01:05 +01:00
Marc-André Lureau
f4b7f3321c app: remove useless warning
This warning should have been removed with 20eb200c.

https://bugzilla.redhat.com/show_bug.cgi?id=1021350
2013-12-11 00:26:54 +01:00
Marc-André Lureau
9ad08231ca remote-viewer: add desktop icon
Associate an icon to desktop menu entry.
https://bugzilla.redhat.com/show_bug.cgi?id=1020359
2013-12-11 00:26:54 +01:00
Jonathon Jongsma
b82e238354 Remove obsolete function declaration
This function was removed in bd914bdea2e85d62d5f67eb567ce200f526c6bab, but the
declaration was missed.
2013-12-10 11:13:17 -06: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
81f70304ed Don't re-configure displays when show-hint changes
This caused secondary displays on a windows guest to flicker under some
circumstances. The old code didn't re-configure displays in this case either, so
it shouldn't have been included in the display alignment refactor.
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
Jonathon Jongsma
c57f0f3df9 Ensure all windows obey initial --zoom setting
There are cases where multiple VirtViewerWindow objects are created before the
VirtViewerApp constructor has a chance to run. Since the constructor has not yet
run, priv->main_window will still be NULL, the test in
virt_viewer_app_window_new() will fail, and they will not get their initial zoom
level set.  When the constructor finally runs, it set the zoom level of the main
window to the value set on the command line, but all other windows that had
already been created retained the default 100% zoom level.

By creating the main_window in the instance init function, we ensure that the
main window is created before we get any 'session-display-added' signals and all
displays will start out with consistent zoom levels.
2013-11-21 12:41:17 -06:00
Jonathon Jongsma
d1df937e01 Remove non-functional VIRT_VIEWER_HIDE env behavior
VIRT_VIEWER_HIDE could be set as an environment variable to (theoretically) hide
displays whenever they were not ready.  Unfortunately, this bit of functionality
appears bitrotten and doesn't work anymore (it prevents windows from opening
when you click 'view > displays > display 2', for instance).
2013-11-21 11:46:33 -06:00
Jonathon Jongsma
36c558f6c2 separate fullscreen_set_active into a separate function 2013-11-20 11:09:39 -06:00
Jonathon Jongsma
d9e14ff375 Ensure auto-conf is only done once
Auto-conf should only happen at startup. It is triggered from several places due
to the somewhat unreliable ordering of events, but that doesn't mean we want to
run it several times. This patch ensures that we only do it once.
2013-11-20 10:58:52 -06:00
Jonathon Jongsma
764a504726 Add ability to define custom display->monitor mapping per vm
Fullscreen mode generally just assigns display 1 to monitor 1, display 2 to
monitor 2, etc. For custom setups, you can define a monitor mapping in the
settings keyfile per-vm. This requires a vm uuid (so only works in virt-viewer
or on versions of spice-server that send the uuid over the wire).  The format is
pretty basic:

    [6485b20f-e9da-614c-72b0-60a7857e7886]
    monitor-mapping=2;3

The group name ("6485b20f-e9da-614c-72b0-60a7857e7886") is the uuid id of the
vm. This group has a single key: monitor-mapping. This key is an array of
integers describing the order in which to assign the monitors to a guest
display. Any monitors that are not listed in this array will not be configured
at startup.  For instance:

    monitor-mapping=2;1

will attempt to configure 2 displays on the guest and assign the first display
to monitor 2 and the second display to monitor 1.

    monitor-mapping=2

will only configure a single display on the guest and place it on the second
monitor.  Any monitor numbers listed in the keyfile are greater than the number
of monitors that are physically present, they will be ignored.
2013-11-20 10:58:52 -06:00
Christophe Fergeau
609b8d4a54 Fix leak of VirtViewerApp::windows hash table key
The VirtViewerApp::windows hash table owns the memory for both the keys
and values it stores. virt_viewer_app_remove_nth_window() uses
g_hash_table_steal() which does not call the 'free' function neither for
the key nor for the value. This method takes care of releasing the
reference for the value it extracted from the hash table, but not for the
key.
This commit fixes by explicitly taking a reference on the value rather than
stealing the one held by the hash table. We can then replace the use of
g_hash_table_steal() with g_hash_table_remove() which will take care of
freeing the removed key.
2013-11-20 14:47:00 +01:00
Christophe Fergeau
2890749b7d session: Don't hold VirtViewerDisplay refs on channel destroy
VirtViewerSessionSpice creates a reference-holding VirtViewerDisplay
array and associates it with the display SpiceChannel with
g_object_set_data(channel, "virt-viewer-displays").

When virt_viewer_session_spice_channel_destroy() is called and the display
channel is being destroyed, we should ensure these VirtViewerDisplay
references are dropped or the displays could outlive the session.

In my testing (start qemu with a f20 live cd, connect to it, when the
kernel has started booting and qxl is initialized (4 displays listed in the
display submenu), kill qemu), I was getting "invalid unclassed pointer in
cast to 'VirtViewerSessionSpice'" warnings through

    #0  0x00000035bac504e9 in g_logv (log_domain=0x35bb039aa4 "GLib-GObject",
        log_level=G_LOG_LEVEL_WARNING, format=<optimized out>,
        args=args@entry=0x7fffffffc7c0) at gmessages.c:989
    #1  0x00000035bac5063f in g_log (
        log_domain=log_domain@entry=0x35bb039aa4 "GLib-GObject",
        log_level=log_level@entry=G_LOG_LEVEL_WARNING,
        format=format@entry=0x35bb041010 "invalid unclassed pointer in cast to '%s'")
        at gmessages.c:1025
    #2  0x00000035bb032e09 in g_type_check_instance_cast (type_instance=0x665580,
        iface_type=<optimized out>) at gtype.c:4025
    #3  0x0000000000426e9f in get_main (self=0x894190) at virt-viewer-display-spice.c:92
    #4  0x0000000000426ece in show_hint_changed (self=0x894190)
        at virt-viewer-display-spice.c:100
    #5  0x00000035bb010298 in g_closure_invoke (closure=0x9f47c0,
        return_value=return_value@entry=0x0, n_param_values=2,
        param_values=param_values@entry=0x7fffffffcad0,
        invocation_hint=invocation_hint@entry=0x7fffffffca70) at gclosure.c:777
    #6  0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x651f60,
        detail=detail@entry=1782, instance=instance@entry=0x894190,
        emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffffffcad0) at gsignal.c:3586
    #7  0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>,
        var_args=var_args@entry=0x7fffffffcc60) at gsignal.c:3330
    #8  0x00000035bb02a3af in g_signal_emit (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #9  0x00000035bb014945 in g_object_dispatch_properties_changed (object=0x894190,
        n_pspecs=92, pspecs=0x0) at gobject.c:1047
    #10 0x00000035bb017019 in g_object_notify_by_spec_internal (pspec=<optimized out>,
        object=0x894190) at gobject.c:1141
    #11 g_object_notify (object=0x894190, property_name=<optimized out>) at gobject.c:1183
    #12 0x000000000041b617 in virt_viewer_display_set_show_hint (self=0x894190, mask=1,
        enable=0) at virt-viewer-display.c:659
    #13 0x000000000042712c in update_display_ready (self=0x894190)
        at virt-viewer-display-spice.c:156
    #14 0x00000035bb010298 in g_closure_invoke (closure=0x6ba480,
        return_value=return_value@entry=0x0, n_param_values=2,
        param_values=param_values@entry=0x7fffffffcfb0,
        invocation_hint=invocation_hint@entry=0x7fffffffcf50) at gclosure.c:777
    #15 0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x651f60,
        detail=detail@entry=1798, instance=instance@entry=0xa2c250,
        emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffffffcfb0) at gsignal.c:3586
    #16 0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>,
        var_args=var_args@entry=0x7fffffffd140) at gsignal.c:3330
    #17 0x00000035bb02a3af in g_signal_emit (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #18 0x00000035bb014945 in g_object_dispatch_properties_changed (object=0xa2c250,
        n_pspecs=92, pspecs=0x0) at gobject.c:1047
    #19 0x00000035bb017019 in g_object_notify_by_spec_internal (pspec=<optimized out>,
        object=0xa2c250) at gobject.c:1141
    #20 g_object_notify (object=0xa2c250, property_name=<optimized out>) at gobject.c:1183
    #21 0x00007ffff7044d9a in update_ready (display=0xa2c250) at spice-widget.c:257
    #22 0x00007ffff7044df0 in set_monitor_ready (self=0xa2c250, ready=0)
        at spice-widget.c:265
    #23 0x00007ffff7049bb3 in primary_destroy (channel=0x9f40b0, data=0xa2c250)
        at spice-widget.c:2131
    #24 0x00007ffff704afd5 in channel_destroy (s=0x892880, channel=0x9f40b0, data=0xa2c250)
        at spice-widget.c:2444
    #25 0x00000035bb010298 in g_closure_invoke (closure=0xa27850,
        return_value=return_value@entry=0x0, n_param_values=2,
        param_values=param_values@entry=0x7fffffffd570,
        invocation_hint=invocation_hint@entry=0x7fffffffd510) at gclosure.c:777
    #26 0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x7cf600,
        detail=detail@entry=0, instance=instance@entry=0x892880,
        emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffffffd570) at gsignal.c:3586
    #27 0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>,
        var_args=var_args@entry=0x7fffffffd700) at gsignal.c:3330
    #28 0x00000035bb02a3af in g_signal_emit (instance=<optimized out>,
        signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #29 0x00007ffff6ceba87 in spice_session_channel_destroy (session=0x892880,
        channel=0x9f40b0) at spice-session.c:1923
    #30 0x00007ffff6cecf05 in spice_channel_dispose (gobject=0x9f40b0)
        at spice-channel.c:149
    #31 0x00007ffff6cf912c in spice_display_channel_dispose (object=0x9f40b0)
        at channel-display.c:136
    #32 0x00000035bb014ee8 in g_object_unref (_object=0x9f40b0) at gobject.c:3160
    #33 0x00007ffff6cf300c in spice_channel_delayed_unref (data=0x9f40b0)
        at spice-channel.c:2135
    #34 0x00000035bac492a6 in g_main_dispatch (context=0x67a6b0) at gmain.c:3066
    #35 g_main_context_dispatch (context=context@entry=0x67a6b0) at gmain.c:3642
    #36 0x00000035bac49628 in g_main_context_iterate (context=0x67a6b0,
        block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
        at gmain.c:3713
    #37 0x00000035bac49a3a in g_main_loop_run (loop=0x7baf60) at gmain.c:3907
    #38 0x00000035bfdaa2d5 in gtk_main () at gtkmain.c:1158
    #39 0x000000000042caf1 in main (argc=1, argv=0x7fffffffdc78) at remote-viewer-main.c:179

In that backtrace, the last ref to the VirtViewerDisplay instances is held by the
SpiceChannel:virt-viewer-displays object data which will only be released after
completion of spice_display_channel_dispose()
2013-11-20 10:44:53 +01:00
Christophe Fergeau
5c451b68c9 Remove obsolete use of SpiceChannel:virt-viewer-display object data
Commit 0d58d9c72 removed the setting of the
SpiceChannel:virt-viewer-display object data, but there was still a
call to g_object_get_data() trying to use it. Since it's only used to
output a debug log, we can remove this call and fix up the debug log.
2013-11-20 10:44:53 +01:00
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
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 0dca975d64fcf0782ec7b3e3bd965f1bcf47c528 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
c8e5b8e3b0 msi: use ProductVersion compatible with Windows Installer
Windows Installer expects version of form major.minor.build in order to
perform updates.

Following Daniel Berrange suggestion, compute a ProductVersion
compatible with this scheme by shifting virt-viewer "micro" release
number and adding the extra "buildid".
2013-07-30 21:08:26 +02:00
Marc-André Lureau
460a463c81 wxs: add usb.ids and keyboard-shortcuts.png 2013-07-30 21:05:14 +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
Daniel P. Berrange
4f31e16ba5 Remove typo \\n in de.po translation
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-29 12:03:35 +01: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
Daniel P. Berrange
ac4c71a3f0 Refresh translations from transifex
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-09 21:12:23 +01: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
Marc-André Lureau
85892affca data/remote-viewer.desktop: Fix missing trailing ;
data/remote-viewer.desktop: error: value
"x-scheme-handler/spice;application/x-virt-viewer" for string list key
"MimeType" in group "Desktop Entry" does not have a semicolon (';') as
trailing character
2013-07-04 16:30:22 +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
Christophe Fergeau
16df26cf5f spec: Add missing % in %if 0{?fedora}
This was missing in previous commit.
2013-06-04 18:26:13 +02:00
Christophe Fergeau
18636794dc spec: Deprecate spice-client
This has been true for quite some time, it's high time we stop
building spicec and have remote-viewer replace it on upgrades.
2013-06-04 18:13:16 +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
9ddce05ce7 man: document auto-conf fullscreen option
https://bugzilla.redhat.com/show_bug.cgi?id=875559
2013-05-24 17:40:47 +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
2c1e7c18bf build-sys: add debug-helper rule 2013-05-23 17:30:59 +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
Marc-André Lureau
17e3c48d0a Fix trivial critical
GLib-CRITICAL **: g_strv_length: assertion `str_array != NULL'

Committed without review under trivial rule.
2013-05-21 18:25:16 +02:00
Marc-André Lureau
240baeeb44 Show connect dialog again if connection from dialog failed
https://bugzilla.redhat.com/show_bug.cgi?id=864026
2013-05-17 14:15:06 +02:00
Marc-André Lureau
6ed73f150c spice-session: use a more robust signal connect
The Spice session may outlive the virt-viewer session, due to it's async
nature. Use the more robust virt_viewer_signal_connect_object() to fix
delayed potential crashes.
2013-05-17 14:15:06 +02:00
Marc-André Lureau
79255e80d5 Move connect dialog to remote-viewer.c 2013-05-17 14:15:06 +02:00
Marc-André Lureau
93ac885838 Silence unused arguments warnings
In file included from virt-viewer-session-spice.c:41:
gbinding.c: In function 'on_source_notify':
gbinding.c:381: warning: unused parameter 'gobject'
gbinding.c: In function 'on_target_notify':
gbinding.c:422: warning: unused parameter 'gobject'
gbinding.c: In function 'g_binding_init':
gbinding.c:709: warning: unused parameter 'binding'
2013-05-16 21:54:48 +02:00
Marc-André Lureau
ccd2882cce Rename variable, fix gcc warning
virt-viewer-main.c:61: warning: declaration of 'basename' shadows a global declaration
2013-05-16 21:54:48 +02:00
Marc-André Lureau
d0d8a9fba0 Remove the "container" logic used by legacy browser plugin 2013-05-16 21:54:48 +02:00
Marc-André Lureau
79fd2ea3d0 window: wait until mapped before fullscreen
On RHEL6, when starting virt-viewer --full-screen, metacity will
remaximize & force-fullscreen when leaving fullscreen, which prevents
user from accessing window titlebar, and end up with an incorrect
fullscreen state.

Thanks Owen Taylor for help debugging this:

<owen> elmarco: So the interesting thing here is that the "legacy" isn't
       triggered off a configure request to a particular size, mutter seems to
       constrain the window back to fullscreen size on its own when it sees a
       change to WM_NORMAL_HINTS
<owen> commit 4943d79d6844af3f7fc0a15ceadb69d95c4c5c61
<owen> Author: Peter Bloomfield <PeterBloomfield@BellSouth.net>
<owen> Date:   Wed Jan 20 10:59:07 2010 -0500
<owen>     prevent window self-maximisation
<owen> Is not in rhel6 metacity
<owen> So probably that's the main difference
<owen> can you just make your program not fullscreen initially but wait until
       it's mapped? (gets map-event on the toplevel)
<elmarco> owen that seems to work
<owen> I don't have a better solution to offer - sorry for the ugliness (code and
       initial mapping appearance)

https://bugzilla.redhat.com/show_bug.cgi?id=876445
2013-05-16 21:54:48 +02:00
Marc-André Lureau
63ad7719b9 Only fullscreen the new window
The current code will forcefully reset fullscreen all windows
when a new window is created
2013-05-16 21:54:48 +02:00
Marc-André Lureau
a8c71751cd window: leave fullscreen on current window
Since fdaa9b0ca, virt-viewer allows to fullscreen a single window. It
feels more symetric to leave a single window from fullscreen as well,
unless the application was started in fullscreen.
2013-05-14 14:49:35 +02:00
Marc-André Lureau
0f6dd1f379 window: fix send key menu popup position
Fix send key menu popup position.

The current code wasn't correctly translating the menu coordinates
based on the toplevel windows position, it was always using origin 0.

https://bugzilla.redhat.com/show_bug.cgi?id=913601
2013-05-14 02:29:08 +02:00
Marc-André Lureau
b0557015a9 man: document running remote-viewer without URI
https://bugzilla.redhat.com/show_bug.cgi?id=882133
2013-05-13 14:26:45 +02:00
Marc-André Lureau
9b1ad0b118 Add -- to seperate program arguments to server in man / --help
Since some of the arguments are expecting following value, make it more
explicit in the man and --help that -- can seperate options from server
name or location.

https://bugzilla.redhat.com/show_bug.cgi?id=843103
2013-05-13 14:26:45 +02:00
Marc-André Lureau
fdaa9b0ca8 Allow to fullscreen and position display independently
Currently, going from window to fullscreen mode changes all display to
fullscreen and realize automatic positionning on corresponding client
monitor. However, it allows for much more flexibility to allow entering
fullscreen on the current monitor each windows seperately. This way the
user can decide on arbitrary monitor arrangement.

https://bugzilla.redhat.com/show_bug.cgi?id=558241
2013-05-13 14:26:45 +02:00
Marc-André Lureau
f3003c6aa6 spice: make sure display ready hint is sync after creation
The ready state can be set during construction time and
not notified immediately.
2013-05-13 14:26:45 +02:00
Marc-André Lureau
3293be3f93 misc: fix typo 2013-05-13 14:26:45 +02:00
Marc-André Lureau
d1fd8c3f66 Do not restrict disabling display to != 0
Virt-viewer hides the display window 0, but doesn't disable the display.
This is inconsistent with other displays, and prevent the guest OS from
reconfiguring the main display.

(for monitor 0 to be really disabled in multi-monitor guest, the agent
need to support sparse monitor config. If not, the first display windows
will be reopened to match the new un-sparse configuration)

Note also the current Linux vdagent crashes when disabling 1st monitor,
to be solved seperately.

Related bug:
https://bugzilla.redhat.com/show_bug.cgi?id=958550
2013-05-13 14:26:45 +02:00
Marc-André Lureau
153ec66b9c remote-viewer: set auto-conf before fullscreen
If a monitor is already in fullscreen, setting auto-conf to true will
not move it until it is re-fullscreen

This was unnoticed, because usually, the first client window is opened
on the first monitor. Also we may argue than relying on g_object_set()
property order is lame and fragile, we better split it in two seperate
calls as this might break upstream.

https://bugzilla.redhat.com/show_bug.cgi?id=872288
2013-05-03 18:56:26 +02:00
Daniel P. Berrange
a68687fa83 Sync spec with Fedora 2013-05-01 17:40:06 +01:00
Daniel P. Berrange
d3de53aa5e Post release version bump 2013-05-01 17:15:02 +01:00
Daniel P. Berrange
1dd4e667af Set PKG_CONFIG_LIBDIR variable for mingw builds
To avoid pkg-config accidentally falling back to
native versions, set the PKG_CONFIG_LIBDIR var
explicitly

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-01 16:11:07 +01:00
Daniel P. Berrange
1cd871cb66 Set a default value for AUTOBUILD_INSTALL_ROOT
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-01 16:11:06 +01:00
Daniel P. Berrange
c330f40a0c Set MANUFACTURER env variable when running wixl
The MANUFACTURER env variable is mandatory since it is used
in the data files. wixl will exit with parser error if it
is not set

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-01 16:11:06 +01:00
Daniel P. Berrange
52c3ae39a0 Add missing include of config.h 2013-05-01 16:11:06 +01:00
Daniel P. Berrange
a763065b32 Remove tab from source file 2013-05-01 16:11:06 +01:00
Daniel P. Berrange
8e68bbca82 Refresh translations from transifex
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-01 16:11:06 +01:00
Marc-André Lureau
dac6351757 file: add delete-this-file option
In case the virt-viewer setting file is meant to temporary, you may use
the delete-this-file=1 option to ask the client to remove it, once it
has been read. This is useful for example in ovirt context, where
connection settings file are generated and can't be reused.
2013-04-30 02:26:36 +02:00
Christophe Fergeau
20eb200ca5 Exit virt-viewer when trying to close any window
Currently, in multi-screen scenarios, when closing one remote-viewer
window, the corresponding screen gets disabled in the guest OS.
This can be confusing as this behaves very differently from
File/Quit. This commit will exit the whole application when the user
tries to close one of virt-viewer window.
2013-04-25 22:16:04 +02:00
Hans de Goede
284aecf0ce gtk-3: Rework window size handling
With gtk-2 we have a special hack, where at first we make the
virt-viewer-display request its actual size, and then once the window is
mapped, we request a size of 50x50 to allow the user to resize the window
to something smaller.

With gtk-3 >= 3.8.1 this is broken, and the window gets resized to a
smaller size as soon as we change the size request to 50x50.

gtk-3 has a much better way of dealing with this in the form of widgets
being able to specify both a minimal and a natural size. This patch changes
virt-viewer to use this with gtk-3, instead of the gtk-2 hack.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-23 13:49:24 +02:00
Hans de Goede
d78dd5bd99 ovBox: Make get_preferred_width/height differentiate between min and natural
gtk-3's widget size negotiation code differentiates between the minimum
size and the natural size of a widget, fix ovBox to pass this along from
its underlying widget to its parent.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-23 13:49:24 +02:00
Hans de Goede
24182b5be8 virt-viewer-window: cleanup zoom handling
We've 3 similar zoom function zoom in / out / reset. in / out do not
schedule a window resize when there is no display, where as reset does,
which is not consistent. Also there is some duplicate code between them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-23 13:49:24 +02:00
Hans de Goede
f0a103fa86 virt-viewer-display: Use virt_viewer_display_queue_resize where possible
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-23 13:49:24 +02:00
Marc-André Lureau
356e635844 mingw spec: fix x64 msi location 2013-04-23 12:50:23 +02:00
Marc-André Lureau
9fdc1b55df Prepeare notes for release 0.5.6 2013-04-15 16:47:01 +02:00
Marc-André Lureau
29f7ee33ca msi: build correct 64-bit msi 2013-04-15 16:46:48 +02:00
Marc-André Lureau
d5daa55fe8 msi: fix icon location 2013-04-15 16:46:48 +02:00
Marc-André Lureau
dbb1cfc046 build-sys: generate MSI installer instead of NSIS 2013-04-15 16:46:48 +02:00
Marc-André Lureau
4e24da29e7 build-sys: regenerate spec files when they change 2013-04-15 16:46:47 +02:00
Marc-André Lureau
fdb2e4714a spice: forward secure-channels
This needs spice-gtk >= 0.19.7 and will warn with lower version
2013-04-15 16:46:47 +02:00
Christophe Fergeau
d4ad5af70f Remove redundant check, g_strdup(NULL) is allowed
This also makes the code consistent with its surroundings.
2013-04-13 19:02:05 +02:00
Christophe Fergeau
898690b531 Fix memory leak on remote-viewer exit
When exiting remote-viewer, VirtViewepApp::dispose() calls
virt_viewer_app_set_connect_info() with NULL parameters to free all
internal fields. However, _set_connect_info() calls
virt_viewer_app_update_pretty_address() which will always allocate
a new string even if the fields it's using to fill the string are NULL.
This commit fixes the leak by checking if the fields have non-NULL
values before creating the newly-allocated string.

==24180== 14 bytes in 1 blocks are definitely lost in loss record 540 of 8,671
==24180==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==24180==    by 0x32D2B0A187: __vasprintf_chk (vasprintf_chk.c:80)
==24180==    by 0x32D52845AA: g_vasprintf (stdio2.h:210)
==24180==    by 0x32D52640DC: g_strdup_vprintf (gstrfuncs.c:517)
==24180==    by 0x32D526417B: g_strdup_printf (gstrfuncs.c:543)
==24180==    by 0x4136E6: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1681)
==24180==    by 0x414100: virt_viewer_app_set_connect_info (virt-viewer-app.c:1902)
==24180==    by 0x4141D0: virt_viewer_app_free_connect_info (virt-viewer-app.c:1910)
==24180==    by 0x4127C6: virt_viewer_app_dispose (virt-viewer-app.c:1353)
==24180==    by 0x425488: remote_viewer_dispose (remote-viewer.c:131)
==24180==    by 0x32D5E14787: g_object_unref (gobject.c:2986)
==24180==    by 0x4280AF: main (remote-viewer-main.c:323)
2013-04-13 19:02:05 +02:00
Christophe Fergeau
0fd9a6185b build-sys: Simplify setting of optional CFLAGS/LDFLAGS
They don't need to be wrapped inside if HAVE_XXX blocks in Makefile.am
as when XXX is not available, XXX_CFLAGS and XXX_LIBS will expand to
the empty string, and thus we can carry them unconditionally in
our app_CFLAGS/app_LDFLAGS variables.
2013-04-12 21:21:15 +02:00
Christophe Fergeau
584f6cf5a5 Be more consistent in #if/#ifdef use
Some of the code is checking for spice-gtk/oVirt availability
by using #ifdef HAVE_XXX, and some of the code is using #if HAVE_XXX.
As configure.ac only AC_DEFINE() HAVE_XXX when XXX could be found,
let's use the #ifdef HAVE_XXX form everywhere
2013-04-12 21:20:04 +02:00
Christophe Fergeau
67c8c3790f Add oVirt support
This commit adds support for ovirt:// URIs. It does so by using
libgovirt to get the spice/vnc connection information through
oVirt xmlrpc API.
2013-04-12 19:45:38 +02:00
Marc-André Lureau
010a71a748 build-sys: fix distcheck 2013-04-11 16:38:07 +02:00
Hans de Goede
23aad54474 po: Remove extraenous backslash, breaking the build 2013-04-11 16:38:07 +02:00
Daniel P. Berrange
710d58c499 Refresh translations from transifex 2013-04-08 11:20:47 +01:00
Hans de Goede
a07277f28b virt-viewer-app: Always allow users to close displays from the displays menu
Marking display menu items as non sensitive for shown displays make no sense,
since the user can always close them through the window-manager.

Having a window for a display shown when the display is not selectable nor
ready, can happen when the agent goes away. This happens for example when using
a dual monitor config with a Linux guest and then switching to a text console
inside the guest.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-05 16:04:44 +02:00
Christophe Fergeau
9cf264c2cf Use translations when looking up key combination to send
virt_viewer_window_menu_send() compares the label of the menu item
that was clicked on with a list of known labels to know which
key combination should be sent to the guest.
However, the menu label can be translated, but the table doing
the label -> key combination mapping uses untranslated labels.
This means the menu item will not send any key combination when
clicked if translated.
This can be observed with fr_FR where "Ctrl+Alt+_Del" is translated
to "Ctrl+Alt+_Suppr".
2013-04-02 16:01:31 +02:00
Marc-André Lureau
4da48209cf win32: maximize when leaving fullscreen the first time
On windows, the client window may end up with a non-visible toolbar,
and overlapping the windows statusbar. To workaround this, let's
maximize the client the first time leaving fullscreen.

https://bugzilla.redhat.com/show_bug.cgi?id=916810
2013-04-02 13:53:32 +02:00
Marc-André Lureau
29056f9c03 Do not enable extra monitors until they are explicitely enabled 2013-03-28 19:36:57 +01:00
Marc-André Lureau
23acfa582d Make display menu item sensitive again
Even if the display has not been explicitely disabled, as long as
the display is "selectable"

Fix regression introduced with "Do not disable extra client monitors"
3b981d953f270662360e5b0c78183924276a18ed
2013-03-28 19:32:53 +01:00
Marc-André Lureau
081f2decbe Remove gtk_window_present() call
gtk_window_present() may forcefully call gdk_window_show(), which will
call ShowWindow(). Although gdk call is not supposed to move the
window if it's already visible, it does restore the window position on
Vista+. For example, a snapped window will be moved back to its
previous position.

Gtk+ ShowWindow() is currently using SW_SHOWNOACTIVATE, it should
probably use SW_SHOWNA instead, but that didn't help anyway for a
snapped window.

Since virt_viewer_window_show() already ensure the window is visible,
I am not sure why gtk_window_present() is there in the first place, so
just remove it.

https://bugzilla.redhat.com/show_bug.cgi?id=912713
2013-03-26 17:06:07 +01:00
Marc-André Lureau
1e810a543e Add gtk_widget_get_realized() define for old gtk+
Fix build with gtk < 2.20
2013-03-26 15:07:16 +01:00
Marc-André Lureau
006fcf859c window: keep display size when leaving fullscreen for first time
If the application was started in fullscreen, window geometry has not
been saved, since the window was not realized. We can unfullscreen and
restore 1:1 window to match guest display size with
virt_viewer_display_queue_resize()

https://bugzilla.redhat.com/show_bug.cgi?id=916810
2013-03-26 12:35:52 +01:00
Marc-André Lureau
f507f30904 window: save window geometry if the window is realized
Protect against re-entering fullscreen by moving pre-condition,
keey the last know window geometry, since it stays valid.
2013-03-26 12:34:30 +01:00
Marc-André Lureau
d2c4739dc5 window: resize to monitor geometry
This code is potentially bad, we should set size request to the size of the monitor
2013-03-26 12:31:25 +01:00
Marc-André Lureau
d99d943c90 display: make a function to queue the dirty display allocation trick 2013-03-25 22:23:09 +01:00
Marc-André Lureau
19b8be2c85 app: add get_fullscreen_auto_conf() 2013-03-25 22:23:04 +01:00
Christophe Fergeau
464031cae3 Reuse existing 'displays' submenu rather than recreating it
Because of what apparently is a gtk+2 bug , we
cannot recreate the submenu every time we need to refresh it,
otherwise the application may get frozen with the keyboard and
mouse grabbed if gtk_menu_item_set_submenu is called while
the menu is displayed. Reusing the same menu every time
works around this issue.

https://bugzilla.redhat.com/show_bug.cgi?id=922712
2013-03-25 16:18:59 +01:00
Marc-André Lureau
3b981d953f Do not disable extra client monitors
This allows reconfiguration of extra monitors whenever the agent is
back, for example after reboot.

https://bugzilla.redhat.com/show_bug.cgi?id=918997
2013-03-23 00:51:46 +01:00
Marc-André Lureau
9ff289ebf5 spice: always send auto-conf on agent connection
Restore the auto-conf client monitor configuration whenever the agent
is started. This ensures the guest has the expected number of monitors
enabled when rebooting in fullscreen.

https://bugzilla.redhat.com/show_bug.cgi?id=918997
2013-03-23 00:51:46 +01:00
Hans de Goede
663782b45c virt-viewer-display-spice: Skip monitor info in fullscreen-auto-conf mode
When we are in fullscreen-auto-conf virt-viewer-session-spice sends a
monitor-info message to the agent with the exact client monitor info, and
virt-viewer-display-spice should not override that.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2013-03-23 00:51:46 +01:00
Marc-André Lureau
910692b140 Forward directly key events to display
Even if the display is disabled, we should keep sending key events to
guest. It can wake up from sleep for instance.

There is a single widget per window, so we can directly send key
events there. If the menu is active, it has the grab, so the window
doesn't receive those key events.

https://bugzilla.redhat.com/show_bug.cgi?id=870710
2013-03-23 00:51:46 +01:00
Hans de Goede
f43c87f599 virt-viewer-app: Call virt_viewer_app_update_menu_displays on show_hint change
Since the sensitivity of the display menu-check-items depends on show_hint,
we need to call virt_viewer_app_update_menu_displays on show_hint change.

This fixes the following scenario:
1) Linux guest with upto 4 displays on a single qxl dev
2) Configure it for 2 displays
3) Switch to a text-console in the guest (ie send ctrl+alt+F3)
4) All displays except for disp 1 are now not sensitve in the menu
5) Switch back to X
6) The second display in the view->displays menu is still not sensitive

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 21:20:55 +01:00
Hans de Goede
7ea90b8d17 virt-viewer-display: Document difference between nth display and monitor
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 17:25:35 +01:00
Hans de Goede
f7c11ac899 virt-viewer-window: Don't use priv->display when it is NULL
Add some missing checks for not having a display. Note that where
functions should not be called (ie menu items should be disabled) I've
used g_return_if_fail.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 17:25:35 +01:00
Hans de Goede
9893c23830 virt-viewer-window: Store the monitor locally
With commit 81ed9d13 "virt_viewer_window_enter_fullscreen: Pass in monitor for
fullscreen window" we need a monitor number to determine where to move
the window when going fullscreen.

Since the VirtViewerDisplay needs to know the fullscreen monitor number too,
to determine the fullscreen size it was being stored there. But we don't
always have a display, leading to errors like:

(remote-viewer:7996): remote-viewer-CRITICAL **:
virt_viewer_display_get_monitor: assertion `VIRT_VIEWER_IS_DISPLAY(self)'
failed

And to the monitor number not always being stored. This patchset fixes this
by storing the monitor number inside VirtViewerWindow, and passing it to
VirtViewerDisplay only when we've a display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 17:25:35 +01:00
Christophe Fergeau
b8f64b82a9 Fix compilation with older glib versions
Recent commits introduced use of g_clear_object and
g_byte_array_new_take which are only present respectively in glib
2.28 and 2.32
2013-03-20 16:03:28 +01:00
Christophe Fergeau
a5180d34e7 Fix compilation with older gtk+
gtk_widget_get_mapped is only available in gtk+ 2.20, so we need
a compat definition for older releases.
2013-03-20 16:03:27 +01:00
Hans de Goede
0f737b4e9d virt-viewer-display-spice: Use display monitor property for fullscreen size
When a display is pinned to a certain monitor for fullscreen, it will be moved
there when going fullscreen. Currently we use gdk_screen_get_monitor_at_window
to determine which monitor we are on and get the size from that monitor.

But this is racy, sometimes the size_allocate function runs before the move
has finished and we get the size from the wrong monitor:
https://bugzilla.redhat.com/show_bug.cgi?id=918570

Since if the display is pinned to a certain monitor, the display will always
end up on that monitor we can avoid the race by simply using that monitors
size.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-20 15:26:47 +01:00
Hans de Goede
81ed9d13a8 virt_viewer_window_enter_fullscreen: Pass in monitor for fullscreen window
Rather then passing in a move boolean + coordinates to move the window
to for fullscreen mode, simply pass in the monitor, so that the underlying
objects can also use the monitors size to determine the display size.

Note: pass in -1 to use the monitor the window is currently on.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-20 15:26:47 +01:00
Hans de Goede
62e0d000ce virt-viewer-display: Add monitor property
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-20 15:26:47 +01:00
Marc-André Lureau
1a74444bb7 spice: update fullscreen state on display creation
This ensure self->priv->auto_resize has correct value.
And allow changing guest resolution when started in fullscreen.

https://bugzilla.redhat.com/show_bug.cgi?id=873298
2013-03-13 20:44:42 +01:00
Marc-André Lureau
7b227be064 Don't override G_LOG_DOMAIN=all
If the string is different, the GLib log handler will not log all
messages.
2013-03-13 19:42:42 +01:00
Daniel P. Berrange
9d69e5a629 Delete browser plugin entirely
The browser plugin code has been effectively unmaintained since
the day it was merged. There has always been a caveat that the
code has not been properly audited to ensure it is secure, and
being unmaintained doesn't give a warm secure feeling. These
days there are better solutions for the browser which are pure
HTML5 code, noVNC and SPICE-HTML5.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-03-13 11:47:42 +00:00
Marc-André Lureau
9d851a4da3 file: add version field, raise an error if incompatibily
The virt-viewer connection file can now have a version=0.5 field. If
the virt-viewer version opening the connection doesn't provide at
least that version, an error is raised with the version required.
2013-03-08 16:54:01 +01:00
Marc-André Lureau
13f493200c Allow app_initial_connect() to raise an error 2013-03-08 16:54:01 +01:00
Marc-André Lureau
49c242f526 Add virt_viewer_compare_version() 2013-03-08 16:54:01 +01:00
Marc-André Lureau
ef9b142dd9 Add VIRT_VIEWER_ERROR GError 2013-03-08 16:54:01 +01:00
Hans de Goede
b529b60525 Fix send-key menu not showing in fullscreen with gtk3 (rhbz#913601)
This should also fix the send-key menu showing in the wrong position with a
gtk2 build, when the tooltray icon is clicked on the 2nd or higher monitor.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-21 18:16:14 +01:00
Daniel P. Berrange
ea6340eb2b Post release version bump 2013-02-13 16:39:21 +00:00
Daniel P. Berrange
f3c2e2d268 Update for 0.5.5 release 2013-02-13 16:16:55 +00:00
Daniel P. Berrange
cd03c8e7ab Update min spice-gtk requirement docs / RPM requires 2013-02-13 16:16:35 +00:00
Daniel P. Berrange
9f6b2e3f81 Turn off deprecation warnings
GLib deprecated the GValueArray type without providing an ABI
compatible replacement. Thus we need to disable dreprecation
warnings

../../src/virt-viewer-auth.c: In function 'virt_viewer_auth_vnc_credentials':
../../src/virt-viewer-auth.c:112:9: error: 'g_value_array_get_nth' is deprecated (declared at /usr/include/glib-2.0/gobject/gvaluearray.h:65): Use 'g_array_index' instead [-Werror=deprecated-declarations]
2013-02-13 15:20:11 +00:00
Daniel P. Berrange
b96e43e8ee Avoid Makefile @ check for data/Makefile.am 2013-02-13 15:18:19 +00:00
Daniel P. Berrange
09a961ceba Adapt 'po file' syntax check to look at more files
The 'po file' check needs to consider various files in data/
as well as normal sources
2013-02-13 15:18:19 +00:00
Daniel P. Berrange
87bb91e6af Don't define the same make target/variables twice
The NSIS patches defined the .PHONY target twice and also
defined CLEANFILES twice
2013-02-13 15:18:16 +00:00
Daniel P. Berrange
25a2acc2da Auto-generate AUTHORS file from GIT logs
Rather than trying to manually keep track of authors,
just auto-generate the list from GIT logs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-02-13 15:17:57 +00:00
Marc-André Lureau
db19b2ec99 win: add virt-viewer.msi build rule
In order to build the MSI, you will need msitools:
http://ftp.gnome.org/pub/GNOME/sources/msitools/

The MANUFACTURER environment variable is mandatory and should be set
to the manufacturer/author of the MSI build.
2013-02-13 13:20:37 +01:00
Marc-André Lureau
6203eff3bc spec: include mime file 2013-02-12 18:59:04 +01:00
Marc-André Lureau
a52b5ea88c build-sys: add --with-buildid to details build version
Add a configure argument to append build version details, similar to
what Daniel Berrange proposed in the "use finer package version in
mingw-virt-viewer" thread on the ML.
2013-02-12 18:56:33 +01:00
Marc-André Lureau
da45d9fa1e Register remote-viewer mime handling
Unfortunately, I don't see yet how we could avoid the browser dialog
asking which application to open. On Firefox, each user has a
mimeTypes.rdf, but we can't really modify it..
2013-02-11 19:35:00 +01:00
Marc-André Lureau
d5229a71eb win32: process message queue in debug-helper
Process messages while waiting for pi.hProcess.

Avoid the spice-x from hanging in WaitForInputIdle(), although the
client itself might not be ready, not even started...

https://bugzilla.redhat.com/show_bug.cgi?id=903190
2013-02-11 16:54:01 +01:00
Hans de Goede
ea6c9d2673 virtviewer-window: Make sure fullscreen window stays on the same monitor
Sometimes the guest may shortly disable and then re-enable a monitor while
in fullscreen mode, this happens for example when changing display resolution
through gnome-display-properties inside the guest. This causes the client
window-manager to remap the window, and this can cause it to end up
on a different monitor.

This patch fixes this by remembering the position the window is places at
when going fullcreen and moving it there again when its gets (re-)shown.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-11 14:25:01 +01:00
Marc-André Lureau
329a4b4908 Fix "Do not ask me again" checkbox settings saving
Based on bug report by Hans:

The code block for saving was below this check:

    if (priv->session) {
        virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
        if (priv->connected) {
            priv->quiting = TRUE;
            return;
        }
    }

Which means it never executes when quiting virt-viewer while conneced, causing
the "Do not ask me again" checkbox settings to not be saved.
2013-02-07 20:35:19 +01:00
Hans de Goede
e99f03008e usbredir: Fix usbredir menu always being grayed out on monitor 2+
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-06 16:14:28 +01:00
Hans de Goede
071bee5c57 virt-viewer-display-spice: Pass proper x and y coordinates in windowed mode
This stops monitor order from the guest from being re-arranged in multi-
monitor setups when switching between fullscreen and windowed mode.

Note this relies on spice-gtk's auto monitor alignment code, which currently
does not properly handle setups where there is more then 1 row of monitors,
ie 2x1 - 5x1 will work fine, but 2x2 will not.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-06 16:14:28 +01:00
Hans de Goede
abc1626f3b virt-viewer-display-spice: Use real monitor coordinates in fullscreen
Now that we pass the real monitor coordinates, tell spice-gtk to use them,
rather then to use the passed coordinates as input for its automatic monitor
alignment. This fixes ie monitors in a 2x2 grid, showing up as a 4x1
configuration in the guest.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-06 16:14:28 +01:00
Hans de Goede
d841aa0af6 virt-viewer-display-spice: Pass real monitor coordinates in fullscreen
Rather then always passing +0+0

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-06 16:14:28 +01:00
Michal Privoznik
f2890032fe g_{message,warning}: Use printf style
The g_message() and g_warning functions expect printf style of
arguments. That is, whenever we want to print a string, it has
to be preceded with "%s" format.
2013-02-04 15:20:28 +01:00
Michal Privoznik
0c212ee8ca configure: Update with autoupdate 2013-02-04 15:15:44 +01:00
Michal Privoznik
bd84ea26ea Don't redefine _FORTIFY_SOURCE macro
If the _FORTIFY_SOURCE has been already defined, we unconditionally
redefine it, leaving us with warning/error thrown at compilation time.
2013-02-04 14:56:59 +01:00
Martin Kletzander
1648363b85 Make compilation work with automake 1.13
Just one thing needs to be changed for virt-viewer to build with
automake 1.13, AM_CONFIG_HEADER is deprecated and should be
AC_CONFIG_HEADERS.
2013-02-04 14:53:31 +01:00
Marc-André Lureau
7d9e442ffb remote-viewer: controller sets spice session proxy
Trivial change since spice-gtk now has proxy session property and
controller message, just forward it.
2013-01-31 16:59:02 +01:00
Marc-André Lureau
3cc2040be5 Add a "Do not ask me again" checkbox when closing app 2013-01-31 16:59:02 +01:00
Marc-André Lureau
4a61780033 Always ask user about closing session
Currently, virt-viewer doesn't ask for user confirmation when closing
a single monitor session. Always ask before closing, as requested by
user.

https://bugzilla.redhat.com/show_bug.cgi?id=803912
2013-01-31 16:59:02 +01:00
Marc-André Lureau
2798fd2d60 spice: add proxy configuration to connection file 2013-01-29 14:40:24 +01:00
Christophe Fergeau
d062767109 Remove unused label
It's no longer used after aecd80ec7
2013-01-24 16:58:55 +01:00
Christophe Fergeau
604dbe1db2 Remove unused variable
'window' is no longer used after 412bcf6f.
2013-01-24 16:58:55 +01:00
Christophe Fergeau
01532f9523 Fix warning when compiling without spice-gtk support
When remote-viewer is compiled without spice-gtk support, spice-session.h
will not get included in remote-viewer.c, causing these warnings:

remote-viewer.c: In function 'remote_viewer_start':
remote-viewer.c:693:9: warning: implicit declaration of function
'virt_viewer_session_set_file' [-Wimplicit-function-declaration]
remote-viewer.c:693:9: warning: nested extern declaration of
'virt_viewer_session_set_file' [-Wnested-externs]
2013-01-24 16:58:54 +01:00
Christophe Fergeau
9749a1d2c9 Add missing intltool BuildRequires
The configure script fails if intltool is not installed.
2013-01-24 12:58:06 +01:00
Christophe Fergeau
adeb7c7511 mingw: Add packages for virt-viewer NSIS installer
This makes it much easier to build an updated Windows installer binary
as this can now be done using mock/koji/... by using this .spec and
a virt-viewer tarball.
2013-01-24 12:58:06 +01:00
Christophe Fergeau
55585efd47 mingw: Build a gtk2 version of virt-viewer
The nsis file we ship is generating an installer for a GTK+2 build
of virt-viewer, so it's inconsistent for the mingw-virt-viewer
spec file to generate a GTK+3 build. Switch to building a GTK+2
version of virt-viewer in mingw-virt-viewer.spec
2013-01-24 12:58:06 +01:00
Christophe Fergeau
e474656e9b mingw: Package debug-helper.exe 2013-01-24 12:58:06 +01:00
Christophe Fergeau
9c7802445d mingw: Package debug files
When building on f18, the build fails because of unpackaged
debug files. Use the appropriate mingw macro to generate
the mingw debug packages.

The build failure is:

RPM build errors:
error: Installed (but unpackaged) file(s) found:
   /usr/i686-w64-mingw32/sys-root/mingw/bin/debug-helper.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/remote-viewer.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/virt-viewer.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/windows-cmdline-wrapper.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/debug-helper.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/remote-viewer.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/virt-viewer.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/windows-cmdline-wrapper.exe.debug
    Installed (but unpackaged) file(s) found:
   /usr/i686-w64-mingw32/sys-root/mingw/bin/debug-helper.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/remote-viewer.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/virt-viewer.exe.debug
   /usr/i686-w64-mingw32/sys-root/mingw/bin/windows-cmdline-wrapper.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/debug-helper.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/remote-viewer.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/virt-viewer.exe.debug
   /usr/x86_64-w64-mingw32/sys-root/mingw/bin/windows-cmdline-wrapper.exe.debug
2013-01-24 12:58:06 +01:00
Christophe Fergeau
7f9ceefa06 mingw: Fix typo in mingw macro name (hedder -> header) 2013-01-24 12:58:06 +01:00
Christophe Fergeau
a525e43e85 nsis: Adjust file list
Adjust file names for mingw-usbredir dlls and readline dlls
2013-01-24 12:58:06 +01:00
Hans de Goede
412bcf6f7f virt-viewer-display-spice: Get monitor under our window
When getting monitor info for going fullscreen, Get the monitor under
*our* window rather then under the root-window.

Noticed this not working properly when testing the monitor coordinates stuff,
but this should also help people seeing problems when using non equally sized
monitors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-01-22 10:57:34 +01:00
Marc-André Lureau
b6af879d19 vnc: add connection by file
Learn to connect to a VNC server with the connection details file, ex:

[virt-viewer]
type=vnc
host=localhost
port=2356
password=foobar

v2:
- add username/password support

https://bugzilla.redhat.com/show_bug.cgi?id=843410
2013-01-18 12:28:58 +01:00
Marc-André Lureau
c0a2f9dfd5 file: add username support 2013-01-18 12:28:58 +01:00
Hans de Goede
008491a2d9 Make hotkey configuration functionality available from the cmdline (v2)
Changes in v2:
-Add --hotkeys documentation to the man-pages

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-12-21 10:54:27 +01:00
Hans de Goede
aecd80ec77 Add a virt_viewer_app_set_hotkeys() helper function
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-12-21 10:39:29 +01:00
Christophe Fergeau
0577c703fb Improve check for overridden grab key combination
remote-viewer can either use the default grab/ungrab handled by
spice-gtk, or override it and use the standard gtk+ accelerator
mechanism. However, the code currently assumes that if any accelerator
is set in remote-viewer, then the grab key has been overridden.
This commit makes sure the grab key is actually overridden before assuming
so.
2012-12-20 12:22:14 +01:00
Christophe Fergeau
d01097eed2 Don't leak SpiceGrabSequence in enable_accel_changed 2012-12-20 12:22:12 +01:00
Christophe Fergeau
cae0a491c6 Improve hotkeys controller behaviour
Disable default accelerators when setting bindings from the controller
in case the controller does not override them all. This ensures we don't
inherit from the bindings set in VirtViewerApp::constructor if the controller
doesn't set any bindings for a given action.
2012-12-20 11:59:30 +01:00
Marc-André Lureau
346f35c87b Use monitor geometry, not screen size
In a recent commit, 3bb6f5ec805ecfe78eba6d4d98e3ffcab195273a, I
introduced a regression: going fullscreen would no longer match client
and guest resolution correctly.

A GdkScreen is not necessarily the physical screen monitor size.
Lookup the physical monitor size using
gdk_screen_get_monitor_geometry().

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=881020
2012-12-07 14:55:27 +01:00
Michal Privoznik
3b810b7768 session-spice: Cast CA string to gunit8 pointer
SpiceSession has 'ca' property which is type of GByteArray*.
However, when we read the property from file, we read it as
string. For conversion g_byte_array_new_take() is used which
takes given pointer as guint8* so we need to do the cast.
2012-12-05 16:29:11 +01:00
Michal Privoznik
5c9955df09 Sanitize syntax-check
make syntax-check is producing some errors about empty line at EOF
and missing #include <config.h> in src/virt-viewer-file.c

* src/virt-viewer-file.c: add #include <config.h>
* data/virt-viewer-debug.nsis.in: remove empty line at EOF
2012-12-05 16:28:21 +01:00
Doug Goldstein
0f6b286e7a Make .desktop file comply with spec
The .desktop file did not comply with the Desktop Entry spec as checked
with desktop-file-validate. Boolean keys are defined as taking only
'true' or 'false', the entry Terminal had False. MimeType is a string
list and therefore must be terminated with a ;
2012-12-05 12:18:10 +01:00
Marc-André Lureau
09b9add92f remote-viewer: learn to connect from file
v2:
- move some variables to inner-block as requested by reviewer
2012-11-27 20:09:59 +01:00
Marc-André Lureau
c218d43b48 spice: learn to connect from file 2012-11-27 20:09:59 +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
a0bbb6878d Add VirtViewerFile
v2:
- use !! for boolean values setter
- switch from bytearray/base64 to plain string for CA (PEM)
- add file format comment
2012-11-27 20:07:10 +01:00
Marc-André Lureau
4bf7aabbf3 Move spice_hotkey_to_gtk_accelerator() to util
To be compatible with RHEVM, VirtViewerFile hotkey format will use the
Spice Controller format.
2012-11-27 20:07:10 +01:00
Marc-André Lureau
fe4014f023 recent: get mime type from session
Do not use spice mime type for all kind of sessions, but depending on
what is actually being used.
2012-11-27 20:07:07 +01:00
Marc-André Lureau
ddfcc61c87 session: add virt_viewer_session_mime_type() 2012-11-27 19:04:35 +01:00
Marc-André Lureau
9f5192f117 debug.nsis: remove superflous path 2012-11-27 12:37:29 +01:00
Marc-André Lureau
0dca975d64 display: only un-constrain display size once it is mapped
Wait until the widget is actually on screen before removing its
size constrain. This solves 50x50 window secondary window size
when connecting to a multi-monitor spice guest.
2012-11-27 12:36:27 +01:00
Marc-André Lureau
03c3e4d08e Add virt-viewer-debug.exe NSIS installer
This installer will provide with the tools and configuration needed to
debug virt-viewer & remote-viewer. It will install itself by default in
virt-viewer directory.
2012-11-23 16:05:57 +01:00
Michal Privoznik
7c00b1a803 debug-helper: include <config.h> 2012-11-21 17:35:54 +01:00
Michal Privoznik
e56c7a0507 AUTHORS: add Dave Allan
as he has supplied patch (commit 74b1b62510d9390).
2012-11-21 17:35:54 +01:00
Michal Privoznik
68f2d1fced cfg.mk: Don't require bindtextdomain directly
With current implementation, all binaries that need it call
bindtextdomain but not directly. They call a helper function
instead.  This makes, however, syntax-check fail as it cannot
recognize it.

Original patch proposed by Eric Blake <eblake@redhat.com>
2012-11-21 17:35:53 +01:00
Marc-André Lureau
30b5366e66 spice: the session is connected when main channel opened
The previous change in 399aae55aa384bf91dff0fc770497c0d5f935fa9 rely
on correct session-connected signal. However, the spice backend
is emiting it too early, when the main channel is created, where
it should wait until it is connected instead.
2012-11-21 00:32:00 +01:00
Marc-André Lureau
399aae55aa "Unable to connect to the graphic server" error on guest shutdown
In virt_viewer_app_activate(), priv->connected is set to FALSE when
the connect/active is successfull. However, we rely on it to know
whether the virt_viewer_app_disconnected() is an error, so only set it
to FALSE when connection failed.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=875697
2012-11-20 12:59:56 +01:00
Marc-André Lureau
a4805a3bb8 build-sys: add min libvirt version requirement check 2012-11-16 18:19:16 +01:00
Christophe Fergeau
8a7aa6a1e1 Make sure png screenshots have a .png extensions
When falling back to saving to .png, the filename might not
end with .png. This commit appends the .png extension to the
screenshot filename if it's missing.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
f9935c832b Allow to save to other formats than png
Currently, the screenshots can only be saved to png. This commit
checks if the file extension is a known one, and will save to this
format if it is. Otherwise it will fallback to saving to png.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
45a791082e Set a default dir/name for screenshots
It makes sense for the screenshots to be saved in ~/Images,
especially as otherwise the filechooser will display
'recent documents' to which we cannot save. This commit also sets
the default screenshot name to 'Screenshot'.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
6d35a443da Fix spice-gtk check in configure.ac
The check that at least one of spice-gtk and gtk-vnc is present
uses a wrong variable name to check for spice-gtk presence, which
causes the check to think it's never present. This would make
gtk-vnc presence mandatory. This commit fixes the name of the
spice-gtk variable ($have_gtk_spice -> $have_spice_gtk).
2012-11-15 10:21:03 +01:00
Michal Privoznik
9983fe74dd Don't SIGSEGV if no transport is used.
One of previous commits (74b1b62510d939) allowed us to connect to
localhost directly if ssh transport was used. However, if there's
not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as
one of arguments. Change this to g_strcmp0 which does the same
service but is more friendly to NULL arguments.
2012-11-14 15:20:58 +01:00
Michal Privoznik
fa39c5335c Reconnect to libvirtd after connection breaks
Currently, if user wants to reconnect to a domain he can use
'-r' cmd line argument. This makes virt-viewer listen to
domain events. However, if connection to libvirtd breaks
somehow, we will receive no longer any event. Hence we must
reconnect to the libvirt.
2012-11-13 15:23:51 +01:00
Dave Allan
74b1b62510 Connect to localhost for display when transport is ssh
When connecting to a VM that does not have a 'listen' tag in its
graphcs element, we have to guess where to try to connect to the VM's
display.  The current default is the host specified in the connection
URI which is correct for most transports, however, the SSH transport
makes the display connection from the remote end, so in that case,
attempt to connect to localhost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-11-08 17:44:18 +01:00
Guido Günther
7083a07a92 Fail if neither vnc nor spice is detected
Since the viewer makes little sense otherwise.
2012-10-25 12:14:33 +02:00
Marc-André Lureau
8b06fb7319 Fix jenkins build failure
virt-viewer-util.c: In function 'virt_viewer_util_init':
virt-viewer-util.c:289: warning: implicit declaration of function 'setlocale'
virt-viewer-util.c:289: warning: nested extern declaration of 'setlocale'
virt-viewer-util.c:289: error: 'LC_ALL' undeclared (first use in this function)
virt-viewer-util.c:289: error: (Each undeclared identifier is reported only once
virt-viewer-util.c:289: error: for each function it appears in.)
2012-10-23 15:59:38 +02:00
Marc-André Lureau
93da043657 Use a mutex to check if VirtViewer running
We need to warn user that installer can't proceed if there is already
a running instance of VirtViewer or of the installer.

https://bugzilla.redhat.com/show_bug.cgi?id=864033
2012-10-23 14:49:23 +02:00
Marc-André Lureau
14a1d48745 Use a common early init() function
There is a number of things both virt-viewer and remote-viewer need to
do early during execution. Do it only in one place.
2012-10-23 14:49:23 +02:00
Marc-André Lureau
53c6549fb4 windows: add debug-helper
This is a simple program that will set some debug variable, and run
gdb and wait until it finished. This makes it possible to debug
"remote-viewer --spice-controller" easily, by setting the necessary
variables and keeping the parent process running (the activex whatches
its death)

To use it, replace the HKCU "Software\spice-space.org\spicex\client"
value "$INSTDIR\bin\remote-viewer.exe --spice-controller" with
"$INSTDIR\bin\debug-helper.exe remote-viewer.exe --spice-controller".
2012-10-23 14:49:18 +02:00
Marc-André Lureau
08db836b13 nsis: add deps.txt file in installer
This helps track package version that were used during the
build of Windows installer. It's not ideal, but make up the
lack of package management on windows
2012-10-23 11:17:05 +02:00
Marc-André Lureau
e5895ce49f nsis: update required files and libraries 2012-10-23 11:17:05 +02:00
Marc-André Lureau
dca7397f16 win32: there is no CONERR$, only CONOUT$ 2012-10-23 11:17:04 +02:00
Marc-André Lureau
3bb6f5ec80 spice: only autoresize once with screen size in fullscreen
It's currently not possible to configure guest with higher resolution
than native, as it will switch back to native, since the gtk widget
allocation will always end up being the size of the screen. We
special-case fullscreen mode, and only resize when entering
fullscreen. Furthermore, it avoids sending extra unnecessary resize
events to the guest whenever gtk+ call size allocate in various
stages, with different values.

https://bugzilla.redhat.com/show_bug.cgi?id=864929
2012-10-18 00:44:36 +02:00
Marc-André Lureau
435a542de2 spice: avoid rounding issues when scaling up display
Fix some unwanted guest resize due to rounding issues (at least when
scaling up)

We may want to save the original remote desktop size, instead of
always checking widget requisition. That way zooming shouldn't resize
guest at all, but it seems tricky to handle that special case vs user
window resize that should trigger guest resize.

https://bugzilla.redhat.com/show_bug.cgi?id=856678
2012-10-17 16:50:14 +02:00
Marc-André Lureau
143bc8a33f Do not resize window to minimum when toggling auto-resize
The virt_viewer_display_idle() will queue a resize event that will
result in display size requisition of 50x50. If we later resize the
window to 1x1 in virt_viewer_window_resize() we end up with a tiny
window.

It is legitimate not to force that 1x1 window resize when toggling the
option. After the rest of the logic in virt_viewer_window_resize(), if
the remote desktop ends up being resize, that will trigger another
virt_viewer_set_desktop_size() and finally change the window size
appropriately.

https://bugzilla.redhat.com/show_bug.cgi?id=856610
2012-10-16 20:41:47 +02:00
Daniel P. Berrange
dcbd306051 Add RPM magic to run autoreconf
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-12 19:29:00 +01:00
Daniel P. Berrange
c4bfbe104f Fix check for IPv6 any address
The string '::' is just one of many possible ways to express
the IPv6 "any" address. Others include  '::0', '0:0:0:0:0:0:0:0',
'0::0' and more. Instead of trying to do strcmp, actually try
parsing the address with GInetAddress and then simply use an
accessor to check what type it is

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-10 16:28:38 +01:00
Daniel P. Berrange
fe485f22de Allow user to set a window title for remote-viewer
Currently the remote viewer windows get the URI as their
title. Provide a --title STRING arg to remote-viewer to
let the user override the title with something more
meaningful to them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-09 17:25:19 +01:00
Christophe Fergeau
a4e588e3ea Don't free SPICE ticket twice
Commit 2201a5a was supposed to free a SPICE ticket leak, but it's
actually introducing a double-free as the SPICE ticket is
unconditionally freed at the end of
virt_viewer_session_spice_main_channel_event
2012-10-01 18:41:26 +02:00
Christophe Fergeau
d5bbe725d3 Append \n to message in virt_viewer_app_trace
Callers manually add a trailing \n when they call virt_viewer_app_trace,
but it's sometimes forgotten, leading to rhbz#822794. This commit
removes the \n from all callers (it was missing in a few of them)
and adds it in virt_viewer_app_trace.
2012-09-18 15:55:38 +02:00
Daniel P. Berrange
0f85fca802 Refresh translations
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-09-18 14:28:42 +01:00
Daniel P. Berrange
c36c848904 Update for 0.5.4 releae 2012-09-17 11:53:12 +01:00
Daniel P. Berrange
a732a94df3 Use a more specific regex to fix enum include paths
Simply doing a search replace on $(srcdir) doesn't work very
well in non-VPATH builds. Use a more specific regex that won't
generate false matches
2012-09-14 18:00:27 +01:00
Daniel P. Berrange
f8c6065330 Look in builddir for icons & strip build dir prefix from enum file includs 2012-09-14 17:35:31 +01:00
Daniel P. Berrange
879517fe46 Don't include generated icons in tar.gz and clean them up 2012-09-14 17:35:10 +01:00
Daniel P. Berrange
c8e0550a82 Convert to use Mingw64 toolchain for Windows biulds 2012-09-14 17:34:53 +01:00
Christophe Fergeau
c5d4570c11 Document -f=auto-conf in remote-viewer --help
virt-viewer does not support -f=auto-conf so this does not change the
option there.
Fixes rhbz#718001
2012-08-13 15:51:48 +02:00
Christophe Fergeau
3d43a9f455 Use real binary name in help message
Now that we have 2 distinct binaries, remote-viewer and virt-viewer,
'PACKAGE' can no longer be used in error messages as the name of the
binary. This causes a small inconsistency when running
'remote-viewer --foobar' as the error message would be:
'Unknown option --foobar
Run 'virt-viewer --help' to see a full list of available command line options'

This commit makes sure we use argv[0] for this message.
Fixes rhbz#814150
2012-08-10 15:50:46 +02:00
Marc-André Lureau
e88f5a52cf Show status page by default if display not ready
Switch back to status page if display is not ready.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
98ac529c0a Make status widget visible immediately
GtkNotebook will use the currently visible widget as default page.
If we don't show status widget before we append the display, the
current page will be on display. Quoting Gtk+ documentation:

"Note that due to historical reasons, GtkNotebook refuses to switch to
a page unless the child widget is visible. Therefore, it is
recommended to show child widgets before adding them to a notebook."
2012-07-23 16:27:33 +02:00
Marc-André Lureau
527a7182d6 vnc: when session is disconnected, make the display as non-ready 2012-07-23 16:27:33 +02:00
Marc-André Lureau
5de6af3095 Simplify display flag handling 2012-07-23 16:27:33 +02: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
8006302fef Make the display submenu insensitive if display can't be selected 2012-07-23 16:27:33 +02:00
Marc-André Lureau
57bf1e9090 spice: factor out main channel lookup code 2012-07-23 16:27:33 +02:00
Marc-André Lureau
6f9c7a624e Add VirtViewerDisplay::selectable property
This property will be set when the display can be selected to be
"enabled" and shown (this can involve creating/connecting an
additional guest monitor, and may need guest agent cooperation for
example).
2012-07-23 16:27:33 +02:00
Marc-André Lureau
37c30a4569 Add virt_viewer_window_get_display()
Getter used in following changes.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
0d58d9c729 Hook up handling of Monitors
Rely on spice-gtk display channel monitors property to manage
displays. The same display channel may now provide several monitors,
the SpiceDisplay widget must be told which monitor to display
2012-07-23 16:27:33 +02:00
Marc-André Lureau
c8d20b35bd Bump glib > 2.22, add compat file
We use API from 2.22, and some from further version. Add
virt-glib-compat.h fallback file for those.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
db7c5b20b0 Use SpiceDisplay:ready property instead of channel mark
The display can now check several conditions before the display can be
shown, use that instead of display mark, which was not high-level
enough.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
f3097fcca9 Number display starting from 1 2012-07-23 16:27:32 +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
Marc-André Lureau
2a085766f1 Add a DISABLED display hint
This flag will help to track whether the display has been
removed/closed and whether it really has a valid display.

Ready in contrast, is used to "hide" temporarily the display (when
starting or redrawing the display, to avoid artifacts)
2012-07-23 16:27:32 +02:00
Marc-André Lureau
0897382b45 Use virt_viewer_connect_object() for display
When display is released, detach signal automatically.

Fix various crash related to not cleaning up signal handlers properly,
due to no longer 1-1 only relation between display widget and channel.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
cab1ab0e57 Rebuild display menu when a window is added or removed 2012-07-23 16:27:32 +02:00
Marc-André Lureau
9c15005026 Mark a menu string as translatable 2012-07-23 16:27:32 +02:00
Marc-André Lureau
02b326f80b Run-time check values before doing bad computation 2012-07-23 16:27:32 +02:00
Marc-André Lureau
560767b573 Turn display:show-hint into flags type 2012-07-23 16:27:32 +02:00
Marc-André Lureau
3b70561666 Destroy dialog immediately after run
If the parent is already destroyed, it looks like the dialog is
destroyed too. This avoids a crash when calling app_quit().
2012-07-23 16:27:32 +02:00
Marc-André Lureau
7cf00ea8d2 build: generate enums type boilerplate 2012-07-23 16:27:32 +02:00
Marc-André Lureau
c6c335799d spice: disconnect signal handlers when either object is destroyed
Use virt_viewer_signal_connect_object(), a copy of telepathy
utility function tp_g_signal_connect_object(). This function
will take care of removing signal handler if any of emitter or
attached object are destroyed.

The following patches will have this condition met, since there is no
longer 1-1 relation between channel and display. The channels can
continue to be around when some of the display are removed.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
4648dc16e8 spice: improve fullscreen=auto-conf
Do keep client monitor position, do not align monitors automatically.
The align property is only available since v0.12.101.
2012-07-23 16:27:28 +02:00
Marc-André Lureau
8d9a9ca521 build: allow building with newer glibc-headers and -O0
Fix copied from libvirt, commit by Eric Blake.

    glibc 2.15 (on Fedora 17) coupled with explicit disabling of
    optimization during development dies a painful death:

    /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

    Work around this by only conditionally defining _FORTIFY_SOURCE,
    in the case where glibc can actually use it.  The trick is using
    AH_VERBATIM instead of AC_DEFINE.
2012-07-03 23:02:41 +02:00
Christophe Fergeau
4b310b03e9 Revert "Fix virt_viewer_app_activate return value"
This reverts commit 3ce6df7c309068f36e2602692da809a153ed5688. This
commit broke virt-viewer which expects this function to return -1
or 0 on error, and a positive value on success in
virt_viewer_initial_connect.
2012-06-15 10:03:21 +02:00
Christophe Fergeau
3ce6df7c30 Fix virt_viewer_app_activate return value
VirtViewerApp::activate is expected to return -1 on errors.
It calls the VirtViewerSession::open_* methods, which return FALSE
on error. However, VirtViewerApp::activate directly returns these
boolean instead of testing the returned value and properly returning
-1 on errors. This caused errors in these open methodes to be ignored.
2012-06-13 12:17:20 +02:00
Christophe Fergeau
afb278958e Fix various memory leaks
==25063== 59 bytes in 1 blocks are definitely lost in loss record 5,163 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356)
==25063==    by 0x41F40A: connected (remote-viewer-main.c:186)
==25063==    by 0x3DE400F663: g_closure_invoke (gclosure.c:777)
==25063==    by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547)
==25063==    by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296)
==25063==    by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389)
==25063==    by 0x41AA53: reemit_signal_VOID (virt-viewer-session-ovirt.c:211)
==25063==    by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840)
==25063==    by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
==25063==    by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389)

==25063== 14 bytes in 1 blocks are definitely lost in loss record 623 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82)
==25063==    by 0x3DE3882F1A: g_vasprintf (stdio2.h:199)
==25063==    by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509)
==25063==    by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535)
==25063==    by 0x40CBAE: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1538)
==25063==    by 0x40FB55: virt_viewer_app_free_connect_info (virt-viewer-app.c:1707)
==25063==    by 0x40FBE9: virt_viewer_app_dispose (virt-viewer-app.c:1291)
==25063==    by 0x3DE40144F7: g_object_unref (gobject.c:2981)
==25063==    by 0x40C31A: main (remote-viewer-main.c:336)

==25063== 10 bytes in 1 blocks are definitely lost in loss record 491 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82)
==25063==    by 0x3DE3882F1A: g_vasprintf (stdio2.h:199)
==25063==    by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509)
==25063==    by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535)
==25063==    by 0x40DE36: window_update_menu_displays_cb (virt-viewer-app.c:1640)
==25063==    by 0x3DE383833F: g_hash_table_foreach (ghash.c:1524)
==25063==    by 0x3DE400F663: g_closure_invoke (gclosure.c:777)
==25063==    by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547)
==25063==    by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296)
==25063==    by 0x3DE40287C1: g_signal_emit (gsignal.c:3352)
==25063==    by 0x5772F95: gtk_widget_show (gtkwidget.c:3225)

==25063== 8,431 (72 direct, 8,359 indirect) bytes in 1 blocks are definitely lost in loss record 9,468 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE38616B1: g_slice_alloc (gslice.c:1003)
==25063==    by 0x3DE3861C05: g_slice_alloc0 (gslice.c:1029)
==25063==    by 0x3DE402F96F: g_type_create_instance (gtype.c:1872)
==25063==    by 0x3DE40147A7: g_object_constructor (gobject.c:1849)
==25063==    by 0x3DE4016260: g_object_newv (gobject.c:1632)
==25063==    by 0x3DE40168AB: g_object_new (gobject.c:1542)
==25063==    by 0x40C4BD: virt_viewer_util_load_ui (virt-viewer-util.c:41)
==25063==    by 0x40C7EB: virt_viewer_auth_collect_credentials (virt-viewer-auth.c:43)
==25063==    by 0x41B391: authenticate_cb (virt-viewer-session-ovirt.c:430)
==25063==    by 0x3458C05E8F: ffi_call_unix64 (unix64.S:75)

==25063== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 3,962 of 9,502
==25063==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==25063==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==25063==    by 0x3DE38616B1: g_slice_alloc (gslice.c:1003)
==25063==    by 0x3DE38629F2: g_slist_append (gslist.c:222)
==25063==    by 0x41483C: virt_viewer_window_init (virt-viewer-window.c:323)
==25063==    by 0x3DE402FA05: g_type_create_instance (gtype.c:1892)
==25063==    by 0x3DE40147A7: g_object_constructor (gobject.c:1849)
==25063==    by 0x3DE4015D70: g_object_newv (gobject.c:1713)
==25063==    by 0x3DE401655F: g_object_new_valist (gobject.c:1830)
==25063==    by 0x3DE4016893: g_object_new (gobject.c:1545)
==25063==    by 0x40DA34: virt_viewer_app_window_new (virt-viewer-app.c:590)
==25063==    by 0x40E300: virt_viewer_app_constructor (virt-viewer-app.c:1336)

==30355== 4 bytes in 1 blocks are definitely lost in loss record 53 of 9,267
==30355==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==30355==    by 0x3DE384D2BE: g_malloc (gmem.c:159)
==30355==    by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356)
==30355==    by 0x3DE40360FC: value_copy_string (gvaluetypes.c:276)
==30355==    by 0x3DE40340CA: g_value_transform (gvalue.c:535)
==30355==    by 0x3FDAE621DD: gdk_screen_get_setting (gdkevents-x11.c:3022)
==30355==    by 0x3FDB3C7415: gtk_settings_get_property (gtksettings.c:1152)
==30355==    by 0x3DE4017A74: g_object_get_property (gobject.c:1289)
==30355==    by 0x414991: virt_viewer_window_disable_modifiers (virt-viewer-window.c:616)
==30355==    by 0x415922: virt_viewer_window_keyboard_grab (virt-viewer-window.c:931)
==30355==    by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840)
==30355==    by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
2012-06-13 12:17:16 +02:00
Christophe Fergeau
2201a5adf4 Don't leak SPICE ticket 2012-06-13 12:17:11 +02:00
Marc-André Lureau
0341125ca4 spice: use weak references to display channel
Fix switch-host migration with Spice.

spice-gtk doesn't like channels staying around when they should be
destroyed/finalized, ie removed from session.

spice-gtk should probably learned to handle better the case of non
cooperating clients, and be able to dissociate a channel from a
session without waiting for it to be disposed, but for now, the
relation is quite tight.
2012-05-17 19:12:35 +02:00
Daniel P. Berrange
163b685332 Avoid use of deprecated GTK3 pointer APIs
The gtk_widget_get_pointer() API is deprecated in GTK3 since it
is not aware of multiple pointers. Replace its usage in autoDrawer.c
with GdkDeviceManager and friends

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-05-15 15:46:37 +01:00
Daniel P. Berrange
20c2703a77 Adapt to avoid use of deprecated GTK3 style & size APIs
The GtkStyle API has been deprecated in favour of GtkStyleContext.
Update ovBox.c to use the latter if building with GtK3. Also replace
use of the gtk_widget_size_request API with gtk_widget_get_preferred_size.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-05-15 14:46:13 +01:00
Marc-André Lureau
ceb38d1c20 Release v0.5.3 2012-05-15 02:45:34 +02:00
Marc-André Lureau
cffee9c27d nsis: fix .nsis file paths
- look up for icons under the DESTDIR directory
- don't ship gstaudiofx, unneeded
- add missing libtasn
2012-05-15 02:45:21 +02:00
Marc-André Lureau
8e1a8b3242 dist: ship .ico in tarball
Some distros (a 4-letters) don't have icotool.
Let's ship the .ico in the tarball.

The build will fail if icoutil is not installed when
building from git or when the .ico is absent. The error
should be explicit.
2012-05-14 23:27:20 +02:00
Marc-André Lureau
88893e30bc nsis: IE policy to launch silentely remote-viewer
Add IE ElevationPolicy for the remote-viewer client.

http://msdn.microsoft.com/en-us/library/bb250462%28v=vs.85%29.aspx
2012-05-14 17:43:34 +02:00
Marc-André Lureau
57f259fae6 nsis: fix removal of start menu directory 2012-05-14 17:43:34 +02:00
Daniel P. Berrange
d0de667ec2 Avoid race condition when disposing of app
When disposing of the VirtViewerApp, we free the hash table
containing the windows. This causes each window to be freed,
which in turn causes the visibility callback to be invoked.
This can then get NULL pointers from the self->priv->windows
usage.

Blank out priv->windows before unrefing the hashs and add
a check to ensure priv->windows is non-NULL.
2012-05-08 14:39:44 +01:00
Daniel P. Berrange
f34edd09cb Ensure windows are destroyed when display closes
When running virt-viewer with the --reconnect argument, when
the session closes, the VirtViewerWindow instances were being
freed, but not the GtkWindow itself. So the orphaned window
stayed around doing nothing. The GtkBuilder instance was also
leaked.

Fix these two leaks & also add some debugging to help future
troubleshooting
2012-05-04 17:22:44 +01:00
Daniel P. Berrange
d0d226ca8f Change 'OK' button to 'Close' button in USB device selection
The USB device selection applies immediately, so the dialog
should be using 'Close' instead of 'OK' for its primary button
2012-05-02 13:02:22 +01:00
Christophe Fergeau
90b3edc396 g_getenv returns a const string
When switching from getenv to g_getenv, 'doms' declaration
wasn't changed from char * to const char *, which causes
a gcc warning.
2012-04-27 15:20:53 +02:00
Daniel P. Berrange
4a604360c4 Replace getenv/setenv with g_getenv/g_setenv for Win32 portability 2012-04-26 10:08:31 +01:00
Daniel P. Berrange
7d32705779 Add debugging when performing fullscreen auto-configuration 2012-04-25 18:25:31 +01:00
Daniel P. Berrange
895bebd4ae Refresh translations from transifex 2012-04-25 15:52:24 +01:00
Daniel P. Berrange
06d62c4b02 Really fix debug output on glib >= 2.31 2012-04-25 15:31:05 +01:00
Daniel P. Berrange
5887eb07b8 Fix debug output on glib >= 2.31 2012-04-25 15:30:31 +01:00
Daniel P. Berrange
dfbc9d2e8f Set the remote-viewer binary application name
Currently the window titles for remote-view have 'remote-viewer'
appended them. This is based off the argv[0] name. We should be
setting the GLib application name though, so we can get a localized
'Remote Viewer' string in the titlebar
2012-04-23 11:04:10 +01:00
Daniel P. Berrange
7ab88ea179 Add support for raw IPv6 addresses in VNC & libvirt URIs
Support   vnc://[x:y:z:]:5901/  for raw IPv6 addresses in URIs,
and qemu+ssh://root@[x:y:x:]:22/ for raw IPv6 addresses in
libvirt URIs
2012-04-23 09:42:34 +01:00
Daniel P. Berrange
c1af3ab0cc Fix scaling of window to avoid integer truncation
Use round() instead of integer truncation when scaling the window,
to avoid floating point precision problems on i386
2012-04-19 16:18:31 +01:00
Daniel P. Berrange
be3ce01096 Add a desktop file for launching remote-viewer
Enable automagic handling of spice:// URLs in firefox by
registering a desktop handler for remote-viewer with the
SPICE URI scheme
2012-04-18 14:12:57 +01:00
Daniel P. Berrange
8ae777a5f7 Give remote-viewer priority over spicec for spice-xpi-client 2012-04-17 15:06:14 +01:00
Daniel P. Berrange
ad5d29da5e Add manpage docs for the --attach option 2012-04-17 12:42:39 +01:00
Daniel P. Berrange
812ca0d650 Fix manpage to s/--fullscreen/--full-screen/ 2012-04-17 12:40:49 +01:00
Christophe Fergeau
37171c465f Fix automatic usb redir through controller
remote-viewer is currently trying to use
SpiceUsbDeviceManager::auto-connect to control whether USB devices
should be automatically connected or not. However, this property
is more or less an internal spice-gtk property which is toggled
by SpiceGtkSession when the SPICE widget gets/loses focus.

SpiceGtkSession has an "auto-usbredir" property which can be used
by applications to enable/disable automatic usb redirection through
SPICE. Since this property is helpfully bound to
VirtViewerSession::auto-usbredir, use this when the controller
is told to enable/disable USB redirection.

Without this change, automatic USB redirection will always get reenabled
as soon as there's a focus change since SpiceGtkSession::auto-usbredir
defaults to be enabled in spice-gtk.
2012-04-17 10:11:09 +02:00
Daniel P. Berrange
521116f51b Ensure windres & icotool are present on Win32 builds
Builds are failing with an obscure error message

make[3]: Entering directory `/var/lib/builder/source-root/virt-viewer/build/icons'
  GEN    virt-viewer.ico
/bin/sh: -c: command not found
make[3]: *** [virt-viewer.ico] Error 127

This is because configure.ac does not enforce that icotool
is present on Win32.

* configure.ac: Mandate windres & icotool on Win32
2012-04-05 12:07:09 +01:00
Daniel P. Berrange
9a5d978f46 Require F17 for spice in RPM builds 2012-04-05 10:17:01 +01:00
Daniel P. Berrange
35a6112ef5 Exclude windows-cmdline-wrapper.c from some syntax check rules 2012-04-05 09:27:46 +01:00
Daniel P. Berrange
bbbf9414db Add Yonit to authors file 2012-04-05 09:27:34 +01:00
Daniel P. Berrange
2bd7c82ded Fix some syntax violations in git.mk 2012-04-05 09:27:24 +01:00
Zeeshan Ali (Khattak)
6109d5257d Minor simplification/optimization of VirtViewerDisplay 2012-04-05 09:24:59 +01:00
Daniel P. Berrange
dc22bb1221 Fix typo in variable names for Win32 command helper 2012-04-04 10:41:32 +01: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
Christophe Fergeau
e76beedf1f Propagate USB redirection controller messages 2012-04-04 10:32:28 +02:00
Yonit Halperin
63feed3d4e Add support for the SPICE properties disable-effects & color-depth
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-03 18:48:34 +01:00
Christophe Fergeau
95e42b9cec build-sys: fix Windows specific LDFLAGS on non-mingw 2012-04-03 14:07:21 +02:00
Marc-André Lureau
edf1715a2e nsis: fix a few missing icons 2012-04-03 00:06:19 +02:00
Marc-André Lureau
2a72130eb0 nsis: add the remote-viewer cmdline wrapper 2012-04-02 23:56:50 +02:00
Marc-André Lureau
db1b308a63 remote-viewer: make it a GUI/windows application with hybrid console
If the application can attach to its parent console, redirect
input/output. So that will work nicely with the command line wrapper.
2012-04-02 23:56:50 +02:00
Marc-André Lureau
55477f9f20 Add a Windows command line wrapper
Add a small command line wrapper, to be able to call GUI/windows application from the console
2012-04-02 23:56:49 +02:00
Marc-André Lureau
a48856f10e Disable mnemonics via gtk-enable-mnemonics settings
This has 2 advantages, and I can't figure any drawback:
- it fixes the issue of mnemonic hints being draw when pressing Alt
  key (character underlined), even when they were disabled.
- it simplifies the code :)
2012-04-01 20:09:16 +02:00
Marc-André Lureau
261b692657 Disable menu items that would fail when there is no display 2012-04-01 20:09:16 +02:00
Marc-André Lureau
ffb17ce387 build-sys: simplify autogen.sh
It should support NOCONFIGURE=1 ./autogen.sh && mingw32-configure
2012-04-01 20:09:16 +02:00
Marc-André Lureau
81c2c3bfec build-sys: use git.mk to generate gitignore
This makefile is just fantastic, it forces you into good practices,
support various build targets (my windows builddir ignore the right
files etc..)

The more I use it, the more I like it.
2012-03-30 14:48:13 +02:00
Marc-André Lureau
902b9a71e2 win32: add a few Windows sepecific data
Add application icon and manifest
2012-03-30 14:48:13 +02:00
Marc-André Lureau
472bfe09c5 win32: clean-up the NSIS installer, allow user install 2012-03-30 14:48:13 +02:00
Marc-André Lureau
cc0696f46f Fix recent --spice-controller regression, add error message
The current code will attempt to dereference args if
--spice-controller, even if args is NULL.

Let's not accept any extra argument/uri on the command line if using
the controller. Beside, the conditionnal block looks better outside of
the if condition.
2012-03-30 14:25:52 +02:00
Hans de Goede
e2b41b43eb usbredir: listen for device-error signal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-29 17:11:23 +02:00
Marc-André Lureau
310497275d remote-viewer: press Enter to connect in dialog 2012-03-29 03:18:04 +02:00
Marc-André Lureau
0358d8ca6f Remove unused variable i 2012-03-29 02:33:08 +02: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
97b983d525 Fix g_thread_init deprecation warning
Although the doc says it is only deprecated since >2.32, it's actually
>2.31 according to glib git log.
2012-03-29 02:28:34 +02:00
Marc-Andre Lureau
336e71534b Do not warn if the display is shown and not ready
Lower warning message to debug level. There are various racy ways it
ends up calling show_display although the display is not yet
ready. This is not such a big problem, although it would be nice to
handle this case better
2012-03-22 00:24:47 +01:00
Marc-Andre Lureau
df1fbf1e8d Notify focus state when the foreign menu title is set
The current code only inform of focus state when the listener is ready.
spice-gtk controller code lacks signal when a client connects, but a
client will set the title when connected and send a notify signal.
Use this event to notify of application focus state.
2012-03-22 00:24:47 +01:00
Marc-Andre Lureau
c4bfc57e72 Do not try to unref NULL menu 2012-03-22 00:24:47 +01:00
Marc-Andre Lureau
591cb0a97e Don't leak foreign menu
The RemoveViewer object will have its own ref.
2012-03-22 00:24:46 +01:00
Marc-André Lureau
9d22757722 spice: handle switch-host event
Do not disconnect session when switching host (non-seamless migration
method).

Also, handle a bit better main channel events and do not disconnect on
unknown events, however raise unhandled event message to warning
level.
2012-03-21 16:21:32 +01:00
Marc-André Lureau
6cfb7116b9 spice: remove usage of deprecated audio api 2012-03-21 16:21:32 +01:00
Marc-André Lureau
7ffd3d4f7e Display correct key bindings to release cursor
If the accels are enabled (with Spice controller custom bindings),
show the configured keybinding in the title bar.
2012-03-21 16:21:32 +01: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
395a44bd47 Fix indentation 2012-03-18 15:19:04 +01:00
Marc-André Lureau
e06c822023 Do not crash so easily when given invalid uri
'remote-viewer foobar' shouldn't crash
2012-03-16 17:16:57 +01:00
Daniel P. Berrange
cf5082577a Updated translations 2012-03-13 09:20:45 +00:00
Marc-André Lureau
b6a7a921a3 Make sure we call g_thread_init()
GThread is needed by spice-gtk
2012-03-09 19:01:35 +01:00
Marc-André Lureau
7f72c2515e Notify of focus state when a client connects
The current code notifies the controller when the remote-viewer
application starts, but not when the client is connected. We should do
the later instead
2012-03-09 19:01:35 +01:00
Daniel P. Berrange
2017b3e0ae Update NEWS for 0.5.2 release 2012-03-09 13:41:35 +00:00
Daniel P. Berrange
88ff553603 Import newer translations from transifex 2012-03-09 13:38:51 +00:00
Daniel P. Berrange
df404090ff Fix libvirt/SPICE min versions
We require libvirt >= 0.9.7 to get virDomainOpenGraphics

We require spice-gtk >= 0.11 to get the fix for dealing with
authentication over an SSH tunnel

We requires spice-protocol >= 0.10.1 to get a constant
required by USB redirection
2012-03-09 13:36:22 +00:00
Marc-André Lureau
4f142b1f16 Add a send-key menu in fullscreen 2012-03-08 14:19:46 +01:00
Marc-André Lureau
810d18c956 build: fix autogen message
When running ./autogen.sh on a pristine git checkout, I got:

libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
You should add the contents of '/usr/share/aclocal/intltool.m4' to 'aclocal.m4'.
2012-03-07 20:42:43 +01:00
Hans de Goede
3123a1107c virt-viewer-window: Don't try to resize non visible windows
Trying to resize not visible windows leads to the following being printed
to the console:
Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)'

This gets triggered by the gdk_screen_get_monitor_geometry() call in
virt_viewer_window_resize()

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-07 20:33:12 +01:00
Hans de Goede
5b7985b927 virt-viewer-window: Add show / hide utility functions
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-07 20:33:12 +01:00
Hans de Goede
81cdc24470 virt-viewer-window: Move checks before resize to virt_viewer_window_resize
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-07 20:33:12 +01:00
Hans de Goede
1b48cd0c0e virt-viewer-window: Remove useless tests for priv->window != NULL
priv->window gets set on init and never unset, so there is no need to check
for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-07 20:33:12 +01:00
Daniel P. Berrange
e2b892b417 Update AUTHORS file 2012-03-07 10:38:02 +00:00
Daniel P. Berrange
f6e603e139 Refresh translations 2012-03-07 10:20:59 +00:00
Hans de Goede
50dd8c29ee virt-viewer-window: Add a USB device selection to the fullscreen menu (v2)
Note this button only gets shown on USB redir capable virtual machines.

Changes in v2:
-Use gtk_widget_set_visible for simpler code

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
ec5eaecb42 window: Call virt_viewer_app_quit instead of gtk_main_quit
When quiting from the fullscreen menu call virt_viewer_app_quit instead of
gtk_main_quit so that the session gets properly disconnected before quiting.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
8ec03e5097 virt_viewer_app_quit: Cleanly close the connection before quiting
Even though the previous patches in this series ensure that the session
gets properly finalized, we still need to wait for the disconnect signal,
as spice-glib uses co-routines which need some time to cleanly close the
connection / session.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
93eae5c49d session-spice: Delay the disconnected signal till all channels are closed
Before this patch session-spice would emit the disconnected signal as soon
as the main channel is closed, but other channels may still be open at
that time and raising the disconnected signal usally leads to the app class
calling gtk_main_quit, at which point the other channels never get properly
finalized (as there co-routines still hold a reference to them).

This is esp. bad for usbredir channels as these re-attach the kernel driver
for redirected devices when finalized. So exiting without properly finalizing
them leads to the formerly redirected devices not being usuable until the
driver is manually reloaded or the device is unplugged and re-plugged
(the kernel does not automatically re-bind kernel drivers when userspace
 closes a usbfs node).

This patch fixes this by delaying the emitting of the disconnect signal
until the last channel has been destroyed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
7c1414b318 virt-viewer-app: unref the session on dispose
With this patch combined with the previous patches in this series, the
VirtViewerSession (finally) gets properly finalized on exit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
0fa14f928e virt-viewer-display: Use a borrowed reference to session
Before this patch there was a cyclic reference between VirtViewerSesion and
VirtViewerDisplay, since all VirtViewerDisplays are created / destroyed by
VirtViewerSession it is safe to assume that lifetime of VirtViewerSession >=
VirtViewerDisplay, so VirtViewerDisplay can take a borrowed reference
breaking the circle, and allowing proper cleanup on exit.

Note that there is no g_object_unref removed from virt-viewer-display, this
because there is no finalize / dispose and before this patch
VirtViewerDisplay never unref-ed the reference it hold to the session.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
963c7ebd65 virt-viewer-window: Use a borrowed reference to app
Before this patch there was a cyclic reference between VirtViewerApp and
VirtViewerWindow, since all VirtViewerWindows are created / destroyed by
VirtViewerApp it is safe to assume that lifetime of VirtViewerApp >=
VirtViewerWindow, so VirtViewerWindow can take a borrowed reference
breaking the circle, and allowing proper cleanup on exit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
01e553d21b virt-viewer-app: main_window is part of our windows hashtable
This means that:
1) There is no need to explictly set its title separately
2) It is unref-ed when we do g_hash_table_unref(priv->windows), so it
   should not be unref-ed separately otherwise it is unref-ed twice!

Notice that 2 was never a problem because of circular references
between VirtViewerApp and VirtViewerWindow, but once the follow
up patch to this one breaks the circle 2 becomes an issue.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
e7a9f9ccdb session-spice: dispose should chain up to dispose not finalize!!
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
54a3e7d600 usbredir: Gnome HIG-ify USB device selection dialog
These changes match the changes already made to the spice-gtk
usb device selection widget to match the spacing advised by the Gnome HIG.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Hans de Goede
c8f3a9e843 usbredir: Shrink the usb device selection dialog when devices are unplugged
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-06 12:55:30 +01:00
Christophe Fergeau
f3ba403680 Don't attempt to translate ""
The empty string has a magic meaning for gettext, it's used to
store a translation header with all kind of information about the
po file. This is not something we want to use as a window title, so
change to _("") to "" when we want an empty string.
2012-03-05 20:03:41 +01:00
Christophe Fergeau
1d782164a4 Fix path to spice-controller.h 2012-03-05 20:03:41 +01:00
Daniel P. Berrange
3066ed3458 Remove trailing blank line 2012-03-01 16:49:03 +00:00
Marc-André Lureau
64e1616f75 fix make distcheck 2012-03-01 16:42:09 +01:00
Marc-André Lureau
1a82b225b6 Prepare for release 0.5.2 2012-03-01 16:37:23 +01:00
Marc-André Lureau
6a475e374b update .mailmap 2012-03-01 16:20:25 +01:00
Marc-Andre Lureau
2c9cdb6fb9 remote-viewer: support spice foreign menu 2012-03-01 15:17:25 +01:00
Marc-André Lureau
2e8b6650cf Add property app:has-focus 2012-03-01 15:15:58 +01:00
Marc-André Lureau
50b0c72392 Fix compilation with gtk 2.18 2012-03-01 15:15:51 +01:00
Marc-André Lureau
9a322010a3 spice: fix connecting via ssh to a password-protected server
spice_session_connect() will attempt to connect directly to the
server, we need to continue calling spice_session_open_fd() for ssh
tunnel to work.
2012-03-01 15:15:02 +01:00
Marc-André Lureau
9d7c9000c3 spice: fix double unref of main channel
When doing unref() on a channel, channel-destroy signal may be emitted
during object dispose time, and it will attempt to unref() the channel
again likely leading to a crash.

It may be that spice-gtk should have a different/simpler object
life-cycle model, but it's also a good assumption to not take strong
references on the channels, but just keep a weak reference as the
session is really the channel life-cycle manager.

https://bugzilla.redhat.com/show_bug.cgi?id=797082
2012-03-01 15:06:43 +01:00
Daniel P. Berrange
bfc7e605e5 Import translations 2012-02-27 08:17:58 +00:00
Marc-André Lureau
49df4ab19a nsis: set HKCU "Software\spice-space.org\spicex\client"
With recent RHEV portal plugin, the Spice client is chosen according
to this key.
2012-02-23 16:46:20 +01:00
Marc-André Lureau
e2082caa0a remote-viewer: add smartcard controller message 2012-02-22 16:45:11 +01:00
Marc-André Lureau
c0ec28ce8a spice: teach customizable key bindings with controller
Tested with RHEVM 3.0 instance with custom bindings for fullscreen &
ungrab.
2012-02-22 16:45:08 +01:00
Marc-André Lureau
946a70762e Small code simplification 2012-02-22 16:45:02 +01:00
Marc-André Lureau
51ca18beee Use the accelgroup to define key bindings
With accelgroups, we can redefine the keybindings
2012-02-22 16:45:00 +01:00
Marc-André Lureau
e6dfd324c4 Add hidden menu smartcard remove/insert and release-cursor 2012-02-22 16:44:27 +01:00
Marc-André Lureau
b768fafd66 Add virt_viewer_app_get_session() 2012-02-22 16:44:23 +01:00
Marc-André Lureau
8f1785ca62 spice: implement smartcard-{insert,remove} virtual methods 2012-02-22 16:44:18 +01:00
Marc-André Lureau
6c916253ee Add smartcard-{insert,remove} and release-cursor virtual methods 2012-02-22 16:44:11 +01:00
Marc-André Lureau
23dc09eacb Do not disable accelgroup if accels are enabled 2012-02-22 16:43:49 +01:00
Marc-André Lureau
dd857b648e Add VirtViewerApp:enable-accel property 2012-02-22 16:15:35 +01:00
Marc-André Lureau
2601ba1150 Require an accel group for full-screen menu
Bump Gtk depedency to 2.18, since we already use symbols from it.
2012-02-22 16:12:10 +01:00
Daniel P. Berrange
ce726a9a4d Prepare for release 0.5.1 2012-02-17 12:00:14 +00:00
Daniel P. Berrange
236fa1ce3c Remove virt-viewer.pot from git, as it is generated dynamically 2012-02-16 17:40:11 +00:00
Daniel P. Berrange
24ab6e6e40 Add back compat for GObject 2.22 which lacks GBinding 2012-02-16 14:52:55 +00:00
Daniel P. Berrange
c3baafc898 Relax GTK-VNC version again
A previous commit needlessly increased the min required GTK-VNC
2012-02-16 14:44:19 +00:00
Daniel P. Berrange
e1064a5355 Only link remote-viewer program against SPICE controller 2012-02-16 14:37:22 +00:00
Daniel P. Berrange
8b18ea0ea5 Remove use of a libtool convenience library
The use of a libtool convenience library causes some platforms to
loose the ability to use the GNU_RELRO security feature in the
resulting binary. Refactor the makefile to simply compile the
common files twice, once for virt-viewer & once for remote-viewer
2012-02-16 14:20:25 +00:00
Daniel P. Berrange
08f746be69 Import latest translations from transifex 2012-02-16 11:56:16 +00:00
Daniel P. Berrange
77808ceb5c Adjust POTFILES.in check to strip type prefix 2012-02-15 09:29:22 +00:00
Daniel P. Berrange
ab94026a08 Add transifex configuration file 2012-02-15 09:29:06 +00:00
Daniel P. Berrange
fbdb554c2d Fix inclusion of GtkBuilder files in virt-viewer.pot 2012-02-14 17:57:15 +00:00
Daniel P. Berrange
c18120b763 Refresh translation files 2012-02-14 17:23:40 +00:00
Daniel P. Berrange
c1ff4f4624 Update for release 0.5.0 2012-02-14 16:20:07 +00:00
Marc-André Lureau
1a3b233e55 First %d in controller title should be substituted with window nth 2012-02-14 16:19:45 +00:00
Marc-André Lureau
16307e0dc7 Add libp11-kit-0.dll to nsis script 2012-02-14 16:19:18 +00:00
Daniel P. Berrange
a140f396f3 Set pretty icon for remote-viewer windows too 2012-02-14 15:26:52 +00:00
Daniel P. Berrange
56b0217c62 Don't hardcode 'localhost' in no @listen parameter is given
If no @listen parameter is given, we must not hardcode 'localhost'
since we can't assume we are running on the same host. Instead use
the hostname from the connection URI
2012-02-14 14:55:39 +00: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
ced6fec518 Don't do whitespace checks on icons 2012-02-08 19:39:09 +00:00
Daniel P. Berrange
b0ba9e626a Set transient parent for screenshot dialog 2012-02-08 19:37:09 +00:00
Daniel P. Berrange
0fa4d098f9 Ensure auth popup windows have correct transient parent 2012-02-08 19:33:40 +00:00
Marc-André Lureau
28830c8596 Make the password field activates default widget
When pressing "Enter", the default auth dialog action isn't activated.
Setting activates_default to TRUE fixes this issue.
2012-02-08 17:15:20 +00:00
Marc-André Lureau
bbf040b777 Do not resize guest desktop if !auto-resize
If auto-resize is enabled, the guest desktop size will be resized to
match current window*zoom size.

This can be a problem if the user explicitely set the desktop size to
a different resolution and want to keep it. Disabling auto-resize
sounds like a simple way to allow that.
2012-02-08 17:15:20 +00:00
Marc-André Lureau
f87cdc9e24 Resize Spice guest display to the container size
The SpiceDisplay doesn't receive the full allocation, because
VirtViewerDisplay maintains current aspect ratio. However, the guest
display can be resize up to its container size.

This fixes going full-screen and not getting native resolution for
instance.
2012-02-08 17:15:20 +00:00
Daniel P. Berrange
e9ff27efe2 Ensure About dialog has transient hints setup 2012-02-08 17:15:16 +00:00
Daniel P. Berrange
c2d114b613 Import a pretty icon for virt-viewer application 2012-02-08 16:41:37 +00:00
Daniel P. Berrange
3349a1d42e Re-added GtkBuilder XML files to POTFILES.in
Adapt syntax-check  rule to allow XML files in POTFILES.in and
re-add the GtkBuilder XML files
2012-02-08 13:32:42 +00:00
Daniel P. Berrange
50632ea038 Implement SPICE desktop resizing that takes account of zoom level
The standard SPICE widget guest resize implementation does not
take into account the zoom level settings in virt-viewer, because
it has no knowledge of this functionality. The guest resize can,
however, be done by calling spice_main_set_display() directly.
This allows virt-viewer to resize the guest taking into account
zoom levels.

 ie, if virt-viewer is run with --zoom 50 and the window
     is resized to 400x300, then the guest agent should
     be told to set its resolution to 800x600
2012-02-08 13:23:48 +00:00
Daniel P. Berrange
3a8cdd901f Revert support for resizing guest desktop
The SpiceDisplay widget has built-in support for resizing the
guest desktop, but this does not know that virt-viewer has a
zoom level setting. This makes the virt-viewer zoom completely
inoperable. Revert use of the 'resize-guest' property.
2012-02-07 17:08:37 +00:00
Marc-André Lureau
0e40961d49 Add spice-xpi-client-remote-viewer alternative 2012-02-06 14:22:42 +00:00
Marc-André Lureau
0cb4fe4972 man: add remote-viewer man page 2012-02-06 14:21:30 +00:00
Daniel P. Berrange
d9825f3c74 Import GNULIB rules for syntax checking code 2012-02-06 12:42:23 +00:00
Daniel P. Berrange
5a19f8aae3 Add config.h to every source file 2012-02-06 12:42:22 +00:00
Daniel P. Berrange
0949dedef7 Use exit() constants 2012-02-06 12:42:22 +00:00
Daniel P. Berrange
f4d8b45181 copyright fix 2012-02-06 12:42:22 +00:00
Daniel P. Berrange
bf00dc893c End of file whitespace cleanup 2012-02-06 12:42:22 +00:00
Daniel P. Berrange
4f45576704 Update POTFILES.in 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
d7c58a3f2e Replace @FOO@ with $(FOO) in all Makefile.am 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
a893d5ef61 Update copyright headers 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
48c50437fa Remove useless if() before free() 2012-02-06 12:42:18 +00:00
Daniel P. Berrange
df1ae9f686 Update AUTHORS file 2012-02-06 12:42:14 +00:00
Daniel P. Berrange
9cc4c188ff Simplify no-op debug macro & fix plugin header 2012-02-06 12:40:10 +00:00
Daniel P. Berrange
3b9a6d9cba Fix makefile.am subsitutions for plugin 2012-02-06 12:40:10 +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
Marc-André Lureau
0e6f0847d8 Grab the focus when showing the display
Override the grab_focus() method in the display class. Since both VNC
and Spice displays are the direct child, let's just grab the child.
It can be that this behaviour need to be overriden if Spice or VNC
display become more complex (using sub-childs or different objects)
2012-02-06 12:28:05 +00:00
Daniel P. Berrange
d679451659 Ignore more generated files 2012-01-31 14:39:06 +00:00
Guannan Ren
c3a4bdc039 Disconnect virt-viewer when receiving signal session-cancelled 2012-01-31 14:37:17 +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
Daniel P. Berrange
5bc4c0b342 Support for virDomainOpenGraphics API
Add a new flag --attach, which instructs virt-viewer to attach
to the target display using virDomainOpenGraphics, instead of
initiating a VNC/SPICE connection directly.
2012-01-31 14:27:17 +00:00
Daniel P. Berrange
a94100eaeb Make VNC support opening connections based on URI 2012-01-31 14:10:29 +00:00
Daniel P. Berrange
6c6ec5f9ea Adapt remote-viewer so that it builds without SPICE 2012-01-31 14:06:00 +00:00
Marc-André Lureau
e2799ecfa6 Add virt-viewer.nsis
Use ${DESTDIR} variable and @prefix@ to look for files.
Can't easily be generated, it has too much customization.
2012-01-31 13:20:26 +00:00
Marc-André Lureau
dfb26d59b0 Enable spice auto-usbredir 2012-01-31 13:20:26 +00:00
Marc-André Lureau
2dcd3fa617 Remove usage of deprecated property 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
c285624bb0 Resize guest desktop with SPICE
This is the method we prefer, even though we can't keep aspect ratio.
We could eventually support aspect ration in spice-gtk.
2012-01-31 13:19:29 +00:00
Marc-André Lureau
944ad9ebd0 build: make libvirt optionnal 2012-01-31 12:36:14 +00:00
Marc-André Lureau
091bff3cc2 Use a first letter capital in help
The GLib/GNOME convention seems to have first letter as capital for
option description strings.
2012-01-31 12:36:14 +00:00
Marc-André Lureau
15b9f669a7 Add spice_get_option_group() 2012-01-31 12:36:14 +00:00
Marc-André Lureau
392b69b6db Add spice controller support in remote-viewer
Usage is simply "remote-viewer --spice-controller"
2012-01-31 12:36:14 +00:00
Marc-André Lureau
2a8ed0522e Add remote-viewer program
This program is meant for direct URI connections.
ex: remote-viewer vnc://uri
2012-01-31 12:36:04 +00:00
Marc-André Lureau
80a3192603 Add a few property getters, used by controller
- virt_viewer_app_get_windows()
- virt_viewer_window_get_builder()
- "VirtViewerSessionSpice:spice-session" property
2012-01-30 17:42:11 +00:00
Marc-André Lureau
67284efecf build: use AM_GLIB_GNU_GETTEXT
Using intltool macro only causes build issues on exotic platforms,
such as MinGW.

As long as this bug isn't fixed, we should use AM_GLIB_GNU_GETTEXT
https://bugs.launchpad.net/intltool/+bug/398571

NB this partially reverts

  3473c4bb49adc0caca58dc1a8b6ce81c6870558a

The difference is the ordering of the rules. With AM_GLIB_GNU_GETTEXT
appearing after IT_PROG_INTLTOOL, the --disable-nls arg to configure
is broken. Thus AM_GLIB_GNU_GETTEXT is called first in this change.
2012-01-30 17:32:40 +00:00
Marc-André Lureau
83897072b2 Make virt_viewer_activate() a vfunc
since other equivalent methods are already overridable.
2012-01-30 17:10:36 +00:00
Marc-André Lureau
3cee81ac3a Add window-added & window-removed signals 2012-01-30 17:10:26 +00:00
Marc-André Lureau
8edbbcf18e Use graphical URI for connection
If specified, use URI for connection details
2012-01-30 17:10:21 +00:00
Marc-André Lureau
629ddc1b5d Add virt_viewer_session_open_uri 2012-01-30 17:10:18 +00:00
Marc-André Lureau
b1d2f16790 build: replace deprecated functions 2012-01-30 17:10:12 +00:00
Daniel P. Berrange
a42efc728c Add support for --system arg to autogen.sh 2012-01-30 16:54:00 +00:00
Daniel P. Berrange
111d80a8cb Prep for 0.4.2 release 2011-11-09 15:13:11 +00:00
Daniel P. Berrange
5cf73d0a81 Automatically generate changelog from GIT history during make dist 2011-11-07 12:42:15 +00:00
Marc-André Lureau
c03a75122e Update POTFILES.in, fix make distcheck 2011-11-07 12:24:03 +00:00
Daniel P. Berrange
b92cbd4010 Ignore some more generated files 2011-11-07 12:23:39 +00:00
Marc-André Lureau
15cc78d91c build: make gtk-vnc optional 2011-11-07 12:22:15 +00:00
Daniel P. Berrange
9c5f7bfcf2 Require GTK-VNC 0.4.3 and remove redundant realize() call
Remove call to gtk_widget_realize for the GTK-VNC widget. Requires
GTK-VNC >= 0.4.3
2011-11-07 12:14:22 +00:00
Marc-André Lureau
1175841df9 Emit display-desktop-resize from set_desktop_size() 2011-11-07 12:12:53 +00:00
Daniel P. Berrange
c8b3cd9dd9 Don't include INSTALL file in GIT 2011-11-07 11:56:58 +00:00
Daniel P. Berrange
ea5c75645b Revert 1a56de3acad6a19fd958fae9278cf1c97fdabb18
The GLIB2 check previously removed was misleading because it in
fact checked for gmodule-export-2.0 which is needed to export
the signal handlers. Revert the previous commit, but rename the
var to GMODULE2 to make it clearer
2011-11-07 11:25:55 +00:00
Daniel P. Berrange
9319081827 Always use canonical URI from libvirt connection
The URI we feed into libvirt may be an alias, so always query the
actual URI used internally
2011-11-07 11:17:41 +00:00
Daniel P. Berrange
529343aa38 Update automated build to test both GTK2 and GTK3 builds 2011-11-04 11:44:43 +00:00
Daniel P. Berrange
8081b0d39c Update mingw32 RPM specfile to use GTK3 on F15 or later 2011-11-04 11:44:26 +00:00
Daniel P. Berrange
1a56de3aca Remove pkgconfig check for GLIB2 since it is implied by GTK2/3 2011-11-04 11:43:38 +00:00
Daniel P. Berrange
386aa61c9d Fix configure arg for disabling spice 2011-11-03 20:37:48 +00:00
Daniel P. Berrange
17445242a7 Print configuration summary 2011-11-03 20:36:30 +00:00
Daniel P. Berrange
59170953d5 Fix broken keycombos for F9->F12 menu
The table for sending C-A-Fn to guests had messed up mappings
for F9->F12
2011-10-11 10:38:00 +01:00
Daniel P. Berrange
09ee7d3220 Wire up SpiceDisplay grab signals
To ensure that we can put the key release sequence message in the
title bar, wire up VirtViewerDisplaySpice to the grab signals
in SpiceDisplay
2011-10-11 10:12:05 +01:00
Daniel P. Berrange
168af497b9 Fix setting of window title with --wait
When waiting for a VM to appear or start, set the initial window
title to the command line arg. When the VM actually appears then
update it to the real VM name
2011-10-11 10:01:10 +01:00
Daniel P. Berrange
986c040fd7 Fix crash from previous commit when using UNIX sockets
Code in the previous commit would use 'ghost' even when it was
NULL, as with UNIX domain socket based connections.
2011-09-28 16:39:02 +01:00
Daniel P. Berrange
41703dd458 Fix hostname when XML gives a wildcard address
When the guest XML contains a wildcard address like 0.0.0.0 or ::,
we can't directly use connect() on it. Instead we have to use the
hostname/IP from the libvirt URI.
2011-09-19 16:37:57 +01:00
Daniel P. Berrange
fe8551efba Propagate primary window zoom level to secondary windows
Ensure that all windows get a default zoom level of 100. Propagate
the primary window's zoom level to all secondary windows  when
initially creating them
2011-09-16 11:07:26 +01:00
Daniel P. Berrange
46cf6410c1 Fix setting of window title with domain name 2011-09-16 10:57:53 +01:00
Daniel P. Berrange
8bd178c8a8 Fix setting of initial zoom level on display 2011-08-16 09:08:51 -07:00
Guido Günther
f3714e3662 ff callbacks must be invoked from a clean stack
If 'ff' callbacks are invoked directly from the remove
callback they will likely deadlock in libvirt. They must
be invoked from a clean stack, so switch to using a
glib idle callback.
2011-08-16 08:36:18 -07:00
Guido Günther
e155f7f656 Don't print (null) as user 2011-08-14 12:35:52 -07:00
Guido Günther
60145f31a6 Don't print incorrect port numbers
The port isn't 22 when we connect to an alternate port given in
.ssh/config.
2011-08-14 12:35:52 -07:00
Guido Günther
1c00bc2b95 Don't hardcode ssh port to 0
Many thanks to Luca Capello <luca@pca.it> for debugging this.
2011-08-14 12:35:52 -07:00
Daniel P. Berrange
754011f2bc Fix inverted sshport test that broke SSH tunnelling 2011-08-12 15:37:51 +01:00
Marc-André Lureau
f08c5308ca Return if xmlParseURI() failed, instead of crashing 2011-08-04 13:32:25 +01:00
Marc-André Lureau
1002a220a4 Lookup UI file correctly, to fix Windows support 2011-08-04 13:32:17 +01:00
Marc-André Lureau
76bcf50dc4 Mark exported function for gtkbuild to lookup on Windows 2011-08-04 13:32:10 +01:00
Marc-André Lureau
78cac55443 Make title more translatable and using application name 2011-08-04 13:32:04 +01:00
Marc-André Lureau
4f9e54764c Use g_printerr for errors instead of fprintf(stderr,..) 2011-08-04 13:31:59 +01:00
Marc-André Lureau
0c37bba616 Lower severity of unhandled Spice events 2011-08-04 13:31:54 +01:00
Marc-André Lureau
0399dc5cc4 Add virt_viewer_app_show_display()
Similar to previous virt_viewer_app_show_status().
Used later on by Spice controller to switch between display and status.
2011-08-04 13:31:42 +01:00
Marc-André Lureau
80aaff91f9 Fix fullscreen should hide taskbar on Windows 2011-08-04 13:31:08 +01:00
Daniel P. Berrange
92672aee3b Update for 0.4.1 release 2011-08-04 11:12:58 +01:00
Daniel P. Berrange
cf1ae8bfab Update authors & copyright dates 2011-08-04 11:09:30 +01:00
Daniel P. Berrange
321f253ad1 Fix sort order of displays submenu 2011-08-04 10:34:18 +01:00
Guido Günther
39439b0b3e Don't hardcode SSH port to 22
To allow $HOME/.ssh/config to override the default SSH port,
don't hardcode '-p 22' in the command line.
2011-08-03 11:58:04 +01:00
Pavel Raiskup
d496a4091a Remove unreachable condition in authentication dialog 2011-08-03 11:55:31 +01:00
Daniel P. Berrange
760a503f8e Remove duplicated struct definition 2011-07-26 16:06:32 +01:00
Marc-André Lureau
c191d0ba53 If only one display, fullscreen should be on the current display 2011-07-26 12:00:29 +01:00
Marc-André Lureau
8d0f1d4235 Show status on all open windows
The split virt_viewer_notebook_show_status() to
virt_viewer_notebook_show_status_va() is unnecessary
in the end, but it's more future-proof.
2011-07-26 12:00:29 +01:00
Marc-André Lureau
0584170300 Add a "Displays" submenu, and warn when closing last display 2011-07-26 12:00:29 +01:00
Marc-André Lureau
425b1d8bd8 Don't ignore creation of secondary displays 2011-07-26 12:00:29 +01:00
Marc-André Lureau
734e789b22 Use app fullscreen property instead of app.start() argument 2011-07-26 12:00:29 +01:00
Marc-André Lureau
8f8abe849d Implement app_set_fullscreen() to go over existing windows 2011-07-26 12:00:29 +01:00
Marc-André Lureau
b5724b8f06 Show display and rise its window when we have the display show hint
Track event for Spice, and imitate it for VNC.
2011-07-26 12:00:28 +01:00
Marc-André Lureau
045f3ac9ea Change enter/leave fullscreen to take/restore position
That allow positionning windows in multi-head.

Also, get rid of window_state_cb, since it's impossible to
properly catch the event to do the right thing, ie move to a different
screen before go full-screen, or disallow it in case nb physical
monitors < nb virtual monitors.
2011-07-26 12:00:28 +01:00
Marc-André Lureau
08b292fb05 Add nth window to virt_viewer_app_window_new() 2011-07-26 12:00:28 +01:00
Marc-André Lureau
be529a879f Introduce fullscreen property and virt_viewer_app_set_fullscreen() 2011-07-26 12:00:28 +01:00
Marc-André Lureau
d64dd25713 Let virt_viewer_notebook_show_status take varags 2011-07-26 12:00:28 +01:00
Marc-André Lureau
dcbbf99050 Status messages can be translated 2011-07-26 12:00:28 +01:00
Marc-André Lureau
0430430284 Add show-hint property to display 2011-07-26 12:00:28 +01:00
Marc-André Lureau
c7ad98333d Split VirtViewerApp window into VirtViewerWindow 2011-07-26 11:16:34 +01:00
Marc-André Lureau
dd9c85a32d Inherit from VirtViewerApp for VirtViewer
Make it a real GObject.

The parts specific to virt should go in virt-viewer.c
2011-07-22 16:11:18 +01:00
Marc-André Lureau
e2c09a876b Turn VirtViewer into a VirtViewerApp object 2011-07-22 16:11:02 +01:00
Marc-André Lureau
9dcb071166 Split virt_viewer_start() and virt_viewer_new() 2011-07-22 16:10:25 +01:00
Marc-André Lureau
a1f0b01afc Split virt_viewer_activate() and virt_viewer_set_domain() 2011-07-22 16:09:14 +01:00
Marc-André Lureau
e56a8cb203 Split virt_viewer_create_session() out of virt_viewer_extract_connect_info()
For future reusability
2011-07-22 16:09:07 +01:00
Marc-André Lureau
824b12dab0 Reorder _VirtViewer to make it easier to split with RemoteViewer 2011-07-22 14:51:34 +01:00
Marc-André Lureau
3a42577932 Extract scheme in virt_viewer_extract_host()
Needed for remote-viewer.
2011-07-22 14:50:03 +01:00
Daniel P. Berrange
3473c4bb49 Remove use of AM_GLIB_GNU_GETTEXT
Since we already invoke the intltool macros, also invoking
AM_GLIB_GNU_GETTEXT is wrong and causes problems with the
later makefile rules
2011-07-18 13:56:49 +01:00
243 changed files with 61619 additions and 16802 deletions

6
.codespellrc Normal file
View File

@ -0,0 +1,6 @@
[codespell]
# ignore
# - the git directory; apparently codespell does not do it)
# - CI files, as most of them are autogenerated
# - po translations, as they contain non-English texts
skip = ./.git,./ci/*,.*/po/*

20
.dir-locals.el Normal file
View File

@ -0,0 +1,20 @@
(
(c-mode . (
(c-file-style . "K&R")
(indent-tabs-mode . nil)
(c-indent-level . 4)
(c-basic-offset . 4)
))
(html-mode . (
(indent-tabs-mode . nil)
))
(sh-mode . (
(indent-tabs-mode . nil)
))
(nxml-mode . (
(indent-tabs-mode . nil)
))
(perl-mode . (
(indent-tabs-mode . nil)
))
)

21
.editorconfig Normal file
View File

@ -0,0 +1,21 @@
# EditorConfig is a file format and collection of text editor plugins
# for maintaining consistent coding styles between different editors
# and IDEs. Most popular editors support this either natively or via
# plugin.
#
# Check https://editorconfig.org for details.
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.c]
indent_style = space
indent_size = 4
[*.{rng,xml}]
indent_style = space
indent_size = 2

30
.gitignore vendored
View File

@ -1,30 +0,0 @@
po/*.gmo
m4/*.m4
Makefile
Makefile.in
Makefile.in.in
*~
aclocal.m4
autom4te.cache/
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
man/*.1
*.spec
missing
.deps/
.libs
src/virt-viewer
po/POTFILES
po/stamp-it
*.o
stamp-h1

83
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,83 @@
stages:
- containers
- builds
- sanity_checks
.script_variables: &script_variables |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export SCRATCH_DIR="/tmp/scratch"
export VROOT="$SCRATCH_DIR/vroot"
export LIBDIR="$VROOT/lib"
export LD_LIBRARY_PATH="$LIBDIR"
export PATH="$VROOT/bin:$PATH"
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
.native_build_job:
extends:
- .gitlab_native_build_job
script:
- *script_variables
- meson build
- ninja -C build dist;
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
fi
.native_git_build_job:
extends:
- .gitlab_native_build_job
script:
- *script_variables
- pushd "$PWD"
- mkdir -p "$SCRATCH_DIR"
- cd "$SCRATCH_DIR"
- git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
- git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git
- git clone --depth 1 https://gitlab.gnome.org/GNOME/gtk-vnc.git
- cd libvirt
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- cd ../libvirt-glib
- meson build --prefix="$VROOT" --libdir="$LIBDIR" -Ddocs=disabled
- $NINJA -C build install
- cd ../gtk-vnc
- git submodule update --init
- meson build --prefix="$VROOT" --libdir="$LIBDIR"
- $NINJA -C build install
- popd
- meson build
- ninja -C build dist;
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
fi
.cross_build_job:
extends:
- .gitlab_cross_build_job
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- *script_variables
- meson build $MESON_OPTS
- $NINJA -C build
include: '/ci/gitlab.yml'
.codestyle_job:
extends:
- .gitlab_native_build_job
needs:
- job: x86_64-centos-stream-8-container
optional: true
stage: sanity_checks
script:
- *script_variables
- meson build || (cat build/meson-logs/meson-log.txt && exit 1)
- meson test -C build --suite syntax-check --no-rebuild || (cat build/meson-logs/testlog.txt && exit 1)
variables:
TARGET_BASE_IMAGE: quay.io/centos/centos:stream8
NAME: centos-stream-8

3
.mailmap Normal file
View File

@ -0,0 +1,3 @@
<berrange@redhat.com> <dan@berrange.com>
<marcandre.lureau@redhat.com> <marcandre.lureau@gmail.com>
Marc-André Lureau <marcandre.lureau@redhat.com> Marc-Andre Lureau <marcandre.lureau@redhat.com>

24
AUTHORS
View File

@ -1,24 +0,0 @@
Virt Viewer Authors
===================
The Virt Viewer application is written by
Daniel P. Berrange <berrange-at-redhat-dot-com>
With additional patches from:
Chris Lalancette <clalance-at-redhat-dot-com>
Atsushi SAKAI <sakaia-at-jp-dot-fujitsu-dot-com>
Richard W.M. Jones <rjones-at-redhat-dot-com>
Guido G\374nther <agx-at-sigxcpu-dot-org>
Hiroyuki Kaguchi <fj7025cf-at-aa-dot-jp-dot-fujitsu-dot-com>
Ronnie Sahlberg <ronniesahlberg@gmail.com>
Marc-André Lureau <marcandre.lureau-at-redhat-dot-com>
...send patches to get your name here...
The Translation team are listed in the .po files for their
languages under the po/ directory.
-- End

21
AUTHORS.in Normal file
View File

@ -0,0 +1,21 @@
Virt Viewer Authors
===================
The Virt Viewer application is maintained by
Daniel P. Berrange <berrange@redhat.com> (Original author)
Christophe Fergeau <cfergeau@redhat.com>
Marc-André Lureau <marcandre.lureau@redhat.com>
Hans de Goede <hdegoede@redhat.com>
Michal Privoznik <mprivozn@redhat.com>
With additional patches & translations from:
#authorslist#
...send patches to get your name here...
For full translation credits see the header of the individual
files in the po/ directory.
-- End

974
ChangeLog
View File

@ -1,974 +0,0 @@
2011-02-21 Daniel P. Berrange <dan@berrange.com>
* configure.ac:
Fix typo in SPICE configure setup
[cfb261f0ffed] [tip]
* .hgtags:
Added tag release-0.3.0 for changeset 807203083e74
[22b287a68428]
* ChangeLog, NEWS, README, configure.ac:
Updates for 0.3.0 release
[807203083e74] [release-0.3.0]
* virt-viewer.spec.in:
Fix misc RPM specfile bugs
[74bd54a2be1b]
2011-02-11 Daniel P. Berrange <dan@berrange.com>
* Merge heads
[63a275e6efad]
2011-02-08 yurchor <yurchor@fedoraproject.org>
* po/uk.po:
l10n: Updates to Ukrainian (uk) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[42abba3e0529]
2011-02-08 elsupergomez <elsupergomez@fedoraproject.org>
* po/es.po:
l10n: Updates to Spanish (Castilian) (es) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[f59694a06f0e]
2011-02-11 Daniel P. Berrange <dan@berrange.com>
* autobuild.sh:
Disable mozilla plugin since it doesn't build currently
[a15854eff628]
* virt-viewer.spec.in:
Enable SPICE in Fedora 15 or later
[4e4482cfc5df]
2011-02-07 Daniel P. Berrange <dan@berrange.com>
* configure.ac:
Update pkg-config check for spice-gtk library
[35b857dedeee]
2011-02-04 warrink <warrink@fedoraproject.org>
* po/nl.po:
l10n: Updates to Dutch (Flemish) (nl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[4bdba329fd50]
2011-02-04 raven <raven@fedoraproject.org>
* po/pl.po:
l10n: Updates to Polish (pl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[819835e085c6]
* po/pl.po:
l10n: Updates to Polish (pl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[8e8defe7444c]
2011-02-03 Daniel P. Berrange <dan@berrange.com>
* src/viewer.c:
Fix waiting for VM based on UUID
[607c42b3aba6]
* src/viewer-priv.h, src/viewer.c:
Support connections over UNIX sockets
[4f6b2cf8d10a]
* src/viewer.c:
Avoid fetching XML document multiple times when extracting graphics
[eccf7b274d8c]
2011-01-29 fdaluisio <fdaluisio@fedoraproject.org>
* po/it.po:
l10n: Updates to Italian (it) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[c1559894facc]
2011-01-28 tomspur <tomspur@fedoraproject.org>
* po/de.po:
l10n: Updates to German (de) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[8e6056966e8c]
2011-01-12 andreyjktl <andreyjktl@fedoraproject.org>
* po/ru.po:
l10n: Updates to Russian (ru) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[6a5fa15abaa3]
2011-01-10 elsupergomez <elsupergomez@fedoraproject.org>
* po/es.po:
l10n: Updates to Spanish (Castilian) (es) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[aaf4f61830cc]
2010-12-21 jassy <jassy@fedoraproject.org>
* po/pa.po:
l10n: Updates to Panjabi (Punjabi) (pa) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[72eb4f8f3bc0]
2010-12-16 warrink <warrink@fedoraproject.org>
* po/nl.po:
l10n: Updates to Dutch (Flemish) (nl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[c2bc3efb0265]
2010-12-15 raven <raven@fedoraproject.org>
* po/pl.po:
l10n: Updates to Polish (pl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[879ab95fa860]
2010-12-10 Marc-André Lureau <marcandre.lureau@redhat.com>
* configure.ac, src/Makefile.am, src/viewer.c:
build: make spice-gtk dependency optional
[992d73fd6a85]
2010-11-30 Marc-André Lureau <marcandre.lureau@redhat.com>
* src/display-spice.c, src/display-vnc.c, src/display.h, src/viewer.c,
src/viewer.glade:
viewer: add support for spice resize-guest
And also turn on clipboard sharing.
[328f3f0f57d2]
* AUTHORS, configure.ac, man/Makefile.am, man/virt-viewer.pod,
po/POTFILES.in, src/Makefile.am, src/auth.c, src/auth.h, src
/display-spice.c, src/display-spice.h, src/display-vnc.c, src
/display-vnc.h, src/display.c, src/display.h, src/viewer-priv.h,
src/viewer.c, src/viewer.glade:
viewer: Add support for Spice
[e9167b61921b]
2010-11-19 Marc-André Lureau <marcandre.lureau@redhat.com>
* src/viewer.c:
viewer: generalize extract_port() into viewer_extract_xpath_string()
[dbcb547de1e9]
* src/viewer.c:
viewer: silence a few warnings of unused variables
[bc2713b7997b]
* src/viewer.c:
viewer: split vnc display creation out of viewer_activate()
[de2d7bf9bd1e]
2010-12-14 Daniel P. Berrange <dan@berrange.com>
* src/auth.c:
Improve auth dialog message when no address is available
[526813f252f3]
2010-11-17 tombo <tombo@fedoraproject.org>
* po/it.po:
l10n: Updates to Italian (it) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[fa512d3379da]
2010-10-04 giallu <giallu@fedoraproject.org>
* po/it.po:
l10n: Updates to Italian (it) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[d0eba3f3dcf4]
2010-09-30 aron <aron@fedoraproject.org>
* po/zh_CN.po:
l10n: Updates to Chinese (China) (zh_CN) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[eb3fb9f7894c]
2010-08-10 bozzo <bozzo@fedoraproject.org>
* po/fr.po:
l10n: Updates to French (fr) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[d5bc241ed9f7]
2010-08-03 warrink <warrink@fedoraproject.org>
* po/nl.po:
l10n: First Dutch translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[bfb63c06f06d]
2010-07-22 ankit <ankit@fedoraproject.org>
* po/gu.po:
l10n: Updates to Gujarati (gu) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[44d8dc6c88f7]
2010-07-09 Daniel P. Berrange <dan@berrange.com>
* Merge heads
[45de382c1988]
2010-07-06 raven <raven@fedoraproject.org>
* po/pl.po:
l10n: Updates to Polish (pl) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[c374cc9b4e33]
2010-07-06 elsupergomez <elsupergomez@fedoraproject.org>
* po/es.po:
l10n: Updates to Spanish (Castilian) (es) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[5c703e23a2b4]
2010-07-09 Ronnie Sahlberg <ronniesahlberg@gmail.com>
* man/virt-viewer.pod:
Misc fixes to command line args in virt-viewer manpage
Fix three issues with the manpage for virt-viewer :
* Short option for --reconnect is -r, not -w
* Show that the short option for zoom takes an argument
* Add the --debug argument.
[67e2d8113af9]
2010-07-05 Ronnie Sahlberg <ronniesahlberg@gmail.com>
* AUTHORS, man/virt-viewer.pod, src/main.c, src/viewer.c,
src/viewer.glade, src/viewer.h:
Add support for zoom levels
Add a menu for zooming in/out of the virtual desktop.
Add a --zoom command line to set the initial zoom level.
Defaults to 100% zoom at startup
[99cd453a8746]
2010-07-05 Daniel P. Berrange <dan@berrange.com>
* po/LINGUAS:
Add all current languages to LINGUAS file
No locale files were being installed since all the languages were
missing in LINGUAS
[9111b6888676]
2010-06-27 zoltanh721 <zoltanh721@fedoraproject.org>
* po/hu.po:
l10n: Updates to Hungarian (hu) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[10cd88edd331]
2010-06-25 htaira <htaira@fedoraproject.org>
* po/ja.po:
l10n: Updates to Japanese (ja) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[31ea04a18446]
2010-06-09 htaira <htaira@fedoraproject.org>
* po/ja.po:
l10n: Updates to Japanese (ja) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[a0786647b8e9]
2010-04-14 mvdz <mvdz@fedoraproject.org>
* po/uk.po:
l10n: Updates to Ukrainian (uk) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[47d846d27fdd]
2010-03-31 enshahar <enshahar@fedoraproject.org>
* po/ko.po:
l10n: Updates to Korean (ko) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[4ea747fc1d6b]
2010-03-30 webappz <webappz@fedoraproject.org>
* po/hu.po:
l10n: Updates to Hungarian (hu) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[c2e41385dabf]
* po/hu.po:
l10n: Updates to Hungarian (hu) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[f38b2e86c5ef]
* po/hu.po:
l10n: Updates to Hungarian (hu) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
[2e4d842c62af]
2010-03-22 mvdz <mvdz@fedoraproject.org>
* po/uk.po:
l10n: Added Ukrainian translation.
Transmitted-via: Transifex (translate.fedoraproject.org)
[88ad52cdf0aa]
2010-03-14 amitakhya <amitakhya@fedoraproject.org>
* po/as.po:
l10n: Adding Assamese translations.
Transmitted-via: Transifex (translate.fedoraproject.org)
[f815e2c8e5ad]
2010-02-26 runab <runab@fedoraproject.org>
* po/bn_IN.po:
Sending translation for po/bn_IN.po
[5c79b3bd5068]
2010-02-24 rajesh <rajesh@fedoraproject.org>
* po/hi.po:
Sending translation for po/hi.po
[c8f2537692e0]
2010-02-20 snicore <snicore@fedoraproject.org>
* po/hu.po:
Sending translation for po/hu.po
[1462825b8e02]
2010-02-08 anipeter <anipeter@fedoraproject.org>
* po/ml.po:
Sending translation for po/ml.po
[cd1284f62107]
2010-02-01 mgiri <mgiri@fedoraproject.org>
* po/or.po:
Sending translation for po/or.po
[78feb4d583ed]
2010-01-29 ifelix <ifelix@fedoraproject.org>
* po/ta.po:
Sending translation for po/ta.po
[7d4d3f5993a2]
2010-01-29 jassy <jassy@fedoraproject.org>
* po/pa.po:
Sending translation for Punjabi
[a5842cd7e908]
2010-01-28 sandeeps <sandeeps@fedoraproject.org>
* po/mr.po:
Sending translation for po/mr.po
[9de827a3645a]
2010-01-28 shanky <shanky@fedoraproject.org>
* po/kn.po:
Sending translation for po/kn.po
[32bedf3379c1]
2010-01-28 giallu <giallu@fedoraproject.org>
* po/it.po:
Sending translation for Italian
[4169a6aa9f03]
2010-01-28 jassy <jassy@fedoraproject.org>
* po/pa.po:
Sending translation for po/pa.po
[90ae444ba69c]
2010-01-28 kkrothap <kkrothap@fedoraproject.org>
* po/te.po:
Sending translation for po/te.po
[fca3f9a5bc8b]
2010-01-28 mospina <mospina@fedoraproject.org>
* po/ko.po:
Sending translation for Korean
[185dc845cc3f]
2010-01-25 "Daniel P. Berrange <berrange@redhat.com>
* po/it_IT.po:
Remove bogus it_IT.po file, correct name was it.po
[87e34764f943]
2010-01-24 tchuang <tchuang@fedoraproject.org>
* po/zh_TW.po:
Sending translation for po/zh_TW.po
[e50f8116a8ab]
2010-01-24 raven <raven@fedoraproject.org>
* po/it.po:
Sending translation for po/it.po
[9b614ce582ea]
2010-01-23 giallu <giallu@fedoraproject.org>
* po/it_IT.po:
Sending translation for po/it_IT.po
[ee470027df65]
2010-01-22 hedda <hedda@fedoraproject.org>
* po/de.po:
Sending translation for German
[557f60ac53b3]
2010-01-22 leahliu <leahliu@fedoraproject.org>
* po/zh_CN.po:
Sending translation for Chinese (Simplified)
[c9d98ce01d93]
2010-01-22 khasida <khasida@fedoraproject.org>
* po/ja.po:
Sending translation for po/ja.po
[34d80402dbed]
2010-01-22 mospina <mospina@fedoraproject.org>
* po/ko.po:
Sending translation for po/ko.po
[2b9684476fe6]
* po/es.po:
Sending translation for Spanish
[e08c6128ea8f]
2010-01-22 ypoyarko <ypoyarko@fedoraproject.org>
* po/ru.po:
Sending translation for Russian
[b11d479ee1f4]
2010-01-22 gcintra <gcintra@fedoraproject.org>
* po/pt_BR.po:
Sending translation for po/pt_BR.po
[892a90a8af67]
2010-01-22 samfreemanz <samfreemanz@fedoraproject.org>
* po/fr.po:
Sending translation for French
[5b55be5a0e46]
2010-01-22 hedda <hedda@fedoraproject.org>
* po/de.po:
Sending translation for po/de.po
[b13384930995]
2010-01-22 leahliu <leahliu@fedoraproject.org>
* po/zh_CN.po:
Sending translation for Chinese (Simplified)
[a2e13f979d94]
2010-01-21 leahliu <leahliu@fedoraproject.org>
* po/zh_CN.po:
Sending translation for po/zh_CN.po
[18b0c5353fef]
2010-01-21 ypoyarko <ypoyarko@fedoraproject.org>
* po/ru.po:
Sending translation for po/ru.po
[f22e478e8046]
2010-01-21 mospina <mospina@fedoraproject.org>
* po/es.po:
Sending translation for po/es.po
[cd6be7781059]
2010-01-21 swkothar <swkothar@fedoraproject.org>
* po/gu.po:
Sending translation for po/gu.po
[ed59815240d9]
2010-01-18 renault <renault@fedoraproject.org>
* po/fr.po:
Sending translation for po/fr.po
[f0a3b5b30f92]
2010-01-15 "Daniel P. Berrange <berrange@redhat.com>
* .hgtags:
Added tag release-0.2.1 for changeset 13bcca43c859
[236029760251]
* AUTHORS, ChangeLog, NEWS, README, configure.ac:
Updates for 0.2.1 release
[13bcca43c859] [release-0.2.1]
2010-01-13 raven <raven@fedoraproject.org>
* po/pl.po:
Sending translation for Polish
[d114aac4cfb8]
2010-01-12 "Daniel P. Berrange <berrange@redhat.com>
* src/viewer.c:
Add message dialog displays for important error scenarios
[6d1f30e5fb71]
* src/auth.glade:
Fix warning with default widget focus in auth dialog
[e0e91e221add]
* src/viewer.c:
Add dialog to alert user to unsuccessful authentication & retry
Alert user if VNC server has no compatible auth methods Support VNC
bell & cut text events
[f098a86755a7]
* configure.ac:
Turn on automake's silent build rules if available
[d388340febbc]
* src/main.c, src/viewer.c:
Various cleanups for Glib/GTK and BZ 474213
[c13f1d31eab7]
2010-01-11 raven <raven@fedoraproject.org>
* po/pl.po:
Sending translation for Polish
[31af732a9a55]
2010-01-11 "Daniel P. Berrange <berrange@redhat.com>
* .hgignore, mingw32-virt-viewer.spec.in, po/LINGUAS, po/virt-
viewer.pot, src/about.glade, virt-viewer.spec.in:
Add 'pl' to LINGUAS. Remove accidentally committed .pot file and add
it to .hgignore. Add RPM specfile magic for translations. Fix typo
in about.glade URL
[09c9db915104]
2010-01-11 raven <raven@fedoraproject.org>
* po/pl.po, po/virt-viewer.pot:
Sending translation for po/pl.po
[affb21844c39]
2010-01-11 "Daniel P. Berrange <berrange@redhat.com>
* .hgignore, Makefile.am, autogen.sh, configure.ac, intltool-
extract.in, intltool-merge.in, intltool-update.in, po/LINGUAS,
po/POTFILES.in, src/Makefile.am, src/main.c:
Add support for i18n of the UI
Add all the boilerplate code required for doing i18n of the UI. No
translations available yet though
[07db22b2f766]
2009-08-15 "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
* src/util.h:
viewer: fix build on 'old' GTK2
Debian lenny has gtk2 2.12.12, which is missing
gtk_widget_get_window. Provide our own function if GTK2 <= 2.12 .
Highly inspired from: http://osdir.com/ml/svn-commits-
list/2009-08/msg00725.html
[e05cd5be9c36]
2009-07-29 "Daniel P. Berrange <berrange@redhat.com>
* .hgtags:
Added tag release-0.2.0 for changeset b38a2c67ebfd
[99ba88ee7820]
* NEWS, configure.ac, virt-viewer.spec.in:
Update for 0.2.0 release
[b38a2c67ebfd] [release-0.2.0]
* plugin/Makefile.am:
Disable compile errors in plugin till we figure out what's up with
the header files
[f2fabc428441]
* mingw32-virt-viewer.spec.in, virt-viewer.spec.in:
Update deps in rpm
[d5ef17c7856e]
* src/viewer.c:
Ensure VNC display is centered if being scaled
[f5e758b7a271]
* src/auth.glade:
Ensure password is not echoed
[e826ca02a7d4]
* src/auth.c, src/auth.glade, src/auth.h, src/util.h, src/viewer.c:
Add support for libvirt graphical auth
[a8e92767179f]
* plugin/Makefile.am, src/Makefile.am, src/auth.c, src/auth.h,
src/events.c, src/events.h, src/util.c, src/util.h, src/viewer.c,
src/viewer.h:
Pull auth code out into separate file
[1471c65b8280]
2009-07-28 "Daniel P. Berrange <berrange@redhat.com>
* plugin/Makefile.am, plugin/npshell.c, plugin/npupp.h,
plugin/test.html, plugin/virt-viewer-plugin.c, plugin/virt-viewer-
plugin.h, src/viewer.c:
Make plugin work again
[68646d3db76d]
* src/viewer.c:
Add compatability logic for drivers without domain event support
[c29276a0f2ec]
* src/viewer.c:
Fix mouse / key grab vs modifier disabling mixup
[6cdf7dfa223d]
* configure.ac, mingw32-virt-viewer.spec.in, plugin/Makefile.am,
src/Makefile.am, src/events.c, src/events.h, src/viewer.c, virt-
viewer.spec.in:
Pull glib event loop integration into tree until libvirt-glib is
more mature
[dd92609022ac]
* src/viewer.c, src/viewer.glade:
Re-write the way scaling/resizing works
* Default to auto-resize mode where we try to fit the VNC widget 1:1
in the main window
* If local desktop is not large enough for VNC widget, scale down,
maintaining aspect ratio
* Allow the user to turn off auto-resize and have total manual control
over window size
* Always scale the display in fullscreen mode
[3521ee2a63e6]
* plugin/virt-viewer-plugin.c, src/main.c, src/viewer.c, src/viewer.h:
Add a --debug command line flag
[1a3b36e0b6f2]
* src/viewer.c:
Fix waiting for a VM that does not initially exist
[da53b8f99cdf]
* plugin/Makefile.am, plugin/npshell.c, src/Makefile.am, src/main.c,
src/viewer.c:
Move most of viewer code out into viewer.c
[8f237adf2792]
2008-11-28 "Daniel P. Berrange <berrange@redhat.com>
* autobuild.sh, configure.ac, mingw32-virt-viewer.spec.in, virt-
viewer.spec.in:
Initial mingw32 build support
[92da1556bbf9]
* src/main.c:
Use g_strdup & friends
[029b506ca4cf]
* configure.ac, src/main.c, src/usleep.c:
Remove unused usleep code
[ac45bee371c8]
2008-11-26 "Daniel P. Berrange <berrange@redhat.com>
* .hgignore, autogen.sh, configure.ac, man/virt-viewer.pod,
plugin/Makefile.am, plugin/npshell.c, plugin/virt-viewer-plugin.c,
plugin/virt-viewer-plugin.h, src/Makefile.am, src/about.glade,
src/auth.glade, src/main.c, src/viewer.glade, src/viewer.h, virt-
viewer.spec.in:
Re-write completely to use Glade, libvirt events, and libvirt-glib
integration
[8e98b3d44c8d]
2008-11-03 "Daniel P. Berrange <berrange@redhat.com>
* plugin/Makefile.am:
Fix rule to use DESTDIR on plugin install
[e70af57502f9]
2008-10-10 "Richard W.M. Jones <rjones@redhat.com>
* .hgignore, ChangeLog, configure.ac, src/Makefile.am, src/main.c,
src/usleep.c:
* configure.ac, src/Makefile.am, src/main.c, src/usleep.c: Support
for building on Windows using MinGW compiler toolchain (or
for cross-compiling using the same).
* .hgignore: Ignore some generated files.
[2cce513346ae]
2008-06-17 "Daniel P. Berrange <berrange@redhat.com>
* src/main.c:
Add error message when conecting to inactive VM (Hiroyuki Kaguchi)
[57d1fb020d57]
2008-04-27 "Daniel P. Berrange <berrange@redhat.com>
* configure.ac, src/main.c:
Use GTK apis for option parsing (Guido G\374nther)
[5299a3aaebb5]
2008-04-23 "Daniel P. Berrange <berrange@redhat.com>
* AUTHORS, src/main.c:
Avoid caching inactive domain to workaround issues with older XenD
(Hiroyuki Kaguchi)
[7f20b8bb6abd]
2008-04-22 "Daniel P. Berrange <berrange@redhat.com>
* AUTHORS, src/main.c:
Call gtk_init early to ensure it grabs args like --sync
[5f14440985f8]
2008-04-08 "Daniel P. Berrange <berrange@redhat.com>
* man/virt-viewer.pod:
Fix manpage typo
[e2ee322e3d1a]
2008-03-21 "Daniel P. Berrange <berrange@redhat.com>
* configure.ac:
Bump GTK dep to 2.10.0
[d8cf9d390762]
2008-03-10 "Daniel P. Berrange <berrange@redhat.com>
* .hgtags:
Added tag release-0.0.3 for changeset 05f9c167354b
[5d426425c850]
* ChangeLog, NEWS:
Refresh news / changelog for release
[05f9c167354b] [release-0.0.3]
2008-03-09 "Daniel P. Berrange <berrange@redhat.com>
* autobuild.sh, configure.ac, virt-viewer.spec.in:
Added -plugin sub RPM, disabled by default, except for autobuild
[efcac0fc56b5]
2008-03-08 "Daniel P. Berrange <berrange@redhat.com>
* configure.ac:
Relax firefox plugin version to 1.5.0
[0252cf01fe3c]
2008-03-07 "Daniel P. Berrange <berrange@redhat.com>
* src/main.c:
Disable scaling by default if running on composited window
[aadb3fb8316e]
* src/main.c:
Block view menu accelerator & remove debug
[01e11e3566ff]
* src/main.c, virt-viewer.spec.in:
Added support for desktop scaling with OpenGL
[23cd61984e4c]
2008-03-05 "Daniel P. Berrange <berrange@redhat.com>
* .hgignore, acinclude.m4, autobuild.sh, autogen.sh, configure.ac,
plugin/Makefile.am, plugin/npshell.c, plugin/npunix.c, plugin/virt-
viewer-plugin.c, src/main.c:
Kill automake portability warnings. Use a config.h Cleanup misc
build issues. Build with fatal compile warnings
[7254e127a017]
* src/main.c:
Disable menu accelerators when keyboard is grabbed (Chris Lalancett)
[50ed4d0b0632]
* autogen.sh:
Fix type in autogen.sh output (Chris Lalancett)
[25932c2b565a]
2008-01-25 "Daniel P. Berrange <berrange@redhat.com>
* .hgignore, Makefile.am, autogen.sh, configure.ac,
plugin/Makefile.am, plugin/npshell.c, plugin/npunix.c,
plugin/test.html, plugin/virt-viewer-plugin.c, plugin/virt-viewer-
plugin.h:
Added browser plugin (Richard Jones)
[09761c04bdcd]
* AUTHORS, src/Makefile.am, src/main.c, src/viewer.h:
Refactor main method for viewer to prepare for plugin (Richard Jones
[270fbc7d4192]
2008-01-11 "Daniel P. Berrange <berrange@redhat.com>
* src/main.c:
Whitespace fix
[fe1efb558b4b]
* src/main.c:
Hide chars in passwd field
[69daa8257222]
2008-01-10 "Daniel P. Berrange <berrange@redhat.com>
* AUTHORS, NEWS, README, man/virt-viewer.pod, src/main.c:
Fix a few typos (Atsushi SAKAI)
[a0d79af724b0]
2007-11-29 "Daniel P. Berrange <berrange@redhat.com>
* AUTHORS, src/main.c:
Use proper domain name in title bar, rather than VNC server title
[59fccec87973]
2007-08-28 "Daniel P. Berrange <berrange@redhat.com>
* .hgtags:
Added tag release-0.0.2 for changeset f3accb51c6f5
[97f00b8df38a]
* src/main.c:
Fix crash with no transport
[f3accb51c6f5] [release-0.0.2]
* ChangeLog, NEWS, configure.ac, virt-viewer.spec.in:
New release 0.0.2
[3d88506cc468]
* man/virt-viewer.pod:
Document the '--direct' option
[0d9a8fd612d9]
* src/main.c:
Support TLS credentials & improved SSH tunnelling
[2ca6f1a9ba64]
* src/main.c:
Support for connecting over an SSH tunnel
[33102c06fd50]
2007-08-27 "Daniel P. Berrange <berrange@redhat.com>
* Merge
[c40130b3a7ec]
* src/main.c:
Added initial ability to connect remote hosts
[ac9cae161efb]
* src/main.c:
Disable debug flag
[61d8448ba53f]
* src/main.c:
Fixed delete-event handler args
[21f7b4c5c93c]
2007-08-15 "Daniel P. Berrange <berrange@redhat.com>
* COPYING, INSTALL:
Added COPYING/INSTALL files
[1f83ef35bb59]
* .hgtags:
Added tag release-0.0.1 for changeset 2b78ab2d18ce
[916abae9a263]
* virt-viewer.spec.in:
Fixed build requires & group. Removed exclusivearch
[2b78ab2d18ce] [release-0.0.1]
* AUTHORS, NEWS, README, virt-viewer.spec.in:
Fill out authors, news & readme
[6a74d1951e33]
2007-07-20 "Daniel P. Berrange <berrange@redhat.com>
* src/main.c:
Connected up screenshot & about menus
[7cd9b16e3185]
* Makefile.am, configure.ac, man/Makefile.am, man/virt-viewer.pod,
virt-viewer.spec.in:
Added manual page
[db9f0ff467e5]
* .hgignore, AUTHORS, ChangeLog, Makefile.am, NEWS, README,
acinclude.m4, autobuild.sh, autogen.sh, configure.ac,
src/Makefile.am, src/main.c, virt-viewer.spec.in:
Initial commit
[df454dc97f2f]

236
INSTALL
View File

@ -1,236 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,21 +0,0 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man plugin po
EXTRA_DIST = @PACKAGE@.spec \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCLEAN_FILES = @PACKAGE@.spec \
intltool-extract \
intltool-merge \
intltool-update
MAINTAINERCLEANFILES = \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4

496
NEWS
View File

@ -1,6 +1,502 @@
Virt Viewer News
================
11.0: Nov 18, 2021
------------------
- Minimum libgovirt is now 0.3.7
- CentOS 7 is no longer a supported build platform
- Use header bar for oVirt ISO dialog
- Add change CD button to toolbar for oVirt
- Support using ISOs in oVirt DATA storage domains
- Remove clashing -r command line shortcut for 'resize'
that clashed with existing 'reconnect' shortcut
- Support modifier-only hotkeys for cursor release
- Fix smartcard and USB hotkey configuration regression
- Add USB device reset hotkey support
- Fix various mixed up GTK actions for hotkeys
- Release keyboard grab at same time as mouse grab with
SPICE
- Fix misc compiler warnings with glib > 2.68
- Fix creation of window when guest uses multiple
heads with a single QXL video card
- Updated translations from weblate
- Avoid warnings from GTK from overly strict minimum
desktop width/height rules
- Update window action sensitivity to fix regression
causing disabled send key menu items
- Fix mixed up action / menu state when user cancels
a quit request
- Ensure auth dialog credential fields are cleared
- Fix setting os-id when building RPMs
- Avoid extra hyphen in build ID strings
- Explicitly disable spice/ovirt features when invoking
meson for RPM builds
- Fix uninitialized variable for keymaps
10.0: Apr 20, 2021
------------------
- Switch to use Meson for build system instead of autotools
- Require libvirt >= 1.2.8
- Redesign UI to use title bar widget instead of menu bar
- Request use of dark theme by default, if available
- Don't filter out oVirt DATA storage domains
for ISO image sharing
- Add --keymap arg to allow keys to be remapped
- Display error message if no extension is present
for screenshot filename
- Fix misc memory leaks
- Use nicer error message if not ISOs are available
- Use more explicit accelerator hint to distinguish
left and right ctrl/alt keys
- Report detailed file transfer errors
- Use standard about diaglog
- Refresh and improve translations
- Install appstream data file in preferred location
- Refresh appstream data file contents
- Display VM title when listing VMs, if available
- Display VM description as tooltop, if available
- Sort VM names when listing
- Enable ASLR and NX for Windows builds
- Add --shared arg to request a shared session for VNC
- Disable all accels when not grabbed in kiosk mode
- Allow num keypad to be used for zoom changes
- Disable grab sequence in kiosk mode to prevent escape
- Allow zoom hotkeys to be set on the command line / vv file
- Display error message if VNC connection fails
- Fix warnings about atomics with new GLib
- Remove use of deprecated GTK APIs
- Document cursor ungrab sequence in man pages
- Honour Ctrl-C when auth dialog is active
- Minor UI tweaks to auth dialog
- Support VM power control actions with VNC
- Add --cursor arg to control whether a local pointer is
rendered with VNC
- Add --auto-resize arg and menu to control whether to
resize the remote framebuffer to math local window size
- Add support for remote framebuffer resize with VNC
- Handle case sensitivity when parsing accelerator mappings
9.0: May 1, 2020
-----------------
- Project moved to https://gitlab.com/virt-viewer/virt-viewer
- Allow toggling shared clipboard in remote-viewer
- Fix handling when initial spice connection fails
- Fix check for govirt library
- Add bash completion of cli args
- Improve errors in file transfer dialog
- Fix ovirt foreign menu storage domains query
- Prefer TLS certs from oVirt instead of CLI
- Improve USB device cleanup when Ctrl-C is used
- Remember monitor mappings across restarts
- Add a default file extension to screenshots
- Updated translations
- Fix misc memory leaks
8.0: Mar 1, 2019
-----------------
- Fix warnings with latest GCC versions
- More strictly filter out non-ISO images in ovirt menu
- Require libgovirt >= 0.3.3
- Require librest >= 0.8
- Support UNIX and TLS URI schemes for spice
- Fix full screen monitor placement under wayland
- Fix command line encoding on Windows
- Ensure VM name is set in window title
- Support unix-path in .vv files
- Support text console windows via VTE
- Add machine power control menu options
- Record full build env in MSI installer
7.0: Jul 27, 2018
-----------------
- Require spice-gtk >= 0.35
- Clarify error message when no running VM is found
- Improve check for libgovirt requirements
- Support "-" as a URI for input connection file
- Remove support for spice controller interface
- Misc man page fixes
- Lookup win32 translations relative to install dir
- Position connect window in center not top-left
- Misc fixes for ovirt foreign menu support
6.0: Aug 15, 2017
-----------------
- Mention use of ssh-agent in man page
- Display connection issue warnings in main window
- Switch to GTask API
- Add support changing CD ISO with oVirt foreign menu
- Update various outdated links in README
- Avoid printing password in debug logs
- Pass hostname to authentication dialog
- Fix example URLs in man page
- Add args to virt-viewer to specify whether to
resolve VM based on ID, UUID or name
- Fix misc runtime warnings
- Improve support for extracting listening info from XML
- Enable connecting to SPICE over UNIX socket
- Fix warnings with newer GCCs
- Allow controlling zoom level with keypad
- Don't close app during seamless migration
- Don't show toolbar in kiosk mode
- Re-show auth dialog in kiosk mode
- Don't show error when cancelling auth
- Change default screenshot name to 'Screenshot.png'
- Report errors when saving screenshot
- Fix build with latest glib-mkenums
5.0: Nov 24, 2016
-----------------
- Don't retry authentication when credentials
are provided via vvfile
- Fix display of guest name in title for VNC
- Fix detection of domain stop when tunnelling
over SSH
- Fix problem resizing with GTK client side
decorations
- Fix leak on file transfer
- Only include native spec file in dist to fix
rpmbuild -ta
- Check min required spice-glib version
- Display errors to user if failing to open UNIX socket
- Simplify file transfer UI to only display overall
progress, rather than full list of files
- Show list of files which failed to transfer
4.0: Jun 20, 2016
-----------------
- Drop support for gtk2 builds
- Require spice-gtk >= 0.31
- Require glib2 >= 2.38
- Require gtk3 >= 3.10
- Require libvirt-glib >= 0.1.8
- Increase minimum window size to 320x200 instead of 50x50
- Remove use of GSLice
- Don't show usbredir button if not connected yet
- Only compute monitor mapping in full screen
- Don't ignore usb-filter in spiec vv-file
- Port to use GtkApplication API
- Don't leave window open after connection failure
- Validate symbols from max glib/gdk versions
- Don't use GtkStock
- Don't use gtk_widget-modify_{fg,bg} APIs
- Drop use of built-in eventloop in favour of libvirt-glib
- Don't open X display while parsing command line
- Fix window title
- Use GResource for building ui files into binary
- Fix crash with invalid spice monitor mapping
- Add dialog to show file transfer progress and allow
cancelling
- Remove unused nsis installer support
- Include adwaita icon theme in msi builds
- Add more menu mnemonics
- Fix support for windows consoles to allow I/O redirection
- Add support for ovirt sso-token in vv-file
- Fix crash with zooming window while not connected
- Remove custom auto drawer widget with GtkRevealer
- Add appdata file for gnome software
- Misc other bug fixes
- Refresh translations
3.0: Dec 3, 2015
----------------
- Last release to support GTK2 for Linux. The next
4.0 release will be GTK3 only.
- Don't add URI scheme / path info to oVirt URIs
- Require spice-gtk >= 0.30
- Enable webdav folder sharing with spice
- Add preferences UI dialog
- Take --direct into account when checking if guest is
reachable
- Take SPICE proxy into account when connecting to oVirt
instances
- Fail gracefully when hostname is not returned by
oVirt
- Don't show empty foreign menu on secondary displays
- Avoid accidentally trying to connect to port 0 when
oVirt doesn't specify a port number
- Correctly update geometry when enabling/disabling
display heads
- Avoid accidentally creating extra monitors when using
configuration file monitor mapping
- Exit normally when cancelling connect dialog
- Don't wait for a guest that we know will never show up
- Fix crash when using --reconnect with SPICE
- Avoid zooming out if it would decrease window size
below minimum required for top menu display
- Fix crash when disabling last enabled display
- Honour changes in display position from guest
- Don't show error dialog twice for unknown graphics type
- Allow to cancel oVirt auth without error
- Set sensitivity of display menu based on whether it is
usable or not
- Set sensitivity of tool bar buttons based on whether they
are usable or not
- Set guest name reported by VNC
- Fix crash when using gtk-vnc 0.3.8
- Fix alt-tab behaviour in choose VM dialog
- Don't allow missing display in monitor mapping config
- Add --with-osid flag to configure to allow specifying
the operating system build target. The values should
be based on libosinfo OS short IDs.
- Ensure windows installer places menu icon for all users
not just admin. Requires manual uninstall of previous
windows version
- Require address in remote viewer connect dialog
- Automatically retry VNC connection after auth failure
- Drop GTK2 support for Windows builds
- Enable keepalives on libvirt connection
- Allow resize of window to arbitrary size
- Fix thread safety handling event callbacks
- Avoid deprecation warnings with newer glib
- Pulled in multiple fixes for event loop from libvirt-glib
- Fix misc bugs reported by coverity
- Fix binary ID in MSI installer
- Stop polling libvirt after reconnceting to libvirt
2.0: Jan 12, 2015
-----------------
- Fix handling of zoom in/out accelerators
- Fix warning going in/out of fullscreen
- Add dialog showing info about the current guest
- Change format of fullscreen config setting to
allow for sparse guest displays
- Write VM name to config file as a comment
- Never use fallback CA certs when loading vv-file
- Remove extraneous '/' from oVirt URIs
- Support oVirt foreign menus
- Allow using numapad for zoom in/out accelerators
- Force geometry update when agent connects
- Fix misc crash bugs
- Fix misc memory leaks
- Allow viewing of password entry characters
- Don't fail when auth dialog is cancelled
- Only create extra windows on demand
- Use more sensible default window size
- Improve docs for URIs and config files
- Allow cancellation of SPICE auth dialog
- Use new libvirt API for --attach to avoid SELinux AVC
- Allow removable of CD images with oVirt connections
- Show VM choose dialog when oVirt VM name is missing
- Support usernames request with SASL auth
- Use socat instead of nc if available
- Use PNG instead of SVG for icons
- Support connection to UNIX sockets instead of TCP
- Honour zoom level from CLI args with VNC
- Switch to GTK3 instead of GKT2 for Windows builds
- Ensure dialogs have transient parent set
- Switch to gstreamer 1.0 instead of 0.10 for Windows builds
- Avoid accidentally connecting to localhost with VNC/SPICE
- Use a versioned install directory for Windows builds
1.0: Jul 21, 2014
-----------------
- Switched to 2-digit version numbering.
- Improve error reporting when failing to find
the GtkBuilder UI files
- Honour title provided by SPICE server if available
- Don't hide main window when disconnecting in multi-monitor
configurations
- Don't show VNC widget until authentication has completed
- Fix session handling when re-authenticating
- Improve docs for --attach flag
- Ask for credentials for SPICE proxy
- Fix scaling of windows when resizing
- Remove 'Automatically resize' menu, leaving the behaviour
permanently enabled
- Improve USB icon in full screen toolbar
- Don't resize guest when changing zoom level
- Don't create windows at startup if kiosk mode isn't enabled
- Don't show quit confirmation dialog in kiosk mode
- Misc typos / fixes in man pages
- Fix race with metacity window manager in fullscreen mode
- Avoid accidentally connecting to localhost with --direct flag
- Use custom log handler to silence debug messages on old glib2
- Fix tiny windows for secondary displays with gtk2 build
- Take zoom into account when checkign display limits
- Fix unshrinkable displays with windows guests
- Allow ctrl-[+-] to zoom in fullscreen mode
0.6.0: Jan 24, 2014
-------------------
- Require govirt 0.3.0
- Require spice-gtk 0.22
- Show error dialog if password is wrong
- Document application/x-virt-viewer file format
- Remove unused '-d' option from remote-viewer
- Add a kiosk mode
- Add menu for sending Ctrl+Alt+Delete
- Add Ctrl+Alt+End as accelerator for Ctrl+Alt+Delete
- Send modifiers before the non-modifier key in send
key menu
- Fix GTK warning when disconnecting from VNC due to
auth error
- Make 'Cancel' default button in exit dialog
- Make send key menu accelerators work in fullscreen
- Remove insecure fetching of oVirt CA cert
- Build for GTK 3 by default
- Fix title bar after failed connection
- Reshow remote-viewer connection dialog upon error
- Hide all windows upon disconnect
- Add ability to define custom monitor mapping
- Ensure all windows obey command line zoom level
- Add an icon to the desktop file
- Fix event loop implementation on Win32 platforms
- Misc other bug fixes
0.5.7: Jul 31, 2013
-------------------
- Many fixes to full screen / window positioning handling
- Reshow connect dialog if connection fails
- Misc man page fixes
- Mark RPM as obsoleting spice-client
- Set the host subject to fix SSL connections with ovirt
- Use -H as short variant of --hotkeys
- Add missing trailing ';' in desktop file
- Allow TLS only SPICE connections
- Use dynamic key send menu
- Enable smartcard shortcuts only when smartcard reader is present
- Misc other bug fixes
0.5.6: Apr 12, 2013
-------------------
- Add ovirt:// support to remote-viewer (needs libgovirt)
- Many fullscreen and multi-monitor fixes
- Add a minimum version check in connection file
- Fix sending key combinations from "Send Key" menu when the key names are
localized
- Fix build with older glib and gtk+
- Fix MSI x64 build
- Clean-ups (remove browser plugin entirely)
0.5.5: Feb 13, 2013
-------------------
- Improve screenshot saving dialog
- remote-viewer learned to connect with a file of mime type
application/x-virt-viewer, described in src/virt-viewer-file.c
- Add a "do not ask me again" dialog checkbox when leaving
- Add a MSI target, using https://live.gnome.org/msitools
- Add windows debug helper, useful in Spice controller running context
- Add remote-viewer --title STRING
- Support for Spice proxy settings added
- Numerous Spice display and multi-monitor fixes
- win32, memory, build, and other misc fixes
- Requires spice-gtk >= 0.16.26
0.5.4: Sep 17, 2012
-------------------
- Fix host migration with Spice
- Fix misc memory leaks
- Fix build with newer glibc and -O0
- Improve automatic fullscreen Spice configuration
- Avoid crash when quitting application
- Rebuild display men whenever a window is added/removed
- Number displays starting from 1 instead of 0
- Add support for handling multiple monitors with Spice
- Menu display menu insensitive if no displays can be selected
- Use real binary name in remote-viewer help message
- Document -f=auto-conf in remote-viewer help
0.5.3: May 14, 2012
-------------------
- Add support for raw IPv6 addresses
- Add a remote-viewer.desktop file and register spice:// handling
- Add a simple connection dialog to remote-viewer
- Add remote-viewer --fullscreen=auto-conf option, to update guest
monitors configuration to match client
- Spice controller support for disable-effects, color-depth and
usbredir
- Spice controller interaction fixes
- Windows version and nsis installer improvements
- Import newer translations from transifex
- Misc reference leak / crash bugs fixed
0.5.2: Mar 09, 2012
-------------------
- Require libvirt >= 0.9.7, spice-gtk >= 0.11, spice-protocol >= 0.10.1
- Import newer translations from transifex
- remote-viewer learned Spice controller customizable key bindings,
smartcard property, and foreign menu
- Fix Spice crash on re-connection
- Fix connecting via ssh to a password-protected server
- Add a sendkey menu in fullscreen mode
- Add USB device selection in fullscreen mode
- Misc reference leak / crash bugs fixed
0.5.1: Feb 17, 2012
-------------------
- Import newer translations from transifex
- Fix build system to ensure we don't loose GNU_RELRO
security feature
- Don't link virt-viewer binary against spice controller
- Add back compat for GObject 2.22 which lacks GBinding
0.5.0: Feb 14, 2012
-------------------
- Add a remote-viewer binary for connecting to a SPICE/VNC
server based on URI, instead of querying libvirt
- Add ability to attach to a local VM via libvirt instead of
connecting over UNIX sockets
- Add support for SPICE controller
- Allow build without libvirt, for remote-viewer only
- Automatically resize guest desktop when resizing window with SPICE
- Add support for redirecting host USB devices to remote guest
- Grab focus when first showing the display
- Register as a spice-xpi-client-remote alternative
- Add pretty icon for virt-viewer app
- Set transient window hints on all popups
- Activate password 'Ok' button when pressing Enter
- Support secure connections with SPICE
- Don't hardcode 'localhost' for hostname
0.4.2: Nov 9, 2011
-------------------
- Fix exports of signal functions for GTK UI builder on Windows
- Avoid crash if xmlParseURI fails
- Fix inverted test for SSH port that broke tunnelling
- Don't hardcode port numbers for SSH if not requested by user
- Fix deadlock in event handling
- Fix initial zoom level for all windows
- Fix window title to include domain name
- Fix hostname used when XML gives a wildcard IP address
- Fix window title when waiting for domain to appear
- Fix key shortcust for F9-F12 menus
- Always ask libvirt for its canonical URI
- Allow build without GTK-VNC (ie spice only)
- Require GTK-VNC >= 0.4.3
- Require SPICE-GTK >= 0.6.0
0.4.1: Aug 4, 2011
-------------------
- Remove bogus use of AM_GLIB_GNU_GETTEXT macro to try to
facilitate BSD builds
- Support multiple monitors with SPICE and QXL drivers
- Don't hardcode SSH port to 22 when tunnelling
0.4.0: Jul 12, 2011
-------------------

41
README
View File

@ -1,41 +0,0 @@
Virt Viewer
===========
Virt Viewer provides a graphical viewer for the guest OS
display. At this time is supports guest OS using the VNC
or SPICE protocols. Further protocols may be supported in
the future as user demand dicatates. The viewer can connect
directly to both local and remotely hosted guest OS, optionally
using SSL/TLS encryption.
Virt Viewer can be built with either GTK2 or GTK3, with the
default option currently being GTK2. The choice can be made
with:
./configure --with-gtk=3.0 (or =2.0)
Virt Viewer uses the GTK-VNC widget to provide a display
of the VNC protocol. This is available from
http://gtk-vnc.sourceforge.net/
Optionally Virt Viewer can also provide a SPICE client
using the SPICE-GTK widget (>= 0.6) available from
http://spice-space.org/page/Spice-Gtk
Virt Viewer uses libvirt to lookup information about the
guest OS display. This is available from
http://libvirt.org/
Further information about the Virt Viewer application can be
found on the Virt Manager website:
http://virt-manager.org/
Feedback should be directed to the mailing list at
http://virt-manager.org/mailinglist.html
-- End

38
README.md Normal file
View File

@ -0,0 +1,38 @@
# Virt Viewer
Virt Viewer provides a graphical viewer for the guest OS
display. At this time is supports guest OS using the VNC
or SPICE protocols. Further protocols may be supported in
the future as user demand dictates. The viewer can connect
directly to both local and remotely hosted guest OS, optionally
using SSL/TLS encryption.
Virt Viewer is the GTK3 application. Virt Viewer 3.0 was
the last release that supported GTK2.
Virt Viewer uses the GTK-VNC (>= 0.4.0) widget to provide a
display of the VNC protocol, which is available from
https://wiki.gnome.org/Projects/gtk-vnc
Virt Viewer uses the SPICE-GTK (>= 0.35) widget to provide a
display of the SPICE protocol, which is available from:
https://www.spice-space.org/download.html
Use of either SPICE-GTK or GTK-VNC can be disabled at time
of configure, with `--without-gtk-vnc` or `--without-spice-gtk`
respectively.
Virt Viewer uses libvirt to lookup information about the
guest OS display. This is available from
https://libvirt.org/
Bug reports / support questions should be submitted to
https://gitlab.com/virt-viewer/virt-viewer/-/issues
Code contributions should be submitted as merge requests to
https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests

View File

@ -1,89 +0,0 @@
dnl
dnl Taken from gnome-common/macros2/gnome-compiler-flags.m4
dnl
dnl We've added:
dnl -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
dnl We've removed
dnl CFLAGS="$realsave_CFLAGS"
dnl to avoid clobbering user-specified CFLAGS
dnl
AC_DEFUN([VIRT_VIEWER_COMPILE_WARNINGS],[
dnl ******************************
dnl More compiler warnings
dnl ******************************
AC_ARG_ENABLE(compile-warnings,
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
[Turn on compiler warnings]),,
[enable_compile_warnings="m4_default([$1],[maximum])"])
warnCFLAGS=
try_compiler_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables"
case "$enable_compile_warnings" in
no)
;;
minimum)
try_compiler_flags="$try_compiler_flags -Wall"
;;
yes)
try_compiler_flags="$try_compiler_flags -Wall -Wmissing-prototypes -std=c99"
;;
maximum|error)
try_compiler_flags="$try_compiler_flags -Wall -Wmissing-prototypes -std=c99 -Wnested-externs -Wpointer-arith"
try_compiler_flags="$try_compiler_flags -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return"
# Removed -Wstrict-prototypes to avoid GTK bug
try_compiler_flags="$try_compiler_flags -Winline -Wredundant-decls -Wno-sign-compare"
if test "$enable_compile_warnings" = "error" ; then
try_compiler_flags="$try_compiler_flags -Werror"
fi
;;
*)
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
;;
esac
compiler_flags=
for option in $try_compiler_flags; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT($has_option)
if test $has_option = yes; then
compiler_flags="$compiler_flags $option"
fi
unset has_option
unset SAVE_CFLAGS
done
unset option
unset try_compiler_flags
AC_ARG_ENABLE(iso-c,
AC_HELP_STRING([--enable-iso-c],
[Try to warn if code is not ISO C ]),,
[enable_iso_c=no])
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
complCFLAGS=
if test "x$enable_iso_c" != "xno"; then
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) complCFLAGS="$complCFLAGS -ansi" ;;
esac
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) complCFLAGS="$complCFLAGS -pedantic" ;;
esac
fi
fi
AC_MSG_RESULT($complCFLAGS)
WARN_CFLAGS="$compiler_flags $complCFLAGS"
AC_SUBST(WARN_CFLAGS)
])

View File

@ -1,59 +0,0 @@
#!/bin/sh
set -e
set -v
# Make things clean.
test -f Makefile && make -k distclean || :
rm -rf build
mkdir build
cd build
../autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT \
--enable-compile-warnings=error \
--disable-plugin
make
make install
rm -f *.tar.gz
make dist
if [ -n "$AUTOBUILD_COUNTER" ]; then
EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
else
NOW=`date +"%s"`
EXTRA_RELEASE=".$USER$NOW"
fi
if [ -f /usr/bin/rpmbuild ]; then
rpmbuild --nodeps \
--define "extra_release $EXTRA_RELEASE" \
--define "_sourcedir `pwd`" \
-ba --clean virt-viewer.spec
fi
if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
make distclean
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig" \
CC="i686-pc-mingw32-gcc" \
../configure \
--build=$(uname -m)-pc-linux \
--host=i686-pc-mingw32 \
--prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \
make
make install
#set -o pipefail
#make check 2>&1 | tee "$RESULTS"
if [ -f /usr/bin/rpmbuild ]; then
rpmbuild --nodeps \
--define "extra_release $EXTRA_RELEASE" \
--define "_sourcedir `pwd`" \
-ba --clean mingw32-virt-viewer.spec
fi
fi

View File

@ -1,51 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
THEDIR=`pwd`
cd $srcdir
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile virt-viewer."
echo "Download the appropriate package for your distribution,"
echo "or see http://www.gnu.org/software/autoconf"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
DIE=1
echo "You must have automake installed to compile virt-viewer."
echo "Download the appropriate package for your distribution,"
echo "or see http://www.gnu.org/software/automake"
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "I am going to run ./configure with not arguments - if you "
echo "wish to pass any extra arguments to it, please specify them on "
echo "the $0 command line."
fi
libtoolize --copy --force
intltoolize --force
aclocal -I m4
autoheader
automake --add-missing --copy
autoconf
cd $THEDIR
$srcdir/configure "$@" && {
echo
echo "Now type 'make' to compile virt-viewer."
}

View File

@ -0,0 +1,4 @@
install_data(
'virt-viewer',
install_dir: bash_completion_dir
)

109
bash-completion/virt-viewer Normal file
View File

@ -0,0 +1,109 @@
#
# virt-viewer completer
#
_virt_viewer_complete()
{
local words cword c w cur URI CMDLINE MODE DOMS
# Here, $COMP_WORDS is an array of words on the bash
# command line that user wants to complete. However, when
# parsing command line, the default set of word breaks is
# applied. This doesn't work for us as it mangles virt-viewer
# arguments, e.g. connection URI (with the default set it's
# split into multiple items within the array). Fortunately,
# there's a fixup function for the array.
_get_comp_words_by_ref -n "\"'><=;|&(:" -w words -i cword
COMP_WORDS=( "${words[@]}" )
COMP_CWORD=${cword}
cur=${COMP_WORDS[$COMP_CWORD]}
MODE="--name"
ALL="--all"
# See what URI is user trying to connect to. Honour that.
for ((c=1; c<=${COMP_CWORD}; c++)); do
case "${COMP_WORDS[c]}" in
-c|--connect)
if [[ -n "${COMP_WORDS[c+1]}" ]]; then
URI="${COMP_WORDS[c+1]}"
c=$((++c))
fi
;;
--connect=*)
w=${COMP_WORDS[c]#*=}
if [[ -z "$w" ]] ; then
return
fi
URI=$w
;;
--domain-name)
# Generate list of domain names which is done below
MODE="--name"
ALL="--all"
;;
--uuid)
# Generate list of domain UUIDs which is done below
MODE="--uuid"
ALL="--all"
;;
--id)
# Generate list of domain IDs which is done below
MODE=""
ALL=""
;;
esac
done
case "$cur" in
--connect=*)
# Nada
return
;;
--display=*)
cur=${cur#*=}
DISPLAYS=$(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done)
COMPREPLY=($(compgen -W '${DISPLAYS}' -- "$cur"))
__ltrim_colon_completions "$cur"
return
;;
--kiosk-quit=*)
cur=${cur#*=}
COMPREPLY=($(compgen -W 'never on-disconnect' -- "$cur"))
return
;;
-*)
# If the current option already ends with '=' then don't generate
# any more --options
if [[ $cur == *= ]] ; then
return
fi
COMPREPLY=($(compgen -W '$( _parse_help "$1" -h )' -- "$cur"))
if [[ $COMPREPLY == *= ]] ; then
compopt -o nospace
fi
return
;;
esac
CMDLINE=
if [ -n "${URI}" ]; then
CMDLINE="${CMDLINE} -c ${URI}"
fi
DOMS=($(virsh -q -r ${CMDLINE} list ${ALL} ${MODE} 2>/dev/null | awk '{print $1;}' ))
COMPREPLY=($(compgen -W "${DOMS[*]%--}" -- ${cur}))
__ltrim_colon_completions "${cur}"
return
} &&
complete -F _virt_viewer_complete virt-viewer
# vim: ft=sh:et:ts=4:sw=4:tw=80

12
build-aux/buildenv.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python3
import subprocess
rpms = subprocess.check_output(["rpm", "-qa"])
rpms = rpms.decode("utf-8").split("\n")
rpms.sort()
for rpm in rpms:
if rpm == "":
continue
print(rpm, end="\r\n")

14
build-aux/dist.py Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python3
import os
import sys
meson_build_root = sys.argv[1]
file_name = sys.argv[2]
meson_dist_root = os.environ['MESON_DIST_ROOT']
os.system('cp {0} {1}'.format(
os.path.join(meson_build_root, file_name),
os.path.join(meson_dist_root, file_name)
))

8
build-aux/gen-authors.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env python3
import os
meson_source_root = os.environ['MESON_SOURCE_ROOT']
os.chdir(meson_source_root)
os.system('git log --pretty=format:"* %aN <%aE>" | sort -u')

14
build-aux/meson.build Normal file
View File

@ -0,0 +1,14 @@
scripts = [
'buildenv.py',
'dist.py',
'gen-authors.py',
'msitool.py',
'post_install.py',
'run-windres.py',
]
foreach name : scripts
sname = name.split('.')[0].underscorify()
set_variable('@0@_prog'.format(sname), find_program(name))
endforeach

84
build-aux/msitool.py Executable file
View File

@ -0,0 +1,84 @@
#!/usr/bin/python3
import os
import subprocess
import sys
import tempfile
if len(sys.argv) != 13:
print("syntax: %s BUILD-DIR PREFIX WIXL-ARCH MSIFILE WXS "
"BUILDENV WIXL-HEAT-PATH WIXL-PATH "
"HAVE_SPICE HAVE_VNC HAVE_LIBVIRT HAVE_OVIRT" % sys.argv[0])
sys.exit(1)
builddir = sys.argv[1]
prefix = sys.argv[2]
arch = sys.argv[3]
msifile = sys.argv[4]
wxs = sys.argv[5]
buildenv = sys.argv[6]
wixl_heat = sys.argv[7]
wixl = sys.argv[8]
have_spice = sys.argv[9]
have_vnc = sys.argv[10]
have_libvirt = sys.argv[11]
have_ovirt = sys.argv[12]
def build_msi():
if "DESTDIR" not in os.environ:
print("$DESTDIR environment variable missing. "
"Please run 'ninja install' before attempting to "
"build the MSI binary, and set DESTDIR to point "
"to the installation virtual root.", file=sys.stderr)
sys.exit(1)
if "MANUFACTURER" not in os.environ:
os.environ["MANUFACTURER"] = "The Virt Viewer Project"
vroot = os.environ["DESTDIR"]
manifest = []
for root, subFolder, files in os.walk(vroot):
for item in files:
path = str(os.path.join(root,item))
manifest.append(path)
wxsfiles = subprocess.run(
[
wixl_heat,
"-p", vroot + prefix + "/",
"--component-group", "CG.virt-viewer",
"--var", "var.DESTDIR",
"--directory-ref", "INSTALLDIR",
],
input="\n".join(manifest),
encoding="utf8",
check=True,
capture_output=True)
wxsfilelist = os.path.join(builddir, "data", "virt-viewer-files.wxs")
with open(wxsfilelist, "w") as fh:
print(wxsfiles.stdout, file=fh)
wixlenv = os.environ
wixlenv["MANUFACTURER"] = "Virt Viewer Project"
subprocess.run(
[
wixl,
"-D", "SourceDir=" + prefix,
"-D", "DESTDIR=" + vroot + prefix,
"-D", "HaveSpiceGtk=" + have_spice,
"-D", "HaveGtkVnc=" + have_vnc,
"-D", "HaveLibvirt=" + have_libvirt,
"-D", "HaveOVirt=" + have_ovirt,
"--arch", arch,
"-o", msifile,
wxs, wxsfilelist,
],
check=True,
env=wixlenv)
build_msi()

49
build-aux/post_install.py Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env python3
import os
import os.path
import subprocess
import sys
if "MESON_INSTALL_PREFIX" not in os.environ:
print("This is meant to be run from Meson only", file=sys.stderr)
sys.exit(1)
# If installing into a DESTDIR we assume
# this is a distro packaging build, so skip actions
if os.environ.get("DESTDIR", "") != "":
sys.exit(0)
if len(sys.argv) != 4:
print("%s UPDATE-MIME-DATABASE UPDATE-ICON-CACHE UPDATE-DESKTOP-DATABASE")
sys.exit(1)
prefix = os.environ["MESON_INSTALL_PREFIX"]
update_mime_database = sys.argv[1]
update_icon_cache = sys.argv[2]
update_desktop_database = sys.argv[3]
mime_dir = os.path.join(prefix, "share", "mime")
if update_mime_database != "" and os.path.isdir(mime_dir):
print("Updating mime database")
subprocess.run([update_mime_database, mime_dir],
check=True)
else:
print("Skipping mime database update")
if update_icon_cache != "":
print("Updating icon cache")
subprocess.run([update_icon_cache, "-qtf",
os.path.join(prefix, "share", "icons", "hicolor")],
check=True)
else:
print("Skipping icon cache update")
if update_desktop_database != "":
print("Updating desktop database")
subprocess.run([update_desktop_database, "-q",
os.path.join(prefix, "share", "applications")],
check=True)
else:
print("Skipping desktop database update")

18
build-aux/run-windres.py Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/python3
import sys
import subprocess
windres = sys.argv[1]
icondir = sys.argv[2]
manifestdir = sys.argv[3]
rcfile = sys.argv[4]
objfile = sys.argv[5]
subprocess.check_call([
windres,
"-DICONDIR=\\\"" + icondir + "\\\"",
"-DMANIFESTDIR=\\\"" + manifestdir + "\\\"",
"-i", rcfile,
"-o", objfile,
])

866
build-aux/syntax-check.mk Normal file
View File

@ -0,0 +1,866 @@
# -*-Makefile-*-
# This Makefile fragment tries to be general-purpose enough to be
# used by many projects via the gnulib maintainer-makefile module.
## Copyright (C) 2001-2011 Free Software Foundation, Inc.
## Copyright (C) 2008-2012 Red Hat, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
# This is reported not to work with make-3.79.1
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME := $(_build-aux)/syntax-check.mk
GIT = git
VC = $(GIT)
VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
# You can override this variable in syntax-check.mk to set your own regexp
# matching files to ignore.
VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
# This is to preprocess robustly the output of $(VC_LIST), so that even
# when $(srcdir) is a pathological name like "....", the leading sed command
# removes only the intended prefix.
_dot_escaped_srcdir = $(subst .,\.,$(srcdir))
# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
# when $(srcdir) is not ".".
ifeq ($(srcdir),.)
_prepend_srcdir_prefix =
else
_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
endif
# In order to be able to consistently filter "."-relative names,
# (i.e., with no $(srcdir) prefix), this definition is careful to
# remove any $(srcdir) prefix, and to restore what it removes.
_sc_excl = \
$(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
VC_LIST_EXCEPT = \
$(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
| if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT}"; fi \
| grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
my_distdir = $(PACKAGE)-$(VERSION)
# Prevent programs like 'sort' from considering distinct strings to be equal.
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
export LC_ALL = C
## --------------- ##
## Sanity checks. ##
## --------------- ##
_cfg_mk := $(shell test -f $(srcdir)/$(_build-aux)/syntax-check.mk && echo '$(srcdir)/$(_build-aux)/syntax-check.mk')
# Collect the names of rules starting with `sc_'.
syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
$(srcdir)/$(ME) $(_cfg_mk)))
.PHONY: $(syntax-check-rules)
ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
local-checks-available += $(syntax-check-rules)
else
local-checks-available += no-vc-detected
no-vc-detected:
@echo "No version control files detected; skipping syntax check"
endif
.PHONY: $(local-checks-available)
# Arrange to print the name of each syntax-checking rule just before running it.
$(syntax-check-rules): %: %.m
sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules))
.PHONY: $(sc_m_rules_)
$(sc_m_rules_):
@echo $(patsubst sc_%.m, %, $@)
@date +%s.%N > .sc-start-$(basename $@)
# Compute and print the elapsed time for each syntax-check rule.
sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules))
.PHONY: $(sc_z_rules_)
$(sc_z_rules_): %.z: %
@end=$$(date +%s.%N); \
start=$$(cat .sc-start-$*); \
rm -f .sc-start-$*; \
awk -v s=$$start -v e=$$end \
'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
# that computes and prints elapsed time.
local-check := \
$(patsubst sc_%, sc_%.z, \
$(filter-out $(local-checks-to-skip), $(local-checks-available)))
syntax-check: $(local-check)
# _sc_search_regexp
#
# This macro searches for a given construct in the selected files and
# then takes some action.
#
# Parameters (shell variables):
#
# prohibit | require
#
# Regular expression (ERE) denoting either a forbidden construct
# or a required construct. Those arguments are exclusive.
#
# in_vc_files | in_files
#
# grep-E-style regexp denoting the files to check. If no files
# are specified the default are all the files that are under
# version control.
#
# containing | non_containing
#
# Select the files (non) containing strings matching this regexp.
# If both arguments are specified then CONTAINING takes
# precedence.
#
# with_grep_options
#
# Extra options for grep.
#
# ignore_case
#
# Ignore case.
#
# halt
#
# Message to display before to halting execution.
#
# Finally, you may exempt files based on an ERE matching file names.
# For example, to exempt from the sc_space_tab check all files with the
# .diff suffix, set this Make variable:
#
# exclude_file_name_regexp--sc_space_tab = \.diff$
#
# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT,
# when filtering by name via in_files, we explicitly filter out matching
# names here as well.
# By default, _sc_search_regexp does not ignore case.
export ignore_case =
_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :)
define _sc_say_and_exit
dummy=; : so we do not need a semicolon before each use; \
{ printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; };
endef
# _sc_search_regexp used to be named _prohibit_regexp. However,
# upgrading to the new definition and leaving the old name undefined
# would usually convert each custom rule using $(_prohibit_regexp)
# (usually defined in syntax-check.mk) into a no-op. This definition ensures
# that people know right away if they're still using the old name.
# FIXME: remove in 2012.
_prohibit_regexp = \
$(error '*** you need to s/_prohibit_regexp/_sc_search_regexp/, and adapt')
define _sc_search_regexp
dummy=; : so we do not need a semicolon before each use; \
\
: Check arguments; \
test -n "$$prohibit" && test -n "$$require" \
&& { msg='Cannot specify both prohibit and require' \
$(_sc_say_and_exit) } || :; \
test -z "$$prohibit" && test -z "$$require" \
&& { msg='Should specify either prohibit or require' \
$(_sc_say_and_exit) } || :; \
test -n "$$in_vc_files" && test -n "$$in_files" \
&& { msg='Cannot specify both in_vc_files and in_files' \
$(_sc_say_and_exit) } || :; \
test "x$$halt" != x \
|| { msg='halt not defined' $(_sc_say_and_exit) }; \
\
: Filter by file name; \
if test -n "$$in_files"; then \
files=$$(find $(srcdir) | grep -E "$$in_files" \
| grep -Ev '$(exclude_file_name_regexp--$@)'); \
else \
files=$$($(VC_LIST_EXCEPT)); \
if test -n "$$in_vc_files"; then \
files=$$(echo "$$files" | grep -E "$$in_vc_files"); \
fi; \
fi; \
\
: Filter by content; \
test -n "$$files" && test -n "$$containing" \
&& { files=$$(grep -l "$$containing" $$files); } || :; \
test -n "$$files" && test -n "$$non_containing" \
&& { files=$$(grep -vl "$$non_containing" $$files); } || :; \
\
: Check for the construct; \
if test -n "$$files"; then \
if test -n "$$prohibit"; then \
grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
&& { msg="$$halt" $(_sc_say_and_exit) } || :; \
else \
grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
| grep . \
&& { msg="$$halt" $(_sc_say_and_exit) } || :; \
fi \
else :; \
fi || :;
endef
sc_avoid_if_before_free:
@$(srcdir)/$(_build-aux)/useless-if-before-free \
$(useless_free_options) \
$$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \
{ echo '$(ME): found useless "if" before "free" above' 1>&2; \
exit 1; } || :
sc_cast_of_argument_to_free:
@prohibit='\<free *\( *\(' halt='don'\''t cast free argument' \
$(_sc_search_regexp)
sc_cast_of_x_alloc_return_value:
@prohibit='\*\) *x(m|c|re)alloc\>' \
halt='don'\''t cast x*alloc return value' \
$(_sc_search_regexp)
# Use STREQ rather than comparing strcmp == 0, or != 0.
sc_prohibit_strcmp:
@grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]=' \
$$($(VC_LIST_EXCEPT)) \
| grep -vE ':# *define STRN?EQ\(' && \
{ echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
1>&2; exit 1; } || :
# Pass EXIT_*, not number, to usage, exit, and error (when exiting)
# Convert all uses automatically, via these two commands:
# git grep -l '\<exit *(1)' \
# | grep -vEf .x-sc_prohibit_magic_number_exit \
# | xargs --no-run-if-empty \
# perl -pi -e 's/(^|[^.])\b(exit ?)\(1\)/$1$2(EXIT_FAILURE)/'
# git grep -l '\<exit *(0)' \
# | grep -vEf .x-sc_prohibit_magic_number_exit \
# | xargs --no-run-if-empty \
# perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
sc_prohibit_magic_number_exit:
@prohibit='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,' \
halt='use EXIT_* values rather than magic number' \
$(_sc_search_regexp)
# `FATAL:' should be fully upper-cased in error messages
# `WARNING:' should be fully upper-cased, or fully lower-cased
sc_error_message_warn_fatal:
@grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
| grep -E '"Warning|"Fatal|"fatal' && \
{ echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
exit 1; } || :
# Error messages should not end with a period
sc_error_message_period:
@grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT)) \
| grep -E '[^."]\."' && \
{ echo '$(ME): found error message ending in period' 1>&2; \
exit 1; } || :
# Don't use cpp tests of this symbol. All code assumes config.h is included.
sc_prohibit_have_config_h:
@prohibit='^# *if.*HAVE''_CONFIG_H' \
halt='found use of HAVE''_CONFIG_H; remove' \
$(_sc_search_regexp)
# Nearly all .c files must include <config.h>. However, we also permit this
# via inclusion of a package-specific header, if syntax-check.mk specified one.
# config_h_header must be suitable for grep -E.
config_h_header ?= <config\.h>
sc_require_config_h:
@require='^# *include $(config_h_header)' \
in_vc_files='\.c$$' \
halt='the above files do not include <config.h>' \
$(_sc_search_regexp)
# You must include <config.h> before including any other header file.
# This can possibly be via a package-specific header, if given by syntax-check.mk.
sc_require_config_h_first:
@if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
fail=0; \
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
grep '^# *include\>' $$i | sed 1q \
| grep -E '^# *include $(config_h_header)' > /dev/null \
|| { echo $$i; fail=1; }; \
done; \
test $$fail = 1 && \
{ echo '$(ME): the above files include some other header' \
'before <config.h>' 1>&2; exit 1; } || :; \
else :; \
fi
sc_prohibit_HAVE_MBRTOWC:
@prohibit='\bHAVE_MBRTOWC\b' \
halt="do not use $$prohibit; it is always defined" \
$(_sc_search_regexp)
# To use this "command" macro, you must first define two shell variables:
# h: the header name, with no enclosing <> or ""
# re: a regular expression that matches IFF something provided by $h is used.
define _sc_header_without_use
dummy=; : so we do not need a semicolon before each use; \
h_esc=`echo '[<"]'"$$h"'[">]'|sed 's/\./\\\\./g'`; \
if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
files=$$(grep -l '^# *include '"$$h_esc" \
$$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
grep -LE "$$re" $$files | grep . && \
{ echo "$(ME): the above files include $$h but don't use it" \
1>&2; exit 1; } || :; \
else :; \
fi
endef
# Prohibit the inclusion of assert.h without an actual use of assert.
sc_prohibit_assert_without_use:
@h='assert.h' re='\<assert *\(' $(_sc_header_without_use)
# Prohibit the inclusion of close-stream.h without an actual use.
sc_prohibit_close_stream_without_use:
@h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
# Prohibit the inclusion of getopt.h without an actual use.
sc_prohibit_getopt_without_use:
@h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_long_options_without_use:
@h='long-options.h' re='\<parse_long_options *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_inttostr_without_use:
@h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_ignore_value_without_use:
@h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_error_without_use:
@h='error.h' \
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
$(_sc_header_without_use)
# Don't include xalloc.h unless you use one of its functions.
# Consider these symbols:
# perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__';
# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h
# Divide into two sets on case, and filter each through this:
# | sort | perl -MRegexp::Assemble -le \
# 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g'
# Note this was produced by the above:
# _xa1 = \
#x(((2n?)?re|c(har)?|n(re|m)|z)alloc|alloc_(oversized|die)|m(alloc|emdup)|strdup)
# But we can do better, in at least two ways:
# 1) take advantage of two "dup"-suffixed strings:
# x(((2n?)?re|c(har)?|n(re|m)|[mz])alloc|alloc_(oversized|die)|(mem|str)dup)
# 2) notice that "c(har)?|[mz]" is equivalent to the shorter and more readable
# "char|[cmz]"
# x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
_xa2 = X([CZ]|N?M)ALLOC
sc_prohibit_xalloc_without_use:
@h='xalloc.h' \
re='\<($(_xa1)|$(_xa2)) *\('\
$(_sc_header_without_use)
sc_prohibit_cloexec_without_use:
@h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \
$(_sc_header_without_use)
sc_prohibit_posixver_without_use:
@h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
sc_prohibit_same_without_use:
@h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
sc_prohibit_hash_pjw_without_use:
@h='hash-pjw.h' \
re='\<hash_pjw *\(' \
$(_sc_header_without_use)
sc_prohibit_safe_read_without_use:
@h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
$(_sc_header_without_use)
sc_prohibit_argmatch_without_use:
@h='argmatch.h' \
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
$(_sc_header_without_use)
sc_prohibit_canonicalize_without_use:
@h='canonicalize.h' \
re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
$(_sc_header_without_use)
sc_prohibit_root_dev_ino_without_use:
@h='root-dev-ino.h' \
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
$(_sc_header_without_use)
sc_prohibit_openat_without_use:
@h='openat.h' \
re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>' \
$(_sc_header_without_use)
# Prohibit the inclusion of c-ctype.h without an actual use.
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
sc_prohibit_c_ctype_without_use:
@h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
$(_sc_header_without_use)
_empty =
_sp = $(_empty) $(_empty)
# The following list was generated by running:
# man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \
# | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt
_sig_functions = \
bsd_signal kill killpg pthread_kill pthread_sigmask raise sigaction \
sigaddset sigaltstack sigdelset sigemptyset sigfillset sighold sigignore \
siginterrupt sigismember signal sigpause sigpending sigprocmask sigqueue \
sigrelse sigset sigsuspend sigtimedwait sigwait sigwaitinfo
_sig_function_re = $(subst $(_sp),|,$(strip $(_sig_functions)))
# The following were extracted from "man signal.h" manually.
_sig_types_and_consts = \
MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \
SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \
SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \
SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \
sigstack sigval stack_t ucontext_t
# generated via this:
# perl -lne '/^#ifdef (SIG\w+)/ and print $1' lib/sig2str.c|sort -u|fmt -70
_sig_names = \
SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \
SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \
SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \
SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \
SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \
SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \
SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \
SIGXCPU SIGXFSZ
_sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts)))
# Prohibit the inclusion of signal.h without an actual use.
sc_prohibit_signal_without_use:
@h='signal.h' \
re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \
$(_sc_header_without_use)
# Don't include stdio--.h unless you use one of its functions.
sc_prohibit_stdio--_without_use:
@h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\(' \
$(_sc_header_without_use)
# Don't include stdio-safer.h unless you use one of its functions.
sc_prohibit_stdio-safer_without_use:
@h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\(' \
$(_sc_header_without_use)
# Prohibit the inclusion of strings.h without a sensible use.
# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
sc_prohibit_strings_without_use:
@h='strings.h' \
re='\<(strn?casecmp|ffs(ll)?)\>' \
$(_sc_header_without_use)
# Get the list of symbol names with this:
# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
_intprops_names = \
TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT \
TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \
INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \
INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \
INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \
INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \
INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \
INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
# Prohibit the inclusion of intprops.h without an actual use.
sc_prohibit_intprops_without_use:
@h='intprops.h' \
re='\<($(_intprops_syms_re)) *\(' \
$(_sc_header_without_use)
_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
# Prohibit the inclusion of stddef.h without an actual use.
sc_prohibit_stddef_without_use:
@h='stddef.h' \
re='\<($(_stddef_syms_re))\>' \
$(_sc_header_without_use)
_de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)?
_de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)?
_de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen
_dirent_syms_re = $(_de1)|$(_de2)|$(_de3)
# Prohibit the inclusion of dirent.h without an actual use.
sc_prohibit_dirent_without_use:
@h='dirent.h' \
re='\<($(_dirent_syms_re))\>' \
$(_sc_header_without_use)
# Prohibit the inclusion of verify.h without an actual use.
sc_prohibit_verify_without_use:
@h='verify.h' \
re='\<(verify(true|expr)?|static_assert) *\(' \
$(_sc_header_without_use)
# Don't include xfreopen.h unless you use one of its functions.
sc_prohibit_xfreopen_without_use:
@h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
sc_trailing_blank:
@prohibit='[ ]$$' \
halt='found trailing blank(s)' \
$(_sc_search_regexp)
# A regexp matching function names like "error" that may be used
# to emit translatable messages.
_gl_translatable_diag_func_re ?= error
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics:
@grep -nE \
'\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \
$$($(VC_LIST_EXCEPT)) \
| grep -Ev '(_|ngettext ?)\(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
# Prohibit checked in backup files.
sc_prohibit_backup_files:
@$(VC_LIST) | grep '~$$' && \
{ echo '$(ME): found version controlled backup file' 1>&2; \
exit 1; } || :
# Require the latest GFDL. Two regexp, since some .texi files end up
# line wrapping between 'Free Documentation License,' and 'Version'.
_GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any)
sc_GFDL_version:
@prohibit='$(_GFDL_regexp)' \
halt='GFDL vN, N!=3' \
$(_sc_search_regexp)
# This Perl code is slightly obfuscated. Not only is each "$" doubled
# because it's in a Makefile, but the $$c's are comments; we cannot
# use "#" due to the way the script ends up concatenated onto one line.
# It would be much more concise, and would produce better output (including
# counts) if written as:
# perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ...
# but that would be far less efficient, reading the entire contents
# of each file, rather than just the last two bytes of each.
# In addition, while the code below detects both blank lines and a missing
# newline at EOF, the above detects only the former.
#
# This is a perl script that is expected to be the single-quoted argument
# to a command-line "-le". The remaining arguments are file names.
# Print the name of each file that ends in exactly one newline byte.
# I.e., warn if there are blank lines (2 or more newlines), or if the
# last byte is not a newline. However, currently we don't complain
# about any file that contains exactly one byte.
# Exit nonzero if at least one such file is found, otherwise, exit 0.
# Warn about, but otherwise ignore open failure. Ignore seek/read failure.
#
# Use this if you want to remove trailing empty lines from selected files:
# perl -pi -0777 -e 's/\n\n+$/\n/' files...
#
require_exactly_one_NL_at_EOF_ = \
foreach my $$f (@ARGV) \
{ \
open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \
my $$p = sysseek (F, -2, 2); \
my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
my $$last_two_bytes; \
defined $$p and $$p = sysread F, $$last_two_bytes, 2; \
close F; \
$$c = "ignore read failure"; \
$$p && ($$last_two_bytes eq "\n\n" \
|| substr ($$last_two_bytes,1) ne "\n") \
and (print $$f), $$fail=1; \
} \
END { exit defined $$fail }
sc_prohibit_empty_lines_at_EOF:
@perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
|| { echo '$(ME): empty line(s) or no newline at EOF' \
1>&2; exit 1; } || :
# Perl block to convert a match to FILE_NAME:LINENO:TEST,
# that is shared by two definitions below.
perl_filename_lineno_text_ = \
-e ' {' \
-e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \
-e ' ($$v = $$&) =~ s/\n/\\n/g;' \
-e ' print "$$ARGV:$$n:$$v\n";' \
-e ' }'
prohibit_doubled_word_RE_ ?= \
/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims
prohibit_doubled_word_ = \
-e 'while ($(prohibit_doubled_word_RE_))' \
$(perl_filename_lineno_text_)
# Define this to a regular expression that matches
# any filename:dd:match lines you want to ignore.
# The default is to ignore no matches.
ignore_doubled_word_match_RE_ ?= ^$$
sc_prohibit_doubled_word:
@perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \
| grep -vE '$(ignore_doubled_word_match_RE_)' \
| grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
# A regular expression matching undesirable combinations of words like
# "can not"; this matches them even when the two words appear on different
# lines, but not when there is an intervening delimiter like "#" or "*".
prohibit_undesirable_word_seq_RE_ ?= \
/\bcan\s+not\b/gims
prohibit_undesirable_word_seq_ = \
-e 'while ($(prohibit_undesirable_word_seq_RE_))' \
$(perl_filename_lineno_text_)
# Define this to a regular expression that matches
# any filename:dd:match lines you want to ignore.
# The default is to ignore no matches.
ignore_undesirable_word_sequence_RE_ ?= ^$$
sc_prohibit_undesirable_word_seq:
@perl -n -0777 $(prohibit_undesirable_word_seq_) \
$$($(VC_LIST_EXCEPT)) \
| grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
&& { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
_ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
_ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
# Using test's -a and -o operators is not portable.
# We prefer test over [, since the latter is spelled [[ in configure.ac.
sc_prohibit_test_minus_ao:
@prohibit='(\<test| \[+) .+ -[ao] ' \
halt='$(_ptm1); $(_ptm2)' \
$(_sc_search_regexp)
# Avoid a test bashism.
sc_prohibit_test_double_equal:
@prohibit='(\<test| \[+) .+ == ' \
containing='#! */bin/[a-z]*sh' \
halt='use "test x = x", not "test x =''= x"' \
$(_sc_search_regexp)
# Each program that uses proper_name_utf8 must link with one of the
# ICONV libraries. Otherwise, some ICONV library must appear in LDADD.
# The perl -0777 invocation below extracts the possibly-multi-line
# definition of LDADD from the appropriate Makefile.am and exits 0
# when it contains "ICONV".
sc_proper_name_utf8_requires_ICONV:
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
if test "x$$progs" != x; then \
fail=0; \
for p in $$progs; do \
dir=$$(dirname "$$p"); \
perl -0777 \
-ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \
$$dir/Makefile.am && continue; \
base=$$(basename "$$p" .c); \
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
done; \
test $$fail = 1 && \
{ echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
exit 1; } || :; \
fi
# Warn about "c0nst struct Foo const foo[]",
# but not about "char const *const foo" or "#define const const".
sc_redundant_const:
@prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
halt='redundant "const" in declarations' \
$(_sc_search_regexp)
sc_const_long_option:
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
| grep -Ev 'const struct option|struct option const' && { \
echo 1>&2 '$(ME): add "const" to the above declarations'; \
exit 1; } || :
# Ensure that we use only the standard $(VAR) notation,
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
# However, there is still one case in which @VAR@ use is not just
# legitimate, but actually required: when augmenting an automake-defined
# variable with a prefix. For example, gettext uses this:
# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
# otherwise, makeinfo would put German or French (current locale)
# navigation hints in the otherwise-English documentation.
#
# Allow the package to add exceptions via a hook in syntax-check.mk;
# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
_makefile_at_at_check_exceptions ?=
sc_makefile_at_at_check:
@perl -ne '/\@[A-Z_0-9]+\@/' \
-e ' && !/([A-Z_0-9]+)\s+=.*\@\1\@$$/' \
-e ''$(_makefile_at_at_check_exceptions) \
-e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
$$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
sc_makefile_TAB_only_indentation:
@prohibit='^ [ ]{8}' \
in_vc_files='akefile|\.mk$$' \
halt='found TAB-8-space indentation' \
$(_sc_search_regexp)
sc_m4_quote_check:
@prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
in_vc_files='(^configure\.ac|\.m4)$$' \
halt='quote the first arg to AC_DEF*' \
$(_sc_search_regexp)
fix_po_file_diag = \
'you have changed the set of files with translatable diagnostics;\n\
apply the above patch\n'
# Verify that all source files using _() are listed in po/POTFILES.in.
po_file ?= $(srcdir)/po/POTFILES.in
generated_files ?= $(srcdir)/lib/*.[ch]
sc_po_check:
@if test -f $(po_file); then \
grep -E -v '^(#|$$)' $(po_file) \
| grep -v '^src/false\.c$$' \
| sed 's|\[type: gettext/glade\] ||' \
| sort > $@-1; \
files=; \
for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do \
test -r $$file || continue; \
case $$file in \
*.m4|*.mk) continue ;; \
*.?|*.??) ;; \
*.xml) ;; \
*.xml.in) ;; \
*.desktop.in) ;; \
*) continue;; \
esac; \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '(\b(N?_|gettext *)\([^)"]*("|$$))|(<interface>)|^_|<_' $$files \
| sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \
diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
|| { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
rm -f $@-1 $@-2; \
fi
# #if HAVE_... will evaluate to false for any non numeric string.
# That would be flagged by using -Wundef, however gnulib currently
# tests many undefined macros, and so we can't enable that option.
# So at least preclude common boolean strings as macro values.
sc_Wundef_boolean:
@prohibit='^#define.*(yes|no|true|false)$$' \
in_files='$(CONFIG_INCLUDE)' \
halt='Use 0 or 1 for macro values' \
$(_sc_search_regexp)
# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
# not be constant, or might overflow a stack. In general, use PATH_MAX as
# a limit, not an array or alloca size.
sc_prohibit_path_max_allocation:
@prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX' \
halt='Avoid stack allocations of size PATH_MAX' \
$(_sc_search_regexp)
sc_vulnerable_makefile_CVE-2009-4029:
@prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
in_files=$$(find $(srcdir) -name Makefile.in) \
halt=$$(printf '%s\n' \
'the above files are vulnerable; beware of running' \
' "make dist*" rules, and upgrade to fixed automake' \
' see http://bugzilla.redhat.com/542609 for details') \
$(_sc_search_regexp)
# Files that should never cause syntax check failures.
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
(^HACKING|\.po|build-aux/syntax-check.mk)$$
# Functions like free() that are no-ops on NULL arguments.
useless_free_options = \
--name=g_free \
--name=xmlBufferFree \
--name=xmlFree \
--name=xmlFreeDoc \
--name=xmlXPathFreeContext \
--name=xmlFreeParserContext \
--name=xmlXPathFreeObject
# Ensure that no C source file, docs, or rng schema uses TABs for
# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
# files in gnulib, since they're imported.
space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
sc_TAB_in_indentation:
@prohibit='^ * ' \
in_vc_files='$(space_indent_files)$$' \
halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
$(_sc_search_regexp)
# G_GNUC_UNUSED should only be applied in implementations, not
# header declarations
sc_avoid_attribute_unused_in_header:
@prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
in_vc_files='\.h$$' \
halt='use G_GNUC_UNUSED in .c rather than .h files' \
$(_sc_search_regexp)
# Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation:
@if cppi --version >/dev/null 2>&1; then \
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
else \
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
sc_copyright_format:
@require='Copyright .*Red 'Hat', Inc\.' \
containing='Copyright .*Red 'Hat \
halt='Red Hat copyright is missing Inc.' \
$(_sc_search_regexp)
@prohibit='Copyright [^(].*Red 'Hat \
halt='consistently use (C) in Red Hat copyright' \
$(_sc_search_regexp)
@prohibit='\<Red''Hat\>' \
halt='spell Red Hat as two words' \
$(_sc_search_regexp)
exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch]
exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
exclude_file_name_regexp--sc_require_config_h = ^src/gbinding\.c|src/windows-cmdline-wrapper.c
exclude_file_name_regexp--sc_require_config_h_first = ^src/gbinding\.c|src/windows-cmdline-wrapper.c
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^icons/
exclude_file_name_regexp--sc_trailing_blank = ^icons/
exclude_file_name_regexp--sc_prohibit_magic_number_exit = src/windows-cmdline-wrapper.c
exclude_file_name_regexp--sc_makefile_at_at_check = data/Makefile.am

207
build-aux/useless-if-before-free Executable file
View File

@ -0,0 +1,207 @@
eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
& eval 'exec perl -wST "$0" $argv:q'
if 0;
# Detect instances of "if (p) free (p);".
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
my $VERSION = '2011-04-20 13:43'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Written by Jim Meyering
use strict;
use warnings;
use Getopt::Long;
(my $ME = $0) =~ s|.*/||;
# use File::Coda; # http://meyering.net/code/Coda/
END {
defined fileno STDOUT or return;
close STDOUT and return;
warn "$ME: failed to close standard output: $!\n";
$? ||= 1;
}
sub usage ($)
{
my ($exit_code) = @_;
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0)
{
print $STREAM "Try `$ME --help' for more information.\n";
}
else
{
print $STREAM <<EOF;
Usage: $ME [OPTIONS] FILE...
Detect any instance in FILE of a useless "if" test before a free call, e.g.,
"if (p) free (p);". Any such test may be safely removed without affecting
the semantics of the C code in FILE. Use --name=FOO --name=BAR to also
detect free-like functions named FOO and BAR.
OPTIONS:
--list print only the name of each matching FILE (\\0-terminated)
--name=N add name N to the list of \`free\'-like functions to detect;
may be repeated
--help display this help and exit
--version output version information and exit
Exit status:
0 one or more matches
1 no match
2 an error
EXAMPLE:
For example, this command prints all removable "if" tests before "free"
and "kfree" calls in the linux kernel sources:
git ls-files -z |xargs -0 $ME --name=kfree
EOF
}
exit $exit_code;
}
sub is_NULL ($)
{
my ($expr) = @_;
return ($expr eq 'NULL' || $expr eq '0');
}
{
sub EXIT_MATCH {0}
sub EXIT_NO_MATCH {1}
sub EXIT_ERROR {2}
my $err = EXIT_NO_MATCH;
my $list;
my @name = qw(free);
GetOptions
(
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
list => \$list,
'name=s@' => \@name,
) or usage 1;
# Make sure we have the right number of non-option arguments.
# Always tell the user why we fail.
@ARGV < 1
and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
my $or = join '|', @name;
my $regexp = qr/(?:$or)/;
# Set the input record separator.
# Note: this makes it impractical to print line numbers.
$/ = '"';
my $found_match = 0;
FILE:
foreach my $file (@ARGV)
{
open FH, '<', $file
or (warn "$ME: can't open `$file' for reading: $!\n"),
$err = EXIT_ERROR, next;
while (defined (my $line = <FH>))
{
while ($line =~
/\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
# 1 2 3
(?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;|
\s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
{
my $all = $1;
my ($lhs, $rhs) = ($2, $3);
my ($free_opnd, $braced_free_opnd) = ($4, $5);
my $non_NULL;
if (!defined $rhs) { $non_NULL = $lhs }
elsif (is_NULL $rhs) { $non_NULL = $lhs }
elsif (is_NULL $lhs) { $non_NULL = $rhs }
else { next }
# Compare the non-NULL part of the "if" expression and the
# free'd expression, without regard to white space.
$non_NULL =~ tr/ \t//d;
my $e2 = defined $free_opnd ? $free_opnd : $braced_free_opnd;
$e2 =~ tr/ \t//d;
if ($non_NULL eq $e2)
{
$found_match = 1;
$list
and (print "$file\0"), next FILE;
print "$file: $all\n";
}
}
}
}
continue
{
close FH;
}
$found_match && $err == EXIT_NO_MATCH
and $err = EXIT_MATCH;
exit $err;
}
my $foo = <<'EOF';
# The above is to *find* them.
# This adjusts them, removing the unnecessary "if (p)" part.
# FIXME: do something like this as an option (doesn't do braces):
free=xfree
git grep -l -z "$free *(" \
| xargs -0 useless-if-before-free -l --name="$free" \
| xargs -0 perl -0x3b -pi -e \
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
# Use the following to remove redundant uses of kfree inside braces.
# Note that -0777 puts perl in slurp-whole-file mode;
# but we have plenty of memory, these days...
free=kfree
git grep -l -z "$free *(" \
| xargs -0 useless-if-before-free -l --name="$free" \
| xargs -0 perl -0777 -pi -e \
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms'
Be careful that the result of the above transformation is valid.
If the matched string is followed by "else", then obviously, it won't be.
When modifying files, refuse to process anything other than a regular file.
EOF
## Local Variables:
## mode: perl
## indent-tabs-mode: nil
## eval: (add-hook 'write-file-hooks 'time-stamp)
## time-stamp-start: "my $VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC"
## time-stamp-end: "'; # UTC"
## End:

105
build-aux/vc-list-files Executable file
View File

@ -0,0 +1,105 @@
#!/bin/sh
# List version-controlled file names.
# Print a version string.
scriptversion=2021-02-10.15; # UTC
# Copyright (C) 2006-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# List the specified version-controlled files.
# With no argument, list them all. With a single DIRECTORY argument,
# list the version-controlled files in that directory.
# If there's an argument, it must be a single, "."-relative directory name.
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
postprocess=
case $1 in
--help) cat <<EOF
Usage: $0 [-C SRCDIR] [DIR...]
Output a list of version-controlled files in DIR (default .), relative to
SRCDIR (default .). SRCDIR must be the top directory of a checkout.
Options:
--help print this help, then exit
--version print version number, then exit
-C SRCDIR change directory to SRCDIR before generating list
Report bugs and patches to <bug-gnulib@gnu.org>.
EOF
exit ;;
--version)
year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
cat <<EOF
vc-list-files $scriptversion
Copyright (C) $year Free Software Foundation, Inc,
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
exit ;;
-C)
test "$2" = . || postprocess="| sed 's|^|$2/|'"
cd "$2" || exit 1
shift; shift ;;
esac
test $# = 0 && set .
for dir
do
if test -d .git; then
test "x$dir" = x. \
&& dir= sed_esc= \
|| { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
# Ignore git symlinks - either they point into the tree, in which case
# we don't need to visit the target twice, or they point somewhere
# else (often into a submodule), in which case the content does not
# belong to this package.
eval exec git ls-tree -r 'HEAD:"$dir"' \
\| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess
elif test -d .hg; then
eval exec hg locate '"$dir/*"' $postprocess
elif test -d .bzr; then
test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
eval exec bzr ls -R --versioned '"$dir"' $postprocess
elif test -d CVS; then
test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
if test -x build-aux/cvsu; then
eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
elif (cvsu --help) >/dev/null 2>&1; then
eval cvsu --find --types=AFGM '"$dir"' $postprocess
else
eval awk -F/ \''{ \
if (!$1 && $3 !~ /^-/) { \
f=FILENAME; \
if (f ~ /CVS\/Entries$/) \
f = substr(f, 1, length(f)-11); \
print f $2; \
}}'\'' \
`find "$dir" -name Entries -print` /dev/null' $postprocess
fi
elif test -d .svn; then
eval exec svn list -R '"$dir"' $postprocess
else
echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
exit 1
fi
done

View File

@ -0,0 +1,61 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled -y crb
dnf install -y epel-release
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cpp \
cyrus-sasl-devel \
gcc \
gdk-pixbuf2-devel \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
gobject-introspection-devel \
gtk-doc \
gtk3-devel \
icoutils \
libgcrypt-devel \
libnl3-devel \
libtirpc-devel \
libtool \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
perl-base \
pkgconfig \
pulseaudio-libs-devel \
python3 \
python3-docutils \
rpm-build \
vala \
vte291-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
}

45
ci/buildenv/alpine-319.sh Normal file
View File

@ -0,0 +1,45 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
apk update
apk upgrade
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev
apk list --installed | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

45
ci/buildenv/alpine-320.sh Normal file
View File

@ -0,0 +1,45 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
apk update
apk upgrade
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev
apk list --installed | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,45 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
apk update
apk upgrade
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev
apk list --installed | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,62 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf distro-sync -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled -y crb
dnf install -y epel-release
dnf install -y epel-next-release
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cpp \
cyrus-sasl-devel \
gcc \
gdk-pixbuf2-devel \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
gobject-introspection-devel \
gtk-doc \
gtk3-devel \
icoutils \
libgcrypt-devel \
libnl3-devel \
libtirpc-devel \
libtool \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
perl-base \
pkgconfig \
pulseaudio-libs-devel \
python3 \
python3-docutils \
rpm-build \
vala \
vte291-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
}

51
ci/buildenv/debian-11.sh Normal file
View File

@ -0,0 +1,51 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

51
ci/buildenv/debian-12.sh Normal file
View File

@ -0,0 +1,51 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

51
ci/buildenv/debian-sid.sh Normal file
View File

@ -0,0 +1,51 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

48
ci/buildenv/fedora-39.sh Normal file
View File

@ -0,0 +1,48 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

48
ci/buildenv/fedora-40.sh Normal file
View File

@ -0,0 +1,48 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,53 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y --nogpgcheck fedora-gpg-keys
dnf distro-sync -y
dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
git \
glibc-langpack-en \
gtk-vnc2-devel \
icoutils \
libtool \
libxml2 \
make \
meson \
ninja-build \
rpm-build
dnf install -y \
mingw32-gcc \
mingw32-gettext \
mingw32-glib2 \
mingw32-gstreamer1-plugins-bad-free \
mingw32-gstreamer1-plugins-good \
mingw32-gtk3 \
mingw32-headers \
mingw32-libgovirt \
mingw32-libvirt \
mingw32-libxml2 \
mingw32-pkg-config \
mingw32-rest \
mingw32-spice-gtk3
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export ABI="i686-w64-mingw32"
export MESON_OPTS="--cross-file=/usr/share/mingw/toolchain-mingw32.meson"
}

View File

@ -0,0 +1,53 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y --nogpgcheck fedora-gpg-keys
dnf distro-sync -y
dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
git \
glibc-langpack-en \
gtk-vnc2-devel \
icoutils \
libtool \
libxml2 \
make \
meson \
ninja-build \
rpm-build
dnf install -y \
mingw64-gcc \
mingw64-gettext \
mingw64-glib2 \
mingw64-gstreamer1-plugins-bad-free \
mingw64-gstreamer1-plugins-good \
mingw64-gtk3 \
mingw64-headers \
mingw64-libgovirt \
mingw64-libvirt \
mingw64-libxml2 \
mingw64-pkg-config \
mingw64-rest \
mingw64-spice-gtk3
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export ABI="x86_64-w64-mingw32"
export MESON_OPTS="--cross-file=/usr/share/mingw/toolchain-mingw64.meson"
}

View File

@ -0,0 +1,49 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y --nogpgcheck fedora-gpg-keys
dnf distro-sync -y
dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,49 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
zypper update -y
zypper addrepo -fc https://download.opensuse.org/update/leap/15.6/backports/openSUSE:Backports:SLE-15-SP6:Update.repo
zypper install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext-runtime \
git \
glib2-devel \
glibc-devel \
glibc-locale \
gtk-vnc-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
librest-devel \
libtool \
libvirt-devel \
libvirt-glib-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja \
pkgconfig \
rpm-build \
spice-gtk-devel \
vte-devel
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,48 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
zypper dist-upgrade -y
zypper install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext-runtime \
git \
glib2-devel \
glibc-devel \
glibc-locale \
gtk-vnc-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
librest-devel \
libtool \
libvirt-devel \
libvirt-glib-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja \
pkgconfig \
rpm-build \
spice-gtk-devel \
vte-devel
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,50 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,50 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
function export_buildenv() {
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
}

View File

@ -0,0 +1,61 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/almalinux:9
RUN dnf update -y && \
dnf install 'dnf-command(config-manager)' -y && \
dnf config-manager --set-enabled -y crb && \
dnf install -y epel-release && \
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cpp \
cyrus-sasl-devel \
gcc \
gdk-pixbuf2-devel \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
gobject-introspection-devel \
gtk-doc \
gtk3-devel \
icoutils \
libgcrypt-devel \
libnl3-devel \
libtirpc-devel \
libtool \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
perl-base \
pkgconfig \
pulseaudio-libs-devel \
python3 \
python3-docutils \
rpm-build \
vala \
vte291-devel && \
dnf autoremove -y && \
dnf clean all -y && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"

View File

@ -0,0 +1,43 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/alpine:3.19
RUN apk update && \
apk upgrade && \
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev && \
apk list --installed | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,43 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/alpine:3.20
RUN apk update && \
apk upgrade && \
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev && \
apk list --installed | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,43 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/alpine:edge
RUN apk update && \
apk upgrade && \
apk add \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
glib-dev \
gtk+3.0-dev \
gtk-vnc-dev \
icoutils \
libtool \
libvirt-dev \
libvirt-glib-dev \
libxml2-dev \
libxml2-utils \
make \
meson \
musl-dev \
pkgconf \
rest-dev \
samurai \
spice-gtk-dev \
vte3-dev && \
apk list --installed | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,62 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM quay.io/centos/centos:stream9
RUN dnf distro-sync -y && \
dnf install 'dnf-command(config-manager)' -y && \
dnf config-manager --set-enabled -y crb && \
dnf install -y epel-release && \
dnf install -y epel-next-release && \
dnf install -y \
bash-completion \
ca-certificates \
ccache \
cpp \
cyrus-sasl-devel \
gcc \
gdk-pixbuf2-devel \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
gobject-introspection-devel \
gtk-doc \
gtk3-devel \
icoutils \
libgcrypt-devel \
libnl3-devel \
libtirpc-devel \
libtool \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
perl-base \
pkgconfig \
pulseaudio-libs-devel \
python3 \
python3-docutils \
rpm-build \
vala \
vte291-devel && \
dnf autoremove -y && \
dnf clean all -y && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"

View File

@ -0,0 +1,52 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,52 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:12-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,52 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgovirt-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,58 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:39
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"\n' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
bash-completion \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel && \
nosync dnf autoremove -y && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,58 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:40
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"\n' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
bash-completion \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel && \
nosync dnf autoremove -y && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,65 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
dnf install -y nosync && \
printf '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"\n' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf distro-sync -y && \
nosync dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
git \
glibc-langpack-en \
gtk-vnc2-devel \
icoutils \
libtool \
libxml2 \
make \
meson \
ninja-build \
rpm-build && \
nosync dnf autoremove -y && \
nosync dnf clean all -y
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
RUN nosync dnf install -y \
mingw32-gcc \
mingw32-gettext \
mingw32-glib2 \
mingw32-gstreamer1-plugins-bad-free \
mingw32-gstreamer1-plugins-good \
mingw32-gtk3 \
mingw32-headers \
mingw32-libgovirt \
mingw32-libvirt \
mingw32-libxml2 \
mingw32-pkg-config \
mingw32-rest \
mingw32-spice-gtk3 && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-gcc
ENV ABI "i686-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw32.meson"

View File

@ -0,0 +1,65 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
dnf install -y nosync && \
printf '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"\n' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf distro-sync -y && \
nosync dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
git \
glibc-langpack-en \
gtk-vnc2-devel \
icoutils \
libtool \
libxml2 \
make \
meson \
ninja-build \
rpm-build && \
nosync dnf autoremove -y && \
nosync dnf clean all -y
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
RUN nosync dnf install -y \
mingw64-gcc \
mingw64-gettext \
mingw64-glib2 \
mingw64-gstreamer1-plugins-bad-free \
mingw64-gstreamer1-plugins-good \
mingw64-gtk3 \
mingw64-headers \
mingw64-libgovirt \
mingw64-libvirt \
mingw64-libxml2 \
mingw64-pkg-config \
mingw64-rest \
mingw64-spice-gtk3 && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-gcc
ENV ABI "x86_64-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw64.meson"

View File

@ -0,0 +1,59 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
dnf install -y nosync && \
printf '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"\n' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf distro-sync -y && \
nosync dnf install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gtk-vnc2-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
libtool \
libvirt-devel \
libvirt-gobject-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja-build \
pkgconfig \
rest-devel \
rpm-build \
spice-gtk3-devel \
vte291-devel && \
nosync dnf autoremove -y && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,48 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.opensuse.org/opensuse/leap:15.6
RUN zypper update -y && \
zypper addrepo -fc https://download.opensuse.org/update/leap/15.6/backports/openSUSE:Backports:SLE-15-SP6:Update.repo && \
zypper install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext-runtime \
git \
glib2-devel \
glibc-devel \
glibc-locale \
gtk-vnc-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
librest-devel \
libtool \
libvirt-devel \
libvirt-glib-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja \
pkgconfig \
rpm-build \
spice-gtk-devel \
vte-devel && \
zypper clean --all && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,47 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.opensuse.org/opensuse/tumbleweed:latest
RUN zypper dist-upgrade -y && \
zypper install -y \
bash-completion-devel \
ca-certificates \
ccache \
cppi \
gcc \
gettext-runtime \
git \
glib2-devel \
glibc-devel \
glibc-locale \
gtk-vnc-devel \
gtk3-devel \
icoutils \
libgovirt-devel \
librest-devel \
libtool \
libvirt-devel \
libvirt-glib-devel \
libxml2 \
libxml2-devel \
make \
meson \
ninja \
pkgconfig \
rpm-build \
spice-gtk-devel \
vte-devel && \
zypper clean --all && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,51 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/ubuntu:22.04
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

View File

@ -0,0 +1,51 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/ubuntu:24.04
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash-completion \
ca-certificates \
ccache \
gcc \
gettext \
git \
icoutils \
libc6-dev \
libglib2.0-dev \
libgtk-3-dev \
libgtk-vnc-2.0-dev \
librest-dev \
libspice-client-gtk-3.0-dev \
libtool \
libtool-bin \
libvirt-dev \
libvirt-glib-1.0-dev \
libvte-2.91-dev \
libxml2-dev \
libxml2-utils \
locales \
make \
meson \
ninja-build \
pkgconf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"

90
ci/gitlab.yml Normal file
View File

@ -0,0 +1,90 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# Variables that can be set to control the behaviour of
# pipelines that are run
#
# - RUN_PIPELINE - force creation of a CI pipeline when
# pushing to a branch in a forked repository. Official
# CI pipelines are triggered when merge requests are
# created/updated. Setting this variable to a non-empty
# value allows CI testing prior to opening a merge request.
#
# - RUN_PIPELINE_UPSTREAM_ENV - same semantics as RUN_PIPELINE,
# but uses the CI environment (containers) from the upstream project
# rather than creating and updating a throwaway environment
# Should not be used if the pushed branch includes CI container
# changes.
#
# - RUN_CONTAINER_BUILDS - CI pipelines in upstream only
# publish containers if CI file changes are detected.
# Setting this variable to a non-empty value will force
# re-publishing, even when no file changes are detected.
# Typically to use from a scheduled job once a month.
#
# - RUN_UPSTREAM_NAMESPACE - the upstream namespace is
# configured to default to 'virt-viewer'. When testing
# changes to CI it might be useful to use a different
# upstream. Setting this variable will override the
# namespace considered to be upstream.
#
# These can be set as git push options
#
# $ git push -o ci.variable=RUN_PIPELINE=1
#
# Aliases can be set for common usage
#
# $ git config --local alias.push-ci "push -o ci.variable=RUN_PIPELINE=1"
#
# Allowing the less verbose invocation
#
# $ git push-ci
#
# Pipeline variables can also be set in the repository
# pipeline config globally, or set against scheduled pipelines
variables:
RUN_UPSTREAM_NAMESPACE: virt-viewer
FF_SCRIPT_SECTIONS: 1
workflow:
rules:
# upstream+forks: Avoid duplicate pipelines on pushes, if a MR is open
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS'
when: never
# upstream+forks: Avoid pipelines on tag pushes
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG'
when: never
# upstream+forks: Allow pipelines in scenarios we've figured out job rules
- if: '$CI_PIPELINE_SOURCE =~ /^(push|merge_request_event|api|web|schedule)$/'
when: always
# upstream+forks: Avoid all other pipelines
- when: never
debug:
image: docker.io/library/alpine:3
stage: sanity_checks
interruptible: true
needs: []
script:
- printenv | sort
rules:
- if: '$RUN_DEBUG'
when: always
include:
- local: '/ci/gitlab/container-templates.yml'
- local: '/ci/gitlab/build-templates.yml'
- local: '/ci/gitlab/sanity-checks.yml'
- local: '/ci/gitlab/containers.yml'
- local: '/ci/gitlab/builds.yml'

View File

@ -0,0 +1,279 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
#
# We use pre-built containers for any pipelines that are:
#
# - Validating code committed on default upstream branch
# - Validating patches targeting default upstream branch
# which do not have CI changes
#
# We use a local build env for any pipelines that are:
#
# - Validating code committed to a non-default upstream branch
# - Validating patches targeting a non-default upstream branch
# - Validating patches targeting default upstream branch which
# include CI changes
# - Validating code committed to a fork branch
#
# Note: the rules across the prebuilt and local container scenarios
# should be logical inverses, such that jobs are mutually exclusive
#
.gitlab_native_build_job:
image: $IMAGE
stage: builds
interruptible: true
before_script:
- if test "$IMAGE" == "$TARGET_BASE_IMAGE" ;
then
source ci/buildenv/$NAME.sh ;
install_buildenv ;
export_buildenv ;
fi
- cat /packages.txt
variables:
IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/virt-viewer/ci-$NAME:latest
rules:
### PUSH events
# upstream: pushes to the default branch
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
# forks: pushes to a branch when a pipeline run in upstream env is explicitly requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV'
when: on_success
# forks: pushes to branches with pipeline requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### MERGE REQUEST events
# upstream+forks: merge requests targeting the default branch, with CI changes
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME.Dockerfile
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME.Dockerfile
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
# upstream+forks: merge requests targeting the default branch
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
when: on_success
# upstream+forks: merge requests targeting non-default branches
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### WEB / API / SCHEDULED events
# upstream: other web/api/scheduled pipelines targeting the default branch
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
when: on_success
# upstream: other web/api/scheduled pipelines targeting non-default branches
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
# forks: other web/api/scheduled pipelines on any branches
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### Catch all unhandled events
# upstream+forks: that's all folks
- when: never
#
# We use pre-built containers for any pipelines that are:
#
# - Validating code committed on default upstream branch
# - Validating patches targeting default upstream branch
# which do not have CI changes
#
# We use a local build env for any pipelines that are:
#
# - Validating code committed to a non-default upstream branch
# - Validating patches targeting a non-default upstream branch
# - Validating patches targeting default upstream branch which
# include CI changes
# - Validating code committed to a fork branch
#
# Note: the rules across the prebuilt and local container scenarios
# should be logical inverses, such that jobs are mutually exclusive
#
.gitlab_cross_build_job:
image: $IMAGE
stage: builds
interruptible: true
before_script:
- if test "$IMAGE" == "$TARGET_BASE_IMAGE" ;
then
source ci/buildenv/$NAME-cross-$CROSS.sh ;
install_buildenv ;
export_buildenv ;
fi
- cat /packages.txt
variables:
IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/virt-viewer/ci-$NAME-cross-$CROSS:latest
rules:
### PUSH events
# upstream: pushes to the default branch
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
# forks: pushes to a branch when a pipeline run in upstream env is explicitly requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV'
when: on_success
# forks: pushes to branches with pipeline requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### MERGE REQUEST events
# upstream+forks: merge requests targeting the default branch, with CI changes
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME-cross-$CROSS.Dockerfile
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME-cross-$CROSS.Dockerfile
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
# upstream+forks: merge requests targeting the default branch
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
when: on_success
# upstream+forks: merge requests targeting non-default branches
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### WEB / API / SCHEDULED events
# upstream: other web/api/scheduled pipelines targeting the default branch
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
when: on_success
# upstream: other web/api/scheduled pipelines targeting non-default branches
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
# forks: other web/api/scheduled pipelines on any branches
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
### Catch all unhandled events
# upstream+forks: that's all folks
- when: never

211
ci/gitlab/builds.yml Normal file
View File

@ -0,0 +1,211 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# Native build jobs
x86_64-almalinux-9:
extends: .native_git_build_job
needs:
- job: x86_64-almalinux-9-container
optional: true
allow_failure: false
variables:
NAME: almalinux-9
RPM: skip
TARGET_BASE_IMAGE: docker.io/library/almalinux:9
x86_64-alpine-319:
extends: .native_build_job
needs:
- job: x86_64-alpine-319-container
optional: true
allow_failure: false
variables:
NAME: alpine-319
TARGET_BASE_IMAGE: docker.io/library/alpine:3.19
x86_64-alpine-320:
extends: .native_build_job
needs:
- job: x86_64-alpine-320-container
optional: true
allow_failure: false
variables:
NAME: alpine-320
TARGET_BASE_IMAGE: docker.io/library/alpine:3.20
x86_64-alpine-edge:
extends: .native_build_job
needs:
- job: x86_64-alpine-edge-container
optional: true
allow_failure: true
variables:
NAME: alpine-edge
TARGET_BASE_IMAGE: docker.io/library/alpine:edge
x86_64-centos-stream-9:
extends: .native_git_build_job
needs:
- job: x86_64-centos-stream-9-container
optional: true
allow_failure: false
variables:
NAME: centos-stream-9
RPM: skip
TARGET_BASE_IMAGE: quay.io/centos/centos:stream9
x86_64-debian-11:
extends: .native_build_job
needs:
- job: x86_64-debian-11-container
optional: true
allow_failure: false
variables:
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
x86_64-debian-12:
extends: .native_build_job
needs:
- job: x86_64-debian-12-container
optional: true
allow_failure: false
variables:
NAME: debian-12
TARGET_BASE_IMAGE: docker.io/library/debian:12-slim
x86_64-debian-sid:
extends: .native_build_job
needs:
- job: x86_64-debian-sid-container
optional: true
allow_failure: true
variables:
NAME: debian-sid
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
x86_64-fedora-39:
extends: .native_build_job
needs:
- job: x86_64-fedora-39-container
optional: true
allow_failure: false
variables:
NAME: fedora-39
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:39
x86_64-fedora-40:
extends: .native_build_job
needs:
- job: x86_64-fedora-40-container
optional: true
allow_failure: false
variables:
NAME: fedora-40
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
x86_64-fedora-rawhide:
extends: .native_build_job
needs:
- job: x86_64-fedora-rawhide-container
optional: true
allow_failure: true
variables:
NAME: fedora-rawhide
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:rawhide
x86_64-opensuse-leap-15:
extends: .native_build_job
needs:
- job: x86_64-opensuse-leap-15-container
optional: true
allow_failure: false
variables:
NAME: opensuse-leap-15
RPM: skip
TARGET_BASE_IMAGE: registry.opensuse.org/opensuse/leap:15.6
x86_64-opensuse-tumbleweed:
extends: .native_build_job
needs:
- job: x86_64-opensuse-tumbleweed-container
optional: true
allow_failure: true
variables:
NAME: opensuse-tumbleweed
RPM: skip
TARGET_BASE_IMAGE: registry.opensuse.org/opensuse/tumbleweed:latest
x86_64-ubuntu-2204:
extends: .native_build_job
needs:
- job: x86_64-ubuntu-2204-container
optional: true
allow_failure: false
variables:
NAME: ubuntu-2204
TARGET_BASE_IMAGE: docker.io/library/ubuntu:22.04
x86_64-ubuntu-2404:
extends: .native_build_job
needs:
- job: x86_64-ubuntu-2404-container
optional: true
allow_failure: false
variables:
NAME: ubuntu-2404
TARGET_BASE_IMAGE: docker.io/library/ubuntu:24.04
# Cross build jobs
mingw32-fedora-rawhide:
extends: .cross_build_job
needs:
- job: mingw32-fedora-rawhide-container
optional: true
allow_failure: true
variables:
CROSS: mingw32
NAME: fedora-rawhide
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:rawhide
artifacts:
expire_in: 2 days
paths:
- data/virt-viewer-x86*.msi
mingw64-fedora-rawhide:
extends: .cross_build_job
needs:
- job: mingw64-fedora-rawhide-container
optional: true
allow_failure: true
variables:
CROSS: mingw64
NAME: fedora-rawhide
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:rawhide
artifacts:
expire_in: 2 days
paths:
- data/virt-viewer-x64*.msi

View File

@ -0,0 +1,45 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# We want to publish containers with tag 'latest':
#
# - In upstream, for push to default branch with CI changes.
# - In upstream, on request, for scheduled/manual pipelines
# against default branch
#
# Note: never publish from merge requests since they have non-committed code
#
.container_job:
image: docker:latest
stage: containers
interruptible: false
needs: []
services:
- docker:dind
before_script:
- export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest"
- docker info
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
script:
- docker build --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ;
- docker push "$TAG"
after_script:
- docker logout
rules:
# upstream: publish containers if there were CI changes on the default branch
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME.Dockerfile
# upstream: allow force re-publishing containers on default branch for web/api/scheduled pipelines
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $RUN_CONTAINER_BUILDS == "1"'
when: on_success
# upstream+forks: that's all folks
- when: never

129
ci/gitlab/containers.yml Normal file
View File

@ -0,0 +1,129 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# Native container jobs
x86_64-almalinux-9-container:
extends: .container_job
allow_failure: false
variables:
NAME: almalinux-9
x86_64-alpine-319-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-319
x86_64-alpine-320-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-320
x86_64-alpine-edge-container:
extends: .container_job
allow_failure: true
variables:
NAME: alpine-edge
x86_64-centos-stream-9-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-9
x86_64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-12-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-12
x86_64-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid
x86_64-fedora-39-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-39
x86_64-fedora-40-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-40
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide
x86_64-opensuse-leap-15-container:
extends: .container_job
allow_failure: false
variables:
NAME: opensuse-leap-15
x86_64-opensuse-tumbleweed-container:
extends: .container_job
allow_failure: true
variables:
NAME: opensuse-tumbleweed
x86_64-ubuntu-2204-container:
extends: .container_job
allow_failure: false
variables:
NAME: ubuntu-2204
x86_64-ubuntu-2404-container:
extends: .container_job
allow_failure: false
variables:
NAME: ubuntu-2404
# Cross container jobs
mingw32-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide-cross-mingw32
mingw64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide-cross-mingw64

View File

@ -0,0 +1,29 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
check-dco:
stage: sanity_checks
needs: []
image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:latest
interruptible: true
script:
- /check-dco "$RUN_UPSTREAM_NAMESPACE"
rules:
# upstream+forks: Run pipelines on MR
- if: '$CI_PIPELINE_SOURCE =~ "merge_request_event"'
when: on_success
# forks: pushes to branches with pipeline requested (including upstream env pipelines)
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE'
when: on_success
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV'
when: on_success
# upstream+forks: that's all folks
- when: never
variables:
GIT_DEPTH: 1000

View File

@ -0,0 +1,26 @@
---
packages:
- bash-completion
- ccache
- cppi
- gcc
- gettext
- glib2
- gstreamer-plugins-bad-free
- gstreamer-plugins-good
- gtk3
- icoutils
- libc
- libgovirt
- librest
- libtool
- libtoolize
- libxml2
- make
- meson
- ninja
- pkg-config
- rpmbuild
- spice-gtk3
- vte
- xmllint

84
ci/manifest.yml Normal file
View File

@ -0,0 +1,84 @@
projects:
- virt-viewer
- https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+dist.yml
- https://gitlab.com/libvirt/libvirt-glib/-/raw/master/ci/lcitool/projects/libvirt-glib+dist.yml
- https://gitlab.gnome.org/GNOME/gtk-vnc/-/raw/master/ci/lcitool/projects/gtk-vnc+dist.yml
gitlab:
namespace: virt-viewer
project: virt-viewer
targets:
almalinux-9:
projects:
- virt-viewer
- https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+minimal.yml
- https://gitlab.com/libvirt/libvirt-glib/-/raw/master/ci/lcitool/projects/libvirt-glib.yml
- https://gitlab.gnome.org/GNOME/gtk-vnc/-/raw/master/ci/lcitool/projects/gtk-vnc.yml
jobs:
- arch: x86_64
template: .native_git_build_job
variables:
RPM: skip
alpine-319: x86_64
alpine-320: x86_64
alpine-edge: x86_64
centos-stream-9:
projects:
- virt-viewer
- https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+minimal.yml
- https://gitlab.com/libvirt/libvirt-glib/-/raw/master/ci/lcitool/projects/libvirt-glib.yml
- https://gitlab.gnome.org/GNOME/gtk-vnc/-/raw/master/ci/lcitool/projects/gtk-vnc.yml
jobs:
- arch: x86_64
template: .native_git_build_job
variables:
RPM: skip
debian-11: x86_64
debian-12: x86_64
debian-sid: x86_64
fedora-39: x86_64
fedora-40: x86_64
fedora-rawhide:
jobs:
- arch: x86_64
- arch: mingw32
artifacts:
expiry: 30 days
paths:
- data/virt-viewer-x86*.msi
- arch: mingw64
artifacts:
expiry: 30 days
paths:
- data/virt-viewer-x64*.msi
opensuse-leap-15:
jobs:
- arch: x86_64
variables:
RPM: skip
opensuse-tumbleweed:
jobs:
- arch: x86_64
variables:
RPM: skip
ubuntu-2204: x86_64
ubuntu-2404: x86_64

49
config.h.in Normal file
View File

@ -0,0 +1,49 @@
/* Enable compile-time and run-time bounds-checking, and some warnings. */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
/* Name of package */
#define PACKAGE "virt-viewer"
/* GETTEXT package name */
#define GETTEXT_PACKAGE "virt-viewer"
/* GLib logging domain */
#define G_LOG_DOMAIN "virt-viewer"
/* Enable GNU extensions */
#define _GNU_SOURCE
/* Build version details */
#define BUILDID "@BUILDID@"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "virt-viewer @VERSION@"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@VERSION@"
/* OS ID for this build */
#mesondefine REMOTE_VIEWER_OS_ID
/* Version number of package */
#define VERSION "@VERSION@"
/* Have gtk-vnc? */
#mesondefine HAVE_GTK_VNC
/* Have libvirt? */
#mesondefine HAVE_LIBVIRT
/* Have libgovirt? */
#mesondefine HAVE_OVIRT
/* Have ovirt_storage_domain_get_disks function? */
#mesondefine HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS
/* Have spice-gtk? */
#mesondefine HAVE_SPICE_GTK
/* Have vte? */
#mesondefine HAVE_VTE

View File

@ -1,126 +0,0 @@
AC_INIT(virt-viewer, 0.4.0)
AC_CONFIG_SRCDIR(src/virt-viewer-main.c)
AM_CONFIG_HEADER(config.h)
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([-Wno-portability])
AC_CANONICAL_HOST
# Use the silent-rules feature when possible.
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
GLIB2_REQUIRED=2.12.0
LIBXML2_REQUIRED="2.6.0"
LIBVIRT_REQUIRED="0.6.0"
GTK2_REQUIRED="2.12.0"
GTK3_REQUIRED="3.0"
GTK_VNC_REQUIRED="0.3.8"
SPICE_GTK_REQUIRED="0.6"
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_CONFIG_LIBOBJ_DIR([src])
AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions])
VIRT_VIEWER_COMPILE_WARNINGS(maximum)
GETTEXT_PACKAGE=virt-viewer
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
IT_PROG_INTLTOOL([0.35.0])
AM_GLIB_GNU_GETTEXT
PKG_CHECK_MODULES(GLIB2, gmodule-export-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
[case "$with_gtk" in
2.0|3.0) ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[with_gtk=2.0])
AC_MSG_RESULT([$with_gtk])
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
GTK_REQUIRED=$GTK2_REQUIRED
GTK_VNC_API_VERSION=1.0
SPICE_GTK_API_VERSION=2.0
;;
3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=$GTK3_REQUIRED
GTK_VNC_API_VERSION=2.0
SPICE_GTK_API_VERSION=3.0
;;
esac
AC_SUBST([GTK_API_VERSION])
AC_SUBST([GTK_REQUIRED])
AC_SUBST([GTK_VNC_API_VERSION])
AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
PKG_CHECK_MODULES(GTK_VNC, gtk-vnc-$GTK_VNC_API_VERSION >= $GTK_VNC_REQUIRED)
AC_ARG_WITH([spice-gtk],
AS_HELP_STRING([--without-spice-gtk], [Ignore presence of spice-gtk and disable it]))
AS_IF([test "x$with_spice_gtk" != "xno"],
[PKG_CHECK_MODULES(SPICE_GTK,
spice-client-gtk-$SPICE_GTK_API_VERSION >= $SPICE_GTK_REQUIRED,
[have_spice_gtk=yes], [have_spice_gtk=no])],
[have_spice_gtk=no])
AS_IF([test "x$have_spice_gtk" = "xyes"],
[AC_DEFINE([HAVE_SPICE_GTK], 1, [Have spice-gtk?])],
[AS_IF([test "x$with_spice_gtk" = "xyes"],
[AC_MSG_ERROR([spice-gtk requested but not found])
])
])
AM_CONDITIONAL([HAVE_SPICE_GTK], [test "x$have_spice_gtk" = "xyes"])
dnl Decide if this platform can support the SSH tunnel feature.
AC_CHECK_HEADERS([sys/socket.h sys/un.h windows.h])
AC_CHECK_FUNCS([fork socketpair])
dnl --enable-plugin to enable the browser plugin.
NSPR_REQUIRED=4.0.0
FIREFOX_PLUGIN_REQUIRED=1.5.0
MOZILLA_PLUGIN_REQUIRED=1.8
AC_ARG_ENABLE(plugin,
[ --enable-plugin=[no/yes] enable browser plugin [default=no]],,
enable_plugin=no)
if test "x$enable_plugin" = "xyes"; then
dnl Check for Netscape Portable Runtime development package.
PKG_CHECK_MODULES(NSPR, nspr >= $NSPR_REQUIRED)
dnl Check for Firefox plugin package (also includes NSPR cflags/libs).
PKG_CHECK_MODULES(FIREFOX_PLUGIN,
firefox-plugin >= $FIREFOX_PLUGIN_REQUIRED, ,[
PKG_CHECK_MODULES(MOZILLA_PLUGIN,
mozilla-plugin >= $MOZILLA_PLUGIN_REQUIRED)
FIREFOX_PLUGIN_CFLAGS="$MOZILLA_PLUGIN_CFLAGS"
FIREFOX_PLUGIN_LIBS="$MOZILLA_PLUGIN_LIBS"
])
AC_SUBST(FIREFOX_PLUGIN_CFLAGS)
AC_SUBST(FIREFOX_PLUGIN_LIBS)
fi
AM_CONDITIONAL(ENABLE_PLUGIN, [test "x$enable_plugin" = "xyes"])
AC_OUTPUT(Makefile
src/Makefile
man/Makefile
po/Makefile.in
plugin/Makefile
virt-viewer.spec
mingw32-virt-viewer.spec)

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<its:rules xmlns:its="http://www.w3.org/2005/11/its"
version="2.0">
<its:translateRule selector="/mime-info" translate="no"/>
<its:translateRule selector="//comment" translate="yes"/>
</its:rules>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="mime" pattern="*.xml">
<documentRule localName="mime-info" target="mime.its"/>
</locatingRule>
</locatingRules>

112
data/meson.build Normal file
View File

@ -0,0 +1,112 @@
if host_machine.system() != 'windows'
desktop = 'org.virt-manager.virt-viewer.desktop'
i18n.merge_file (
type: 'desktop',
input: desktop + '.in',
output: desktop,
po_dir: po_dir,
install: true,
install_dir: join_paths(datadir, 'applications')
)
mimetypes = 'virt-viewer-mime.xml'
i18n.merge_file (
type: 'xml',
input: mimetypes + '.in',
output: mimetypes,
data_dirs: i18n_itsdir,
po_dir: po_dir,
install: true,
install_dir: join_paths(datadir, 'mime', 'packages')
)
metainfo = 'org.virt-manager.virt-viewer.appdata.xml'
i18n.merge_file (
type: 'xml',
input: metainfo + '.in',
output: metainfo,
po_dir: po_dir,
install: true,
install_dir: join_paths(datadir, 'metainfo')
)
endif
with_msi=false
if host_machine.system() == 'windows'
wixl = find_program('wixl', required: false)
wixl_heat = find_program('wixl-heat', required: false)
if wixl.found() and wixl_heat.found()
with_msi=true
endif
endif
if with_msi
buildenv = custom_target(
'buildenv.txt',
output: ['buildenv.txt'],
command: [
python3,
buildenv_prog.full_path(),
],
capture: true)
msi_filename = 'virt-viewer-@0@-@1@.msi'.format(wixl_arch, meson.project_version())
if libvirt_dep.found()
wixl_libvirt_arg = 'True'
else
wixl_libvirt_arg = 'False'
endif
if spice_gtk_dep.found()
wixl_spice_gtk_arg = 'True'
else
wixl_spice_gtk_arg = 'False'
endif
if gtk_vnc_dep.found()
wixl_gtk_vnc_arg = 'True'
else
wixl_gtk_vnc_arg = 'False'
endif
if govirt_dep.found()
wixl_govirt_arg = 'True'
else
wixl_govirt_arg = 'False'
endif
wxsfile = configure_file(
input: 'virt-viewer.wxs.in',
output: 'virt-viewer.wxs',
configuration: conf_data
)
msi = custom_target(
msi_filename,
input: [wxsfile, buildenv],
output: [msi_filename],
build_by_default: false,
command: [
python3,
msitool_prog.full_path(),
meson.build_root(),
prefix,
wixl_arch,
join_paths(meson.build_root(), 'data', msi_filename),
wxsfile,
buildenv,
wixl_heat,
wixl,
wixl_spice_gtk_arg,
wixl_gtk_vnc_arg,
wixl_libvirt_arg,
wixl_govirt_arg,
],
)
endif

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>remote-viewer</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Remote Viewer</name>
<summary>Remotely access virtual machines</summary>
<description>
<p>
Remote Viewer provides a graphical viewer for the guest OS
display. At this time it supports guest OS using the VNC
or SPICE protocols. Further protocols may be supported in
the future as user demand dictates. The viewer can connect
directly to both local and remotely hosted guest OS, optionally
using SSL/TLS encryption.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://virt-manager.org/appdata/en_US/virt-viewer/general.png</image>
</screenshot>
<screenshot>
<image>https://virt-manager.org/appdata/en_US/virt-viewer/connection.png</image>
</screenshot>
<screenshot>
<image>https://virt-manager.org/appdata/en_US/virt-viewer/usbredir.png</image>
</screenshot>
<screenshot>
<image>https://virt-manager.org/appdata/en_US/virt-viewer/shared_folder.png</image>
</screenshot>
</screenshots>
<launchable type="desktop-id">org.virt-manager.virt-viewer.desktop</launchable>
<provides>
<binary>remote-viewer</binary>
<binary>virt-viewer</binary>
</provides>
<url type="homepage">https://gitlab.com/virt-viewer/virt-viewer/</url>
<url type="bugtracker">https://gitlab.com/virt-viewer/virt-viewer/-/issues</url>
<url type="translate">https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/</url>
<content_rating type="oars-1.1" />
</component>

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=Remote Viewer
Comment=Access remote desktops
Exec=remote-viewer %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/spice;x-scheme-handler/spice+unix;x-scheme-handler/spice+tls;x-scheme-handler/vnc;application/x-virt-viewer;
StartupNotify=true
Categories=GNOME;GTK;Network;RemoteAccess;
Icon=virt-viewer

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-virt-viewer">
<sub-class-of type="text/plain"/>
<comment>Virt-Viewer connection file</comment>
<magic priority="50">
<match type="string" offset="0" value="[virt-viewer]"/>
</magic>
<glob pattern="*.vv"/>
</mime-type>
</mime-info>

132
data/virt-viewer.wxs.in Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Version = "@WINDOWS_PRODUCTVERSION@"?>
<?define Arch = "@WIXL_ARCH@"?>
<?if $(var.Arch) = "x64"?>
<?define GLIB_ARCH = "win64"?>
<?define ArchString = "64-bit"?>
<?define ArchProgramFilesFolder = "ProgramFiles64Folder"?>
<?define Win64 = "yes"?>
<?else?>
<?define GLIB_ARCH = "win32"?>
<?define ArchString = "32-bit"?>
<?define ArchProgramFilesFolder = "ProgramFilesFolder"?>
<?define Win64 = "no"?>
<?endif?>
<?if $(var.HaveSpiceGtk) = "True"?>
<?require spice-gtk3.wxi?>
<?endif?>
<?if $(var.HaveGtkVnc) = "True"?>
<?require gtk-vnc2.wxi?>
<?endif?>
<?require adwaita-icon-theme.wxi?>
<?if $(var.HaveLibvirt) = "True"?>
<?require libvirt.wxi?>
<?require libvirt-glib.wxi?>
<?endif?>
<?if $(var.HaveOVirt) = "True"?>
<?require libgovirt.wxi?>
<?endif?>
<?require libxml2.wxi?>
<?define UpgradeCode = "5B027138-1A63-49E6-877E-055E5EEC1903"?>
<Product Id="*"
Name="VirtViewer @VERSION@@BUILDID@ ($(var.ArchString))"
Manufacturer="$(env.MANUFACTURER)"
Version="$(var.Version)"
UpgradeCode="$(var.UpgradeCode)"
Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="comments" InstallScope="perMachine"/>
<Media Id="1" Cabinet="cabinet.cab" EmbedCab="yes"/>
<Property Id="ARPHELPLINK" Value="https://www.virt-manager.org"/>
<Property Id="ARPNOMODIFY" Value="1"/>
<Property Id="ARPNOREPAIR" Value="1"/>
<Property Id="ARPPRODUCTICON" Value="virt-viewer.ico"/>
<Property Id="ARPURLINFOABOUT" Value="https://www.virt-manager.org"/>
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
<UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)" IncludeMinimum="yes" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/>
</Upgrade>
<Condition Message="VirtViewer is already installed.">NOT NEWERVERSIONDETECTED</Condition>
<DirectoryRef Id="TARGETDIR">
<Component Id="CProgIds" Guid="89D6F46D-9C5E-4D65-8456-58FC361E553E">
<ProgId Id='VirtViewer.vvfile' Description='VirtViewer connection file'>
<Extension Id='vv' ContentType='application/x-virt-viewer'>
<Verb Id='open' Command='Open' TargetFile='fil610DF9E49759B1DEC646290195F96F8A' Argument='"%1"' />
<MIME ContentType="application/x-virt-viewer" Default="yes"/>
</Extension>
</ProgId>
</Component>
</DirectoryRef>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ArchProgramFilesFolder)">
<Directory Id="INSTALLDIR" Name="VirtViewer v@VERSION@@BUILDID@">
<Component Id="CBuildEnvFile" Guid="*">
<File Id="filA1E799D196006E6DF67DACE15B8C6193" KeyPath="yes" Source="buildenv.txt"/>
</Component>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="MENUDIR" Name="VirtViewer"/>
</Directory>
</Directory>
<DirectoryRef Id="INSTALLDIR">
<Directory Id="DirShare" Name="share">
<Directory Id="DirHwdata" Name="hwdata">
<Component Id="CHwdataUSB" Guid="*">
<File Id="FHwdataUSB" KeyPath="yes" Source="/usr/share/hwdata/usb.ids"/>
</Component>
</Directory>
</Directory>
</DirectoryRef>
<DirectoryRef Id="MENUDIR">
<Component Id="CShortcut" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Remote viewer"
Description="A SPICE/VNC client"
Target="[INSTALLDIR]\bin\remote-viewer.exe"
Icon="virt-viewer.ico"/>
<RemoveFolder Id="MENUDIR" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\VirtViewer\remote-viewer-shortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="Complete" Level="1">
<?if $(var.HaveSpiceGtk) = "True"?>
<ComponentGroupRef Id="CG.spice-gtk3"/>
<?endif?>
<?if $(var.HaveGtkVnc) = "True"?>
<ComponentGroupRef Id="CG.gtk-vnc2"/>
<?endif?>
<ComponentGroupRef Id="CG.adwaita-icon-theme"/>
<?if $(var.HaveLibvirt) = "True"?>
<ComponentGroupRef Id="CG.libvirt"/>
<ComponentGroupRef Id="CG.libvirt-glib"/>
<?endif?>
<?if $(var.HaveOVirt) = "True"?>
<ComponentGroupRef Id="CG.libgovirt"/>
<?endif?>
<ComponentGroupRef Id="CG.libxml2"/>
<ComponentGroupRef Id="CG.virt-viewer"/>
<ComponentRef Id="CBuildEnvFile"/>
<ComponentRef Id="CShortcut"/>
<ComponentRef Id="CProgIds"/>
<ComponentRef Id="CHwdataUSB"/>
</Feature>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<Icon Id="virt-viewer.ico" SourceFile="../icons/virt-viewer.ico"/>
</Product>
</Wix>

View File

@ -0,0 +1,139 @@
=================================================================
File Format
=================================================================
The configuration file is a GKeyFile format file. The GUID is
the 'group' name, and the mapping configuration for the guest is
specified with a 'monitor-mapping' key. The 'monitor-mapping' key
is an array of mappings from display ID to monitor ID. Since
GKeyFile uses ';' as an array separator, we use ':' as the
mapping separator. Display and monitor IDS both use 1-based
indices (i.e. the first display is 1, not 0).
So, to map guest display 1 to client monitor 1, use "1:1". To
map guest display 1 to client monitor 2 and guest display 2 to
client monitor 3, use "1:2;2:3".
Fallback configuration is specified in the same manner, but uses
the group name 'fallback'.
=================================================================
A. Basic example
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:2
A1. When connecting to guest 6485b... on a client with 2
monitors, it will enable only guest display #1 and display it on
monitor #2.
A2. When connecting to guest 6485b... on a client with 1 monitor,
the "1:2" mapping refers to a non-existent monitor and will thus
be ignored (C4). Because there are no valid display mappings
specified, the configuration will be considered invalid (B13).
The guest will then be displayed according to the default
behavior (open 1 display on monitor 1)
A3. When connecting to any other guest, it will use default
behavior (enable 1 display for each monitor and map them N:N)
=================================================================
B. Basic example with fallback
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:2
[fallback]
monitor-mapping=1:2;2:3;3:4
B1. same as A1
B2. same as A2
B3. When connecting to another guest on a client with 4 monitors:
it will enable 3 displays and assign them to monitors 2, 3 and 4.
B4. When connecting to another guest on a client with 3 monitors:
it will enable 2 displays and assign them to monitors 2 and 3
B5. When connecting to another guest on a client with 1 monitor:
no mappings are valid, so default behavior will be used.
=================================================================
C. Same display referenced multiple times
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;1:2
C1. configuration is invalid because it is ambiguous (display 1
is mapped to both monitor 1 and monitor 2). Default behavior
will be used.
=================================================================
D. Same monitor referenced multiple times
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;2:1
D1. configuration is invalid because it is ambiguous (both guest
display 1 and guest display 2 and mapped to monitor 1). Default
behavior will be used.
=================================================================
E. Multiple configurations for same GUID
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;2:2
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:2;2:3
E1. Since two configurations are given for the same guest, the
last one will be used. Two guest displays will be enabled and
will be shown on monitors 2 and 3
=================================================================
F. multiple monitor-mapping keys for same GUID
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;2:2
monitor-mapping=1:2;2:3
F1. Since two configurations are given for the same guest, the
last one will be used. Two guest displays will be enabled and
will be shown on monitors 2 and 3
=================================================================
G. 'sparse' displays
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;3:2
G1. configuration is invalid. Enabled guest displays must be
specified without any gaps between displays.
=================================================================
H. configuration specifies more displays than guest can enable
=================================================================
[6485b20f-e9da-614c-72b0-60a7857e7886]
monitor-mapping=1:1;2:2;3:3
H1. If guest 6485b... is a windows guest with only 2 display
devices, we will enable displays 1 and 2 on the guest, and assign
them to monitors 1 and 2 (respectively) on the client. Guest
display 3 will be disabled.

View File

@ -0,0 +1,98 @@
Fullscreen Startup Mode
-----------------------
A. Default fullscreen behavior
Assume:
NG = number of displays supported by the guest
NC = number of monitors on the client
N = the lesser of NG and NC
A1. at startup, enable N displays on the guest
A2. if N == NC, map guest display X to physical monitor X
A3. if N < NC, map guest display X to physical monitor X+1 (the primary
monitor likely has an application menu, etc, so keep that free for local use)
A4. Arrange guest displays in the same geometry as the physical monitors
B. Custom monitor mapping configuration
B1. configuration file is specific to a particular user on a particular client
machine. Different users on same machine can use different
configurations.
B2. configuration only applies to fullscreen startup mode
B3. configuration should be simple to edit by hand
B4. It must be possible to specify a custom configuration for a specific
guest vm
B5. guest-specific configuration is identified by GUID
B6. It must be possible to specify a fallback configuration that will be used
for all guests without an explicit configuration
B7. It must be possible to specify how many guest displays to enable
B8. It must be possible to specify which guest display to map to which to
client monitor
B9. configuration format must be flexible and support a wide range of guest
and client configurations
B10. if the guest-specific configuration is invalid, we will attempt to use
the default/fallback configuration
B11. if the fallback configuration is invalid, we will revert to default
behavior (see A)
B12. Configuration must be considered invalid if it is not unambiguous
B13. A configuration that doesn't specify any displays will be considered
invalid
B14. if multiple configurations are given for the same guest, the last one
will be used.
- non-requirements (these are features that were considered but I propose that
they are explicitly not supported)
- no need to have separate configurations depending on how many guest
displays are currently enabled
- complicates startup (have to wait to receive display config before
setting up anything)
- complicates config file format
- the number of guest displays may have been set by another user since you
last logged in, so it's not clear to me that we want to make
configuration decisions based on something you can't control
- no need to specify the geometry arrangement of displays
- just match the arrangement of the physical monitors that the display
will be mapped to
- no need to specify different guest configurations based on client
configuration (e.g. separate guest configurations for when the client
machine has 4 monitors vs when it has 2 monitors)
- complicates config file format
- possibly unnecessary if we satisfy B9
- Implications of high-level requirements
1. per-guest display mapping will always work with virt-viewer because
virt-viewer can get the GUID from libvirt <B5>
2. per-guest display mapping may not work with *remote-viewer* in many cases.
If you're connecting to a vm on a host that is running an older version
of spice-server (e.g. RHEL6), the GUID is not sent over the spice
protocol, so remote-viewer doesn't have any way of determining a guest's
GUID <B5>
- Derived requirements
C1. Use GKeyFile <B3>
C2. need to add a 'Guest Details' dialog to virt-viewer so that the user can
determine the GUID of the guest. <B3><B5>
C3. if config file specifies more guest displays than can be enabled on the
guest, simply ignore (disable) the extra displays <B9>
C4. if config file specifies that a display should be mapped to a client
monitor that doesn't exist, that display will not be enabled <B9>
C5. if config file specifies that a given guest display will map to multiple
client monitors, it will be considered invalid <B12>
C6. if the config file specifies that multiple guest displays will map to the
same client monitor, it will be considered invalid <B12>
Normal (non-fullscreen) Startup Mode
------------------------------------
D1. Client must not change Guest configuration at startup
D2. Client must open a window for every display that is enabled on the guest
D3. Client should allow the native window manager to place the display windows
at appropriate positions
D4. Client will not prevent displays from being larger than client monitors,
but the window manager may impose some size restrictions.
D5. Toggling fullscreen mode after startup should only affect the window that
was acted upon
- currently if client is started in fullscreen mode, exiting fullscreen
mode for one window will also exit fullscreen mode for all other windows
-- that will need to be changed.
- (If fullscreen toggle worked at the application level rather than the
window level, it's much more difficult to decide what to do if there are
more windows open than client monitors. It's easier to leave those sorts
of policy decisions to the user.)

BIN
icons/16x16/virt-viewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
icons/22x22/virt-viewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

BIN
icons/24x24/virt-viewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
icons/32x32/virt-viewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
icons/48x48/virt-viewer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

39
icons/meson.build Normal file
View File

@ -0,0 +1,39 @@
logo_icon_sizes = [
'16x16',
'22x22',
'24x24',
'32x32',
'48x48',
'256x256',
'scalable',
]
foreach icon_size: logo_icon_sizes
if icon_size == 'scalable'
src_icon = 'virt-viewer.svg'
else
src_icon = 'virt-viewer.png'
endif
install_data(
join_paths(icon_size, src_icon),
install_dir: join_paths(datadir, 'icons', 'hicolor', icon_size, 'apps')
)
endforeach
if host_machine.system() == 'windows'
icotool = find_program('icotool')
infiles = []
foreach size: ['16', '32', '48', '256']
infiles += [join_paths('@0@x@0@'.format(size), 'virt-viewer.png')]
endforeach
outfile = 'virt-viewer.ico'
icofile = custom_target(
outfile,
output : outfile,
input : infiles,
command : [icotool, '-c', '-o', '@OUTPUT@', '@INPUT@'])
endif

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path d="M13.98 1.99a1 1 0 0 0-.687.303l-.984.984A8 8 0 0 0 8 2 8 8 0 0 0 .262 8.01a8 8 0 0 0 2.943 4.37l-.912.913a1 1 0 1 0 1.414 1.414l11-11a1 1 0 0 0-.727-1.717zM8 4a4 4 0 0 1 2.611.974l-1.42 1.42A2 2 0 0 0 8 6a2 2 0 0 0-2 2 2 2 0 0 0 .396 1.19l-1.42 1.42A4 4 0 0 1 4 8a4 4 0 0 1 4-4zm7.03 2.209l-3.344 3.343a4 4 0 0 1-2.127 2.127l-2.28 2.28a8 8 0 0 0 .721.04 8 8 0 0 0 7.738-6.01 8 8 0 0 0-.709-1.78zm-7.53.79a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5z" fill="#2e3436"/>
</svg>

After

Width:  |  Height:  |  Size: 570 B

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 16 16" version="1.1" id="svg7384" height="16">
<metadata id="metadata90">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title id="title9167">Gnome Symbolic Icon Theme</title>
<defs id="defs7386">
<linearGradient osb:paint="solid" id="linearGradient7212">
<stop style="stop-color:#000000;stop-opacity:1;" offset="0" id="stop7214"/>
</linearGradient>
</defs>
<g transform="translate(-341.0002,-13.000323)" style="display:inline" id="layer9"/>
<g transform="translate(-100,-380.00032)" id="layer1"/>
<g transform="translate(-100,-380.00032)" style="display:inline" id="layer10">
<path d="m 108,382 a 8,8 0 0 0 -7.73828,6.00977 A 8,8 0 0 0 108,394 8,8 0 0 0 115.73828,387.99023 8,8 0 0 0 108,382 Z m 0,2 a 4,4 0 0 1 4,4 4,4 0 0 1 -4,4 4,4 0 0 1 -4,-4 4,4 0 0 1 4,-4 z" id="path2314" style="opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"/>
<path id="path2318" d="m 110,388.00003 a 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 2,2 0 0 1 2,2 z" style="vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
</g>
<g transform="translate(-100,-380.00032)" id="g6387"/>
<g transform="translate(-100,-380.00032)" id="layer11"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,488 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48.000000px"
height="48.000000px"
id="svg2327"
sodipodi:version="0.32"
inkscape:version="0.46"
sodipodi:docbase="/home/tigert/cvs/freedesktop.org/tango-icon-theme/scalable/devices"
sodipodi:docname="video-display.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 24 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="48 : 24 : 1"
inkscape:persp3d-origin="24 : 16 : 1"
id="perspective71" />
<linearGradient
id="linearGradient2329">
<stop
id="stop2331"
offset="0.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
<stop
id="stop2333"
offset="1.0000000"
style="stop-color:#ffffff;stop-opacity:0.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient2321"
inkscape:collect="always">
<stop
id="stop2323"
offset="0"
style="stop-color:#7b7f7a;stop-opacity:1;" />
<stop
id="stop2325"
offset="1"
style="stop-color:#7b7f7a;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2711">
<stop
id="stop2713"
offset="0.0000000"
style="stop-color:#909090;stop-opacity:1.0000000;" />
<stop
id="stop2715"
offset="1.0000000"
style="stop-color:#bebebe;stop-opacity:0.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient2701">
<stop
id="stop2703"
offset="0.0000000"
style="stop-color:#585956;stop-opacity:1.0000000;" />
<stop
id="stop2705"
offset="1.0000000"
style="stop-color:#bbbeb8;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient2683"
inkscape:collect="always">
<stop
id="stop2685"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop2687"
offset="1"
style="stop-color:#000000;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2675">
<stop
id="stop2677"
offset="0.0000000"
style="stop-color:#5b5b97;stop-opacity:1.0000000;" />
<stop
id="stop2679"
offset="1.0000000"
style="stop-color:#1b1b43;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
id="linearGradient2667">
<stop
id="stop2669"
offset="0.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
<stop
id="stop2671"
offset="1.0000000"
style="stop-color:#fcfcff;stop-opacity:0.0000000;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2454">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop2456" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop2458" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2415">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2417" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2419" />
</linearGradient>
<linearGradient
id="linearGradient2253">
<stop
style="stop-color:#8f8f8f;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop2255" />
<stop
style="stop-color:#494949;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop2257" />
</linearGradient>
<linearGradient
id="linearGradient2245">
<stop
style="stop-color:#dde1d9;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop2247" />
<stop
style="stop-color:#cacdc6;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop2249" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2245"
id="linearGradient2251"
gradientTransform="matrix(1.129863,0.000000,0.000000,0.885063,2.875000,1.570628)"
x1="8.6116238"
y1="7.2293582"
x2="34.784473"
y2="33.339787"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2415"
id="linearGradient2421"
gradientTransform="matrix(1.108069,0.000000,0.000000,0.902471,5.500000,3.875000)"
x1="17.698339"
y1="13.004725"
x2="34.974548"
y2="55.200756"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2454"
id="radialGradient2460"
gradientTransform="scale(1.925808,0.519262)"
cx="12.575710"
cy="67.501709"
fx="12.575710"
fy="67.501709"
r="8.7662794"
gradientUnits="userSpaceOnUse" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="26.729263"
x2="17.199417"
y1="1.6537577"
x1="11.492236"
gradientTransform="matrix(1.238977,0.000000,0.000000,0.895955,5.090553,1.543476)"
id="linearGradient2673"
xlink:href="#linearGradient2667"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="8.8666229"
x2="16.315819"
y1="32.622238"
x1="19.150396"
gradientTransform="matrix(1.174139,0.000000,0.000000,0.945431,5.221825,1.543476)"
id="linearGradient2681"
xlink:href="#linearGradient2675"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="162.45061"
x2="3.7069974"
y1="171.29134"
x1="3.7069976"
gradientTransform="matrix(5.705159,0.000000,0.000000,0.175280,5.500000,2.195627)"
id="linearGradient2689"
xlink:href="#linearGradient2683"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="64.892525"
x2="12.127711"
y1="53.535141"
x1="12.206709"
gradientTransform="matrix(1.816345,0.000000,0.000000,1.278927,2.500000,-40.24508)"
id="linearGradient2707"
xlink:href="#linearGradient2701"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="3.8451097"
x2="35.520542"
y1="3.9384086"
x1="34.300991"
id="linearGradient2717"
xlink:href="#linearGradient2711"
inkscape:collect="always" />
<linearGradient
y2="3.8451097"
x2="35.520542"
y1="3.9384086"
x1="34.300991"
gradientUnits="userSpaceOnUse"
id="linearGradient2721"
xlink:href="#linearGradient2711"
inkscape:collect="always" />
<linearGradient
y2="3.8451097"
x2="35.520542"
y1="3.9384086"
x1="34.300991"
gradientUnits="userSpaceOnUse"
id="linearGradient2725"
xlink:href="#linearGradient2711"
inkscape:collect="always" />
<linearGradient
y2="3.8451097"
x2="35.520542"
y1="3.9384086"
x1="34.300991"
gradientUnits="userSpaceOnUse"
id="linearGradient2729"
xlink:href="#linearGradient2711"
inkscape:collect="always" />
<linearGradient
y2="3.8451097"
x2="35.520542"
y1="3.9384086"
x1="34.300991"
gradientUnits="userSpaceOnUse"
id="linearGradient2733"
xlink:href="#linearGradient2711"
inkscape:collect="always" />
<linearGradient
y2="31.246054"
x2="32.536823"
y1="5.3817744"
x1="10.390738"
gradientTransform="matrix(1.104397,0.000000,0.000000,0.905471,4.500000,2.875000)"
gradientUnits="userSpaceOnUse"
id="linearGradient1561"
xlink:href="#linearGradient2253"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="28.205938"
x2="-35.658386"
y1="33.416473"
x1="-35.658386"
id="linearGradient2327"
xlink:href="#linearGradient2321"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="30.962345"
x2="-35.074745"
y1="34.242237"
x1="-35.122688"
id="linearGradient2337"
xlink:href="#linearGradient2329"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.12156863"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568542"
inkscape:cx="35.613813"
inkscape:cy="27.608256"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="854"
inkscape:window-height="756"
inkscape:window-x="211"
inkscape:window-y="92"
inkscape:showpageshadow="false" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Video Display</dc:title>
<dc:date />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:subject>
<rdf:Bag>
<rdf:li>video</rdf:li>
<rdf:li>display</rdf:li>
<rdf:li>monitor</rdf:li>
<rdf:li>LCD</rdf:li>
<rdf:li>CRT</rdf:li>
</rdf:Bag>
</dc:subject>
<cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
<dc:source>http://jimmac.musichall.cz/</dc:source>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:type="arc"
style="opacity:0.50857143;overflow:visible;display:inline;visibility:visible;stroke-opacity:0.70063692;stroke-dashoffset:0.0000000;stroke-miterlimit:4.0000000;marker-end:none;marker-mid:none;marker-start:none;marker:none;stroke-linejoin:miter;stroke-linecap:round;stroke-width:1.0000000;stroke:none;fill-rule:evenodd;fill-opacity:1.0000000;fill:url(#radialGradient2460);color:#000000"
id="path2452"
sodipodi:cx="24.218407"
sodipodi:cy="35.051105"
sodipodi:rx="16.882174"
sodipodi:ry="4.5520000"
d="M 41.100580 35.051105 A 16.882174 4.5520000 0 1 1 7.3362331,35.051105 A 16.882174 4.5520000 0 1 1 41.100580 35.051105 z"
transform="matrix(1.050251,0.000000,0.000000,1.867888,-0.945558,-28.10611)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#adb0aa;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#4b4d4a;stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
id="path2407"
sodipodi:cx="-35.658386"
sodipodi:cy="29.716238"
sodipodi:rx="9.3944187"
sodipodi:ry="3.9395950"
d="M -26.263968 29.716238 A 9.3944187 3.9395950 0 1 1 -45.052805,29.716238 A 9.3944187 3.9395950 0 1 1 -26.263968 29.716238 z"
transform="translate(60.03339,8.078430)" />
<path
transform="matrix(0.902373,0.000000,0.000000,0.827650,56.55215,12.86792)"
d="M -26.263968 29.716238 A 9.3944187 3.9395950 0 1 1 -45.052805,29.716238 A 9.3944187 3.9395950 0 1 1 -26.263968 29.716238 z"
sodipodi:ry="3.9395950"
sodipodi:rx="9.3944187"
sodipodi:cy="29.716238"
sodipodi:cx="-35.658386"
id="path1825"
style="color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2327);stroke-width:1.1571338;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2337);stroke-width:1.1833371;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
id="path2983"
sodipodi:cx="-35.658386"
sodipodi:cy="29.716238"
sodipodi:rx="9.3944187"
sodipodi:ry="3.9395950"
d="M -26.263968 29.716238 A 9.3944187 3.9395950 0 1 1 -45.052805,29.716238 A 9.3944187 3.9395950 0 1 1 -26.263968 29.716238 z"
transform="matrix(0.837548,0.000000,0.000000,0.852655,54.17811,11.00615)" />
<rect
y="31.078613"
x="19.972397"
height="6.3650389"
width="9.0396729"
id="rect2699"
style="color:#000000;fill:url(#linearGradient2707);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.60872948;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible" />
<path
style="color:#000000;fill:url(#linearGradient2251);fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient1561);stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
d="M 7.5809024,4.5706221 L 41.169097,4.5706221 C 42.080439,4.5706221 42.793244,5.1541039 42.835849,5.9722091 L 44.167893,31.550323 C 44.226102,32.668058 43.266837,33.570628 42.147588,33.570628 L 6.6024120,33.570628 C 5.4831629,33.570628 4.5238980,32.668058 4.5821068,31.550323 L 5.9141506,5.9722091 C 5.9544343,5.1986745 6.4616533,4.5706221 7.5809024,4.5706221 z "
id="rect2404"
sodipodi:nodetypes="cssssssss" />
<path
sodipodi:nodetypes="ccccc"
id="path2377"
d="M 8.9105350,7.1808270 L 7.6683398,29.226144 L 39.318729,29.226144 L 37.983712,7.2742560 L 8.9105350,7.1808270 z "
style="fill:url(#linearGradient2681);fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000079;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000" />
<path
sodipodi:nodetypes="cc"
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:url(#linearGradient2689);stroke-width:0.99618119;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:0.24840762"
d="M 6.6774331,31.610789 L 42.105910,31.610789"
id="path2393" />
<path
sodipodi:nodetypes="cssssssss"
id="path2397"
d="M 7.4145985,5.5813396 L 41.260101,5.5435383 C 41.543798,5.5432214 41.819403,5.7807881 41.842206,6.1960820 L 43.204098,30.999330 C 43.262137,32.056361 42.664349,32.785201 41.605727,32.785201 L 7.0817583,32.785201 C 6.0231355,32.785201 5.4887439,32.056410 5.5458869,30.999330 L 6.8699773,6.5051630 C 6.9086732,5.7893326 7.0363626,5.5817620 7.4145985,5.5813396 z "
style="color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2421);stroke-width:0.99999964;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:0.70063692;visibility:visible;display:inline;overflow:visible" />
<path
sodipodi:nodetypes="ccccc"
style="opacity:0.53142858;fill:url(#linearGradient2673);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.25000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
d="M 9.2115360,7.6213630 L 8.4090070,25.491693 C 19.453645,23.091063 23.830470,14.999494 37.563039,12.344943 L 37.401567,7.6874270 L 9.2115360,7.6213630 z "
id="path2443" />
<path
transform="matrix(1.331237,0.000000,0.000000,0.658449,-5.919330,5.728866)"
d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z"
sodipodi:ry="0.83968931"
sodipodi:rx="0.83968931"
sodipodi:cy="3.9384086"
sodipodi:cx="34.780815"
id="path2709"
style="color:#000000;fill:url(#linearGradient2717);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:url(#linearGradient2721);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
id="path2719"
sodipodi:cx="34.780815"
sodipodi:cy="3.9384086"
sodipodi:rx="0.83968931"
sodipodi:ry="0.83968931"
d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z"
transform="matrix(1.331237,0.000000,0.000000,0.658449,-5.805730,7.834650)" />
<path
transform="matrix(1.331237,0.000000,0.000000,0.658449,-5.692130,9.834650)"
d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z"
sodipodi:ry="0.83968931"
sodipodi:rx="0.83968931"
sodipodi:cy="3.9384086"
sodipodi:cx="34.780815"
id="path2723"
style="color:#000000;fill:url(#linearGradient2725);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:url(#linearGradient2729);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
id="path2727"
sodipodi:cx="34.780815"
sodipodi:cy="3.9384086"
sodipodi:rx="0.83968931"
sodipodi:ry="0.83968931"
d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z"
transform="matrix(1.331237,0.000000,0.000000,0.658449,-5.578530,11.83465)" />
<path
transform="matrix(1.331237,0.000000,0.000000,0.658449,-5.464930,13.83465)"
d="M 35.620504 3.9384086 A 0.83968931 0.83968931 0 1 1 33.941126,3.9384086 A 0.83968931 0.83968931 0 1 1 35.620504 3.9384086 z"
sodipodi:ry="0.83968931"
sodipodi:rx="0.83968931"
sodipodi:cy="3.9384086"
sodipodi:cx="34.780815"
id="path2731"
style="color:#000000;fill:url(#linearGradient2733);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.50000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
id="text2735"
d="M 22.500000,30.192666 L 22.781716,30.192666 C 22.865481,30.192667 22.929701,30.211330 22.974376,30.248656 C 23.019345,30.285690 23.041829,30.338594 23.041830,30.407370 C 23.041829,30.476440 23.019345,30.529638 22.974376,30.566965 C 22.929701,30.603998 22.865481,30.622515 22.781716,30.622515 L 22.669735,30.622515 L 22.669735,30.850885 L 22.500000,30.850885 L 22.500000,30.192666 M 22.669735,30.315669 L 22.669735,30.499512 L 22.763640,30.499512 C 22.796558,30.499512 22.821982,30.491576 22.839911,30.475705 C 22.857839,30.459540 22.866804,30.436762 22.866804,30.407370 C 22.866804,30.377979 22.857839,30.355348 22.839911,30.339476 C 22.821982,30.323605 22.796558,30.315669 22.763640,30.315669 L 22.669735,30.315669 M 23.461979,30.303765 C 23.410250,30.303766 23.370131,30.322870 23.341621,30.361078 C 23.313112,30.399288 23.298857,30.453074 23.298857,30.522437 C 23.298857,30.591507 23.313112,30.645146 23.341621,30.683355 C 23.370131,30.721564 23.410250,30.740668 23.461979,30.740668 C 23.514001,30.740668 23.554267,30.721564 23.582778,30.683355 C 23.611287,30.645146 23.625541,30.591507 23.625542,30.522437 C 23.625541,30.453074 23.611287,30.399288 23.582778,30.361078 C 23.554267,30.322870 23.514001,30.303766 23.461979,30.303765 M 23.461979,30.180762 C 23.567787,30.180763 23.650671,30.211036 23.710630,30.271582 C 23.770588,30.332128 23.800567,30.415747 23.800568,30.522437 C 23.800567,30.628834 23.770588,30.712305 23.710630,30.772851 C 23.650671,30.833398 23.567787,30.863671 23.461979,30.863671 C 23.356464,30.863671 23.273580,30.833398 23.213328,30.772851 C 23.153370,30.712305 23.123391,30.628834 23.123391,30.522437 C 23.123391,30.415747 23.153370,30.332128 23.213328,30.271582 C 23.273580,30.211036 23.356464,30.180763 23.461979,30.180762 M 23.928420,30.192666 L 24.117994,30.192666 L 24.357387,30.644117 L 24.357387,30.192666 L 24.518305,30.192666 L 24.518305,30.850885 L 24.328730,30.850885 L 24.089338,30.399434 L 24.089338,30.850885 L 23.928420,30.850885 L 23.928420,30.192666 M 24.591489,30.192666 L 24.777095,30.192666 L 24.926991,30.427209 L 25.076887,30.192666 L 25.262935,30.192666 L 25.012079,30.573578 L 25.012079,30.850885 L 24.842344,30.850885 L 24.842344,30.573578 L 24.591489,30.192666"
style="font-size:0.90290260;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;writing-mode:lr-tb;text-anchor:start;fill:#4a4a4a;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

View File

View File

View File

View File

@ -1,8 +0,0 @@
man_MANS = virt-viewer.1
EXTRA_DIST = virt-viewer.pod
DISTCLEANFILES = $(man_MANS)
%.1: %.pod
pod2man $< > $@

31
man/meson.build Normal file
View File

@ -0,0 +1,31 @@
custom_target(
'viewer-viewer-man',
output : 'virt-viewer.1',
input : 'virt-viewer.pod',
command : [
pod2man,
'--section=1',
'--center=Virtualization Support',
'--name=Virt-Viewer',
'--release=Virt-Viewer @0@'.format(meson.project_version()),
'@INPUT@', '@OUTPUT@'
],
install : true,
install_dir : join_paths(mandir, 'man1')
)
custom_target(
'remote-viewer-man',
output : 'remote-viewer.1',
input : 'remote-viewer.pod',
command : [
pod2man,
'--section=1',
'--center=Virtualization Support',
'--name=Remote-Viewer',
'--release=Virt-Viewer @0@'.format(meson.project_version()),
'@INPUT@', '@OUTPUT@'
],
install : true,
install_dir : join_paths(mandir, 'man1')
)

462
man/remote-viewer.pod Normal file
View File

@ -0,0 +1,462 @@
=head1 NAME
remote-viewer - a simple remote desktop client
=head1 SYNOPSIS
B<remote-viewer> [OPTIONS] -- [URI]
=head1 DESCRIPTION
B<remote-viewer> is a simple remote display client. The supported
protocols are SPICE and VNC.
Starting remote-viewer without URI will open a simple dialog with an
entry and a list of previously successfully accessed URI.
The URI can also point to a connection settings file, see the CONNECTION FILE
section for a description of the format.
If URI is '-', then remote-viewer will read the standard input as a
connection settings file and attempt to connect using it.
In some circumstances the viewer may need to grab the mouse pointer. The
default key sequence for releasing the grab is C<Ctrl_L>+C<Alt_L>, however,
this can be overridden using the C<--hotkeys> argument documented below.
=head1 OPTIONS
The following options are accepted when running C<remote-viewer>:
=over 4
=item -h, --help
Display command line help summary
=item -V, --version
Display program version number
=item -v, --verbose
Display information about the connection
=item -z PCT, --zoom=PCT
Zoom level of the display window in percentage. Range 10-400.
=item -f, --full-screen
Start with the windows maximized to fullscreen.
If supported, the remote display will be reconfigured to match the physical
client monitor configuration, by enabling or disabling extra monitors as
necessary. This is currently implemented by the Spice backend only and
can be disabled by the C<--auto-resize> argument.
To specify which client monitors are used in fullscreen mode, see the
CONFIGURATION section below.
=item --auto-resize <always|never>
Controls whether it is permitted to attempt to resize the remote framebuffer
to match the local window size. This currently defaults to on, but note that
not all servers will support this.
=item -t TITLE, --title TITLE
Set the window title to B<TITLE>
=item -s, --shared
Permitted a shared session with multiple clients
=item --cursor auto|local
Control how the mouse cursor is rendered. C<auto> is the default behaviour,
which will honour the behaviour requested by the remote server. This may
involve the server remote rendering the cursor into the framebuffer, or
sending the cursor details to the client to render. C<local> overrides
this default to request that the local desktop cursor is always rendered
regardless of what the server requests. The latter is rarely needed, but
can be used if the server has a bad configuration that results in its
own cursor being hidden.
=item --debug
Print debugging information
=item -H HOTKEYS, --hotkeys HOTKEYS
Set global hotkey bindings. By default, keyboard shortcuts only work when the
guest display widget does not have focus. Any actions specified in B<HOTKEYS>
will be effective even when the guest display widget has input focus. The format
for B<HOTKEYS> is <action1>=<key1>[+<key2>][,<action2>=<key3>[+<key4>]].
Key-names are case-insensitive. Valid actions are: toggle-fullscreen,
release-cursor, zoom-in, zoom-out, zoom-reset,
secure-attention, usb-device-reset, smartcard-insert and
smartcard-remove. The C<secure-attention> action sends a secure attention
sequence (Ctrl+Alt+Del) to the guest. Examples:
--hotkeys=toggle-fullscreen=shift+f11,release-cursor=shift+f12
--hotkeys=release-cursor=ctrl+alt
Note that hotkeys for which no binding is given are disabled. Although the
hotkeys specified here are handled by the client, it is still possible to send
these key combinations to the guest via a menu item.
=item -K, --keymap
Remap and/or block supplied keypresses to the host. All key identifiers are
case-sensitive and follow the naming convention as defined in gdkkeysyms.h
without the GDK_KEY_ prefix.
Running the application with --debug will display keypress symbols in the
following way:
"Key pressed was keycode='0x63', gdk_keyname='c'"
"Key pressed was keycode='0xffeb', gdk_keyname='Super_L'"
The format for supplying a keymap is:
<srcKeySym1>=[<destKeySym1>][+<destKeySym2][,<srckeySym2>=[<destKeySym1]
To block a keypress simply assign an empty parameter to the srcKeySym.
Example:
--keymap=Super_L=,Alt_L=,1=Shift_L+F1,2=Shift_L+F2
This will block the Super_L (typically Windows Key) and ALT_L keypresses
and remap key 1 to Shift F1, 2 to Shift F2.
=item -k, --kiosk
Start in kiosk mode. In this mode, the application will start in
fullscreen with minimal UI. It will prevent the user from quitting or
performing any interaction outside of usage of the remote desktop
session.
Note that it can't offer a complete secure solution by itself. Your
kiosk system must have additional configuration and security settings
to lock down the OS. In particular, you must configure or disable the
window manager, limit the session capabilities, use some
restart/watchdog mechanism, disable VT switching etc.
=item --kiosk-quit <never|on-disconnect>
By default, when kiosk mode is enabled, virt-viewer will remain open
when the connection to the remote server is terminated. By setting
kiosk-quit option to "on-disconnect" value, virt-viewer will quit
instead.
=back
=head1 HOTKEY
A key binding combination is described by a series of key strings
separated by '+' that must be pressed together in order to activate
the associated action.
It must be composed of modifiers (shift, ctrl or alt) and a
non-modifier key. For example, "shift+f11".
=head1 CONNECTION FILE
B<remote-viewer> connection file is of INI file format, with a
mandatory [virt-viewer] group and "type" key.
=head2 Example
Opening a file with the following content will start remote-viewer in
fullscreen and connect to the host "betsiboka" using the SPICE
protocol:
[virt-viewer]
type=spice
host=betsiboka
port=5900
fullscreen=1
=head2 Key list
=over 4
=item C<version> (string)
If remote-viewer version number isn't greater or equal to the required
version, an error is raised with the expected version.
The version format accepted is a list of integers separated by '.'. It can
be followed by a dash '-' and an additional build number with the same format.
Version comparison is done by comparing each integer from the list one by
one. If any of the component is not a number, the version comparison will fail
and consider that the 2 versions are considered to be the same.
=item C<versions> (osid:version list)
This is a list of osid:version couples separated by ';'. osid is an arbitrary string, version is
a version number in the same format as in the 'version' field. A given couple indicates that
remote-viewer builds matching the given 'osid' (fedora22, debian7, ...) must
be at least version 'version'. For consistency, it's recommended to use libosinfo OS shortids as
the osid.
=item C<newer-version-url> (string)
If specified, this field is an URL which will be displayed to the user when a version check
fails.
=item C<type> (string, mandatory)
The session type, either "spice", "vnc" or "ovirt".
=item C<unix-path> (string)
The server to connect to, using a Unix socket path. (supported with spice, since 8.0)
This option is incompatible with C<host>, C<port> and C<tls-port>.
=item C<host> (string)
The server host to connect to.
=item C<port> (integer)
The server port to connect to.
=item C<tls-port> (integer)
The server TLS/SSL port to connect to.
=item C<username> (string)
The username for the session authentication.
=item C<password> (string)
The password for the session authentication.
=item C<disable-channels> (string list)
The list of session channels to disable.
The current SPICE channels are: main, display, inputs, cursor, playback, record, smartcard, usbredir.
=item C<tls-ciphers> (string)
Set the cipher list to use for the secure connection, in textual
OpenSSL cipher list format. (see ciphers(1))
=item C<title> (string)
String to present in the window title.
=item C<fullscreen> (boolean)
Opens the client windows in fullscreen.
=item C<ca> (string)
CA certificate in PEM format (using "\n" to separate the lines). This will be
used to verify the SSL certificate used for SPICE TLS sessions.
=item C<host-subject> (string)
Verify the certificate subject matches with the given subject.
=item C<toggle-fullscreen> (hotkey string)
Key binding for entering and leaving fullscreen mode. (see L<HOTKEY> for description of expected string)
=item C<release-cursor> (hotkey string)
Key binding for releasing cursor grab. (see L<HOTKEY> for description of expected string)
=item C<zoom-in> (hotkey string)
Key binding for zooming in and enlarging client window size. (see L<HOTKEY> for description of expected string)
=item C<zoom-out> (hotkey string)
Key binding for zooming out and reducing client window size. (see L<HOTKEY> for description of expected string)
=item C<zoom-reset> (hotkey string)
Key binding for resetting zoom and client window size. (see L<HOTKEY> for description of expected string)
=item C<smartcard-insert> (hotkey string)
Key binding for inserting emulated smartcard. (see L<HOTKEY> for description of expected string)
=item C<smartcard-remove> (hotkey string)
Key binding for removing emulated smartcard. (see L<HOTKEY> for description of expected string)
=item C<color-depth> (integer)
Set the color depth of the guest display (16 or 32).
=item C<disable-effects> (string list)
A list of desktop effects to disable in the remote guest.
The effects that can be disabled with SPICE are: wallpaper,
font-smooth, animation or all.
=item C<enable-smartcard> (boolean)
Set to 1 to enable client smartcard redirection.
=item C<enable-usbredir> (boolean)
Set to 1 to enable client USB device redirection.
=item C<enable-usb-autoshare> (boolean)
Set to 1 to enable client USB devices auto-sharing.
=item C<usb-filter> (string)
Set a string specifying a filter to use to determine which USB devices
to autoconnect when plugged in, a filter consists of one or more
rules. Where each rule has the form of:
C<class,vendor,product,version,allow>
Use -1 for class/vendor/product/version to accept any value.
And the rules themselves are concatenated like this:
C<rule1|rule2|rule3>
=item C<usb-redirect-on-connect> (string)
Set a string specifying a filter to determine which USB devices, that are already plugged in,
to redirect on connect once Spice connection is established. See usb-filter for the format.
=item C<secure-channels> (string list)
The list of session channels to secure.
The current SPICE channels are: main, display, inputs, cursor, playback, record, smartcard, usbredir.
=item C<delete-this-file> (boolean)
Set to 1 for the client to remove this connection file (if it can't, it will fail silently)
=item C<proxy> (string)
A proxy URL to tunnel the connection through.
At the time of writing this documentation, the only supported proxy
method with Spice is HTTP CONNECT.
For example, to tunnel connection through foobar host HTTP proxy on
port 8080, use the value "http://foobar:8080".
=back
=head2 oVirt Support
The connection file can also carry some oVirt-specific options when oVirt
support is compiled in. These options are used to interact with oVirt REST API.
This is currently only used in order to show a menu allowing to change the CD
image being used by the virtual machine from remote-viewer user interface.
These options go in an optional [ovirt] group.
=over 4
=item C<host> (string, mandatory)
The oVirt instance to connect to. This corresponds to the hostname one would
connect to access the oVirt user or admin portal.
=item C<vm-guid> (string, mandatory)
GUID of the oVirt virtual machine to connect to.
=item C<jsessionid> (string)
Value to set the 'jsessionid' cookie to. With oVirt 3.6, setting this
authentication cookie to a valid value will allow one to interact with the oVirt
REST API without being asked for credentials.
=item C<sso-token> (string)
Value to set the 'Authorization' header to. With oVirt 4.0 or newer, setting
this authentication header to a valid value will allow one to interact with the
oVirt REST API without being asked for credentials.
=item C<ca> (string)
CA certificate in PEM format (using "\n" to separate the lines). This will be used to validate
the certificate used for the oVirt REST https session remote-viewer will establish.
=back
=head1 CONFIGURATION
A small number of configuration options can be controlled by editing the
settings file located in the user configuration directory:
<USER-CONFIG-DIR>/virt-viewer/settings
This file is a text file in INI format, with application options in the
[virt-viewer] group and per-guest options in a group identified by the guest's
UUID. The application options should not be edited manually. There is also a
special [fallback] group which specifies options for all guests that don't have
an explicit group.
For each guest, the initial fullscreen monitor configuration can be specified
by using the B<monitor-mapping> key. This configuration only takes effect when
the -f/--full-screen option is specified.
The value of this key is a list of mappings between a guest display and a
client monitor. Each mapping is separated by a semicolon character, and the
mappings have the format <GUEST-DISPLAY-ID>:<CLIENT-MONITOR-ID>.
For example, to map guest displays 1 and 2 to client monitors 2 and 3 for the
guest with a UUID of e4591275-d9d3-4a44-a18b-ef2fbc8ac3e2, use:
[e4591275-d9d3-4a44-a18b-ef2fbc8ac3e2]
monitor-mapping=1:2;2:3
The monitor-mapping must contain ids of all displays from 1 to the last
desired display id, e.g. "monitor-mapping=3:3" is invalid because mappings
for displays 1 and 2 are not specified.
Configuration key B<share-clipboard> contains a boolean value. If it's "true",
then clipboard is shared with guests if clipboard sharing is supported by used protocol.
=head1 EXAMPLES
To connect to SPICE server on host "makai" with port 5900
remote-viewer spice://makai:5900
To connect to VNC server on host "tsingy" with port 5900
remote-viewer vnc://tsingy:5900
To connect to a virtual machine named "toliara" on an oVirt server at
example.org
remote-viewer ovirt://[username@]example.org/toliara
=head1 BUGS
Report bugs to https://gitlab.com/virt-viewer/virt-viewer/-/issues
=head1 COPYRIGHT
Copyright (C) 2012-2020 Red Hat, Inc., and various contributors.
This is free software. You may redistribute copies of it under the terms of the GNU General
Public License C<https://www.gnu.org/licenses/gpl-2.0.html>. There is NO WARRANTY,
to the extent permitted by law.
=head1 SEE ALSO
C<virt-viewer(1)>, C<spice-client(1)>, the project website C<http://gitlab.com/virt-viewer/virt-viewer>
=cut

View File

@ -5,7 +5,7 @@ virt-viewer - display the graphical console for a virtual machine
=head1 SYNOPSIS
B<virt-viewer> [OPTIONS] DOMAIN-NAME|ID|UUID
B<virt-viewer> [OPTIONS] [ID|UUID|DOMAIN-NAME]
=head1 DESCRIPTION
@ -13,11 +13,15 @@ B<virt-viewer> is a minimal tool for displaying the graphical console
of a virtual machine. The console is accessed using the VNC or SPICE
protocol. The guest can be referred to based on its name, ID, or
UUID. If the guest is not already running, then the viewer can be told
to wait until is starts before attempting to connect to the console
to wait until it starts before attempting to connect to the console.
The viewer can connect to remote hosts to lookup the console
information and then also connect to the remote console using the same
network transport.
In some circumstances the viewer may need to grab the mouse pointer. The
default key sequence for releasing the grab is C<Ctrl_L>+C<Alt_L>, however,
this can be overridden using the C<--hotkeys> argument documented below.
=head1 OPTIONS
The following options are accepted when running C<virt-viewer>:
@ -50,29 +54,179 @@ Automatically reconnect to the domain if it shuts down and restarts
=item -z PCT, --zoom=PCT
Zoom level of the display window in percentage. Range 10-200.
Zoom level of the display window in percentage. Range 10-400.
=item -d, --direct
Do not attempt to tunnel the console over SSH, even if the main connection URI
used SSH.
=item -f, --fullscreen
=item -a, --attach
Instead of making a direct TCP/UNIX socket connection to the remote display,
ask libvirt to provide a pre-connected socket for the display. This avoids
the need to authenticate with the remote display server directly. This option
will only work when connecting to a guest that is running on the same host
as the virt-viewer program. If attaching to the guest via libvirt fails,
virt-viewer will automatically fallback to trying a regular direct TCP/UNIX
socket connection.
=item -f, --full-screen
Start with the window maximised to fullscreen
If supported, the remote display will be reconfigured to match the physical
client monitor configuration, by enabling or disabling extra monitors as
necessary. This is currently implemented by the Spice backend only.
To specify which client monitors are used in fullscreen mode, see the
CONFIGURATION section below.
=item --auto-resize <always|never>
Controls whether it is permitted to attempt to resize the remote framebuffer
to match the local window size. This currently defaults to on, but note that
not all servers will support this.
=item -s, --shared
Permitted a shared session with multiple clients
=item --cursor auto|local
Control how the mouse cursor is rendered. C<auto> is the default behaviour,
which will honour the behaviour requested by the remote server. This may
involve the server remote rendering the cursor into the framebuffer, or
sending the cursor details to the client to render. C<local> overrides
this default to request that the local desktop cursor is always rendered
regardless of what the server requests. The latter is rarely needed, but
can be used if the server has a bad configuration that results in its
own cursor being hidden.
=item --debug
Print debugging information
=item -H HOTKEYS, --hotkeys HOTKEYS
Set global hotkey bindings. By default, keyboard shortcuts only work when the
guest display widget does not have focus. Any actions specified in B<HOTKEYS>
will be effective even when the guest display widget has input focus. The format
for B<HOTKEYS> is <action1>=<key1>[+<key2>][,<action2>=<key3>[+<key4>]].
Key-names are case-insensitive. Valid actions are: toggle-fullscreen,
release-cursor, zoom-in, zoom-out, zoom-reset,
secure-attention, usb-device-reset, smartcard-insert and
smartcard-remove. The C<secure-attention> action sends a secure attention
sequence (Ctrl+Alt+Del) to the guest. Examples:
--hotkeys=toggle-fullscreen=shift+f11,release-cursor=shift+f12
--hotkeys=release-cursor=ctrl+alt
Note that hotkeys for which no binding is given are disabled. Although the
hotkeys specified here are handled by the client, it is still possible to send
these key combinations to the guest via a menu item.
=item -K, --keymap
Remap and/or block supplied keypresses to the host. All key identifiers are
case-sensitive and follow the naming convention as defined in gdkkeysyms.h
without the GDK_KEY_ prefix.
Running the application with --debug will display keypress symbols in the
following way:
"Key pressed was keycode='0x63', gdk_keyname='c'"
"Key pressed was keycode='0xffeb', gdk_keyname='Super_L'"
The format for supplying a keymap is:
<srcKeySym1>=[<destKeySym1>][+<destKeySym2][,<srckeySym2>=[<destKeySym1]
To block a keypress simply assign an empty parameter to the srcKeySym.
Example:
--keymap=Super_L=,Alt_L=,1=Shift_L+F1,2=Shift_L+F2
This will block the Super_L (typically Windows Key) and ALT_L keypresses
and remap key 1 to Shift F1, 2 to Shift F2.
=item -k, --kiosk
Start in kiosk mode. In this mode, the application will start in
fullscreen with minimal UI. It will prevent the user from quitting or
performing any interaction outside of usage of the remote desktop
session.
Note that it can't offer a complete secure solution by itself. Your
kiosk system must have additional configuration and security settings
to lock down the OS. In particular, you must configure or disable the
window manager, limit the session capabilities, use some
restart/watchdog mechanism, disable VT switching etc.
=item --kiosk-quit <never|on-disconnect>
By default, when kiosk mode is enabled, virt-viewer will remain open
when the connection to the remote server is terminated. By setting
kiosk-quit option to "on-disconnect" value, virt-viewer will quit
instead. Please note that --reconnect takes precedence over this
option, and will attempt to do a reconnection before it quits.
=item --id, --uuid, --domain-name
Connect to the virtual machine by its id, uuid or name. These options
are mutual exclusive. For example the following command may sometimes
connect to a virtual machine with the id 2 or with the name 2 (depending
on the number of running machines):
virt-viewer 2
To always connect to the virtual machine with the name "2" use the
"--domain-name" option:
virt-viewer --domain-name 2
=back
=head1 CONFIGURATION
A small number of configuration options can be controlled by editing the
settings file located in the user configuration directory:
<USER-CONFIG-DIR>/virt-viewer/settings
This file is a text file in INI format, with application options in the
[virt-viewer] group and per-guest options in a group identified by the guest's
UUID. The application options should not be edited manually. There is also a
special [fallback] group which specifies options for all guests that don't have
an explicit group.
For each guest, the initial fullscreen monitor configuration can be specified
by using the B<monitor-mapping> key. This configuration only takes effect when
the -f/--full-screen option is specified.
The value of this key is a list of mappings between a guest display and a
client monitor. Each mapping is separated by a semicolon character, and the
mappings have the format <GUEST-DISPLAY-ID>:<CLIENT-MONITOR-ID>.
For example, to map guest displays 1 and 2 to client monitors 2 and 3 for the
guest with a UUID of e4591275-d9d3-4a44-a18b-ef2fbc8ac3e2, use:
[e4591275-d9d3-4a44-a18b-ef2fbc8ac3e2]
monitor-mapping=1:2;2:3
The monitor-mapping must contain ids of all displays from 1 to the last
desired display id, e.g. "monitor-mapping=3:3" is invalid because mappings
for displays 1 and 2 are not specified.
=head1 EXAMPLES
To connect to the guest called 'demo' running under Xen
virt-viewer demo
To use GUI for connecting to a guest running under QEMU
virt-viewer --connect qemu:///system
To connect to the guest with ID 7 running under QEMU
virt-viewer --connect qemu:///system 7
@ -86,6 +240,15 @@ To connect to a remote console using TLS
virt-viewer --connect xen://example.org/ demo
To connect to a remote host using SSH, lookup the guest config and
then make a tunnelled connection of the console
virt-viewer --connect qemu+ssh://root@example.org/system demo
When using a SSH tunnel to connect to a SPICE console, it's recommended to
have ssh-agent running to avoid getting multiple authentication prompts.
To connect to a remote host using SSH, lookup the guest config and
then make a direct non-tunnelled connection of the console
@ -97,18 +260,17 @@ Written by Daniel P. Berrange, based on the GTK-VNC example program gvncviewer.
=head1 BUGS
Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/et-mgmt-tools>
Report bugs to https://gitlab.com/virt-viewer/virt-viewer/-/issues
=head1 COPYRIGHT
Copyright (C) 2007-2008 Red Hat, Inc, and various contributors.
Copyright (C) 2007-2020 Red Hat, Inc., and various contributors.
This is free software. You may redistribute copies of it under the terms of the GNU General
Public License C<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent
permitted by law.
Public License C<https://www.gnu.org/licenses/gpl-2.0.html>. There is NO WARRANTY,
to the extent permitted by law.
=head1 SEE ALSO
C<virsh(1)>, C<virt-manager(1)>, the project website C<http://virt-manager.org>
C<virsh(1)>, C<virt-manager(1)>, C<spice-client(1)>, the project website C<http://gitlab.com/virt-viewer/virt-viewer>
=cut

592
meson.build Normal file
View File

@ -0,0 +1,592 @@
project(
'virt-viewer','c',
version: '11.0',
license: 'GPLv3+',
default_options: [
'buildtype=debugoptimized',
'b_pie=true',
'c_std=gnu99',
'warning_level=1',
],
meson_version: '>= 0.56.0'
)
pod2man = find_program('pod2man')
cc = meson.get_compiler('c')
python3 = find_program('python3', required: true)
# Python3 < 3.7 treats the C locale as 7-bit only. We must force env vars so
# it treats it as UTF-8 regardless of the user's locale.
runutf8 = [ 'LC_ALL=', 'LANG=C', 'LC_CTYPE=en_US.UTF-8' ]
git = run_command('test', '-d', '.git', check: false).returncode() == 0
conf_data = configuration_data()
conf_data.set('VERSION', meson.project_version())
conf_data.set('PACKAGE_STRING', 'virt-viewer ' + meson.project_version())
# Keep these two definitions in agreement.
glib_min_version='>=2.48'
glib_min_version_symbol='GLIB_VERSION_2_48'
# Keep these two definitions in agreement.
gtk_min_version='>=3.18'
gtk_min_version_symbol='GDK_VERSION_3_18'
libxml_min_version='>=2.6.0'
libvirt_min_version='>=1.2.8'
libvirt_glib_min_version='>=0.1.8'
gtk_vnc_min_version='>=0.4.0'
spice_gtk_min_version='>=0.35'
spice_protocol_min_version='>=0.12.7'
govirt_min_version='>=0.3.7'
govirt_max_version='>=0.3.9'
rest_min_version='>=0.8'
vte_min_version='>=0.46.0'
bash_completion_version='2.0'
add_global_arguments('-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_min_version_symbol), language: 'c')
add_global_arguments('-DGLIB_VERSION_MAX_ALLOWED=@0@'.format(glib_min_version_symbol), language: 'c')
add_global_arguments('-DGDK_VERSION_MIN_REQUIRED=@0@'.format(gtk_min_version_symbol), language: 'c')
add_global_arguments('-DGDK_VERSION_MAX_ALLOWED=@0@'.format(gtk_min_version_symbol), language: 'c')
cc_flags = []
git_werror = get_option('git_werror')
if git_werror.enabled() or git_werror.auto() and git
cc_flags += [ '-Werror' ]
endif
cc_flags += [
'-fno-common',
'-W',
'-Wabsolute-value',
'-Waddress',
'-Waddress-of-packed-member',
'-Waggressive-loop-optimizations',
'-Wall',
'-Wattribute-warning',
'-Wattributes',
'-Wbool-compare',
'-Wbool-operation',
'-Wbuiltin-declaration-mismatch',
'-Wbuiltin-macro-redefined',
'-Wcannot-profile',
'-Wcast-align',
'-Wcast-align=strict',
'-Wcast-function-type',
'-Wchar-subscripts',
'-Wclobbered',
'-Wcomment',
'-Wcomments',
'-Wcoverage-mismatch',
'-Wcpp',
'-Wdangling-else',
'-Wdate-time',
'-Wdeprecated-declarations',
'-Wdesignated-init',
'-Wdouble-promotion',
'-Wdiscarded-array-qualifiers',
'-Wdiscarded-qualifiers',
'-Wdiv-by-zero',
'-Wduplicated-cond',
'-Wduplicate-decl-specifier',
'-Wempty-body',
'-Wendif-labels',
'-Wexpansion-to-defined',
'-Wextra',
'-Wformat-contains-nul',
'-Wformat-extra-args',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wformat-y2k',
'-Wformat-zero-length',
'-Wframe-address',
'-Wfree-nonheap-object',
'-Whsa',
'-Wif-not-aligned',
'-Wignored-attributes',
'-Wignored-qualifiers',
'-Wimplicit',
'-Wimplicit-function-declaration',
'-Wimplicit-int',
'-Wincompatible-pointer-types',
'-Winit-self',
'-Winline',
'-Wint-conversion',
'-Wint-in-bool-context',
'-Wint-to-pointer-cast',
'-Winvalid-memory-model',
'-Winvalid-pch',
'-Wlogical-not-parentheses',
'-Wlogical-op',
'-Wmain',
'-Wmaybe-uninitialized',
'-Wmemset-elt-size',
'-Wmemset-transposed-args',
'-Wmisleading-indentation',
'-Wmissing-attributes',
'-Wmissing-braces',
'-Wmissing-declarations',
'-Wmissing-field-initializers',
'-Wmissing-include-dirs',
'-Wmissing-parameter-type',
'-Wmissing-profile',
'-Wmissing-prototypes',
'-Wmultichar',
'-Wmultistatement-macros',
'-Wnarrowing',
'-Wnested-externs',
'-Wnonnull',
'-Wnonnull-compare',
'-Wnull-dereference',
'-Wodr',
'-Wold-style-declaration',
'-Wold-style-definition',
'-Wopenmp-simd',
'-Woverflow',
'-Woverride-init',
'-Wpacked-bitfield-compat',
'-Wpacked-not-aligned',
'-Wparentheses',
'-Wpointer-arith',
'-Wpointer-compare',
'-Wpointer-sign',
'-Wpointer-to-int-cast',
'-Wpragmas',
'-Wpsabi',
'-Wrestrict',
'-Wreturn-local-addr',
'-Wreturn-type',
'-Wscalar-storage-order',
'-Wsequence-point',
'-Wshadow',
'-Wshift-count-negative',
'-Wshift-count-overflow',
'-Wshift-negative-value',
'-Wsizeof-array-argument',
'-Wsizeof-pointer-div',
'-Wsizeof-pointer-memaccess',
'-Wstrict-aliasing',
'-Wstrict-prototypes',
'-Wstringop-truncation',
'-Wsuggest-attribute=cold',
'-Wsuggest-attribute=const',
'-Wsuggest-attribute=format',
'-Wsuggest-attribute=noreturn',
'-Wsuggest-attribute=pure',
'-Wsuggest-final-methods',
'-Wsuggest-final-types',
'-Wswitch',
'-Wswitch-bool',
'-Wswitch-unreachable',
'-Wsync-nand',
'-Wtautological-compare',
'-Wtrampolines',
'-Wtrigraphs',
'-Wtype-limits',
'-Wuninitialized',
'-Wunknown-pragmas',
'-Wunused',
'-Wunused-but-set-parameter',
'-Wunused-but-set-variable',
'-Wunused-function',
'-Wunused-label',
'-Wunused-local-typedefs',
'-Wunused-parameter',
'-Wunused-result',
'-Wunused-value',
'-Wunused-variable',
'-Wvarargs',
'-Wvariadic-macros',
'-Wvector-operation-performance',
'-Wvla',
'-Wvolatile-register-var',
'-Wwrite-strings',
]
# gcc --help=warnings outputs
ptrdiff_max = cc.sizeof('ptrdiff_t', prefix: '#include <stddef.h>')
size_max = cc.sizeof('size_t', prefix: '#include <stdint.h>')
# Compute max safe object size by checking ptrdiff_t and size_t sizes.
# Ideally we would get PTRDIFF_MAX and SIZE_MAX values but it would
# give us (2147483647L) and we would have to remove the () and the suffix
# in order to convert it to numbers to be able to pick the smaller one.
alloc_max = run_command(
'python3', '-c',
'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max, size_max),
check: true,
)
cc_flags += [
'-Walloc-size-larger-than=@0@'.format(alloc_max.stdout().strip()),
'-Warray-bounds=2',
'-Wattribute-alias=2',
'-Wformat-overflow=2',
'-Wformat-truncation=2',
'-Wimplicit-fallthrough=5',
'-Wnormalized=nfc',
'-Wshift-overflow=2',
'-Wstringop-overflow=2',
'-Wunused-const-variable=2',
'-Wvla-larger-then=4031',
]
cc_flags += [
# So we have -W enabled, and then have to explicitly turn off...
'-Wno-sign-compare',
# We do "bad" function casts all the time for event callbacks
'-Wno-cast-function-type',
# Clang incorrectly complains about dup typedefs win gnu99 mode
# so use this Clang-specific arg to keep it quiet
'-Wno-typedef-redefinition',
# We don't use -Wc++-compat so we have to enable it explicitly
'-Wjump-misses-init',
# -Wswitch is enabled but that doesn't report missing enums if a default:
# is present
'-Wswitch-enum',
# -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it
'-Wno-format-nonliteral',
# -Wformat enables this by default, and we should keep it,
# but need to rewrite various areas of code first
'-Wno-format-truncation',
# This should be < 256 really. Currently we're down to 4096,
# but using 1024 bytes sized buffers (mostly for virStrerror)
# stops us from going down further
'-Wframe-larger-than=4096',
# extra special flags
'-fexceptions',
'-fasynchronous-unwind-tables',
# Need -fipa-pure-const in order to make -Wsuggest-attribute=pure
# fire even without -O.
'-fipa-pure-const',
# We should eventually enable this, but right now there are at
# least 75 functions triggering warnings.
'-Wno-suggest-attribute=pure',
'-Wno-suggest-attribute=const',
]
# on aarch64 error: -fstack-protector not supported for this target
if host_machine.cpu_family() != 'aarch64'
if host_machine.system() in [ 'linux', 'freebsd', 'windows' ]
# we prefer -fstack-protector-strong but fallback to -fstack-protector-all
fstack_cflags = cc.first_supported_argument([
'-fstack-protector-strong',
'-fstack-protector-all',
])
cc_flags += fstack_cflags
# When building with mingw using -fstack-protector requires libssp library
# which is included by using -fstack-protector with linker.
if fstack_cflags.length() == 1 and host_machine.system() == 'windows'
add_project_link_arguments(fstack_cflags, language: 'c')
endif
endif
endif
# Clang complains about unused static inline functions which are common
# with G_DEFINE_AUTOPTR_CLEANUP_FUNC.
w_unused_function_args = ['-Wunused-function', '-Werror']
w_unused_function_code = '''
static inline void foo(void) {}
int main(void) { return 0; }
'''
# -Wunused-function is implied by -Wall, we must turn it off explicitly.
if not cc.compiles(w_unused_function_code, args: w_unused_function_args)
cc_flags += ['-Wno-unused-function']
endif
cc_flags_disabled = [
# In meson this is specified using 'c_std=gnu99' in project() function.
'-std=gnu99',
# don't care about C++ compiler compat
'-Wc++-compat',
'-Wabi',
'-Wdeprecated',
# Don't care about ancient C standard compat
'-Wtraditional',
'-Wtraditional-conversion',
# Ignore warnings in /usr/include
'-Wsystem-headers',
# Happy for compiler to add struct padding
'-Wpadded',
# GCC very confused with -O2
'-Wunreachable-code',
# Too many to deal with
'-Wconversion',
'-Wsign-conversion',
# Need to allow bad cast for execve()
'-Wcast-qual',
# We need to use long long in many places
'-Wlong-long',
# We allow manual list of all enum cases without default
'-Wswitch-default',
# Not a problem since we don't use -fstrict-overflow
'-Wstrict-overflow',
# Not a problem since we don't use -funsafe-loop-optimizations
'-Wunsafe-loop-optimizations',
# gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall
'-Wenum-compare',
# gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time
'-Wformat-signedness',
# Several conditionals expand the same on both branches depending on the
# particular platform/architecture
'-Wduplicated-branches',
# > This warning does not generally indicate that there is anything wrong
# > with your code; it merely indicates that GCC's optimizers are unable
# > to handle the code effectively.
# Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
'-Wdisabled-optimization',
# Various valid glib APIs/macros trigger this warning
'-Wbad-function-cast',
# We might fundamentally need some of these disabled forever, but
# ideally we'd turn many of them on
'-Wfloat-equal',
'-Wpacked',
'-Wunused-macros',
'-Woverlength-strings',
'-Wstack-protector',
'-Wsuggest-attribute=malloc',
# g_return_val_if_fail usage violates this often
'-Wdeclaration-after-statement',
]
foreach flag : cc_flags_disabled
if cc_flags.contains(flag)
error('@0@ is disabled but listed in cc_flags'.format(flag))
endif
endforeach
supported_cc_flags = cc.get_supported_arguments(cc_flags)
add_project_arguments(supported_cc_flags, language: 'c')
prefix = get_option('prefix')
localedir = join_paths(prefix, get_option('localedir'))
datadir = join_paths(prefix, get_option('datadir'))
mandir = join_paths(prefix, get_option('mandir'))
add_global_arguments('-DLOCALE_DIR="@0@"'.format(localedir), language: 'c')
libm_dep = cc.find_library('m', required : true)
glib_dep = dependency('glib-2.0', version: glib_min_version)
gmodule_dep = dependency('gmodule-2.0', version: glib_min_version)
gtk_dep = dependency('gtk+-3.0', version: gtk_min_version)
libxml_dep = dependency('libxml-2.0', version: libxml_min_version)
libvirt_dep = dependency('libvirt', version: libvirt_min_version, required: get_option('libvirt'))
libvirt_glib_dep = dependency('libvirt-glib-1.0', version: libvirt_glib_min_version, required: get_option('libvirt'))
if get_option('libvirt').auto()
if libvirt_dep.found() and not libvirt_glib_dep.found()
libvirt_dep = dependency('', required: false)
endif
if not libvirt_dep.found() and libvirt_glib_dep.found()
libvirt_glib_dep = dependency('', required: false)
endif
endif
if libvirt_dep.found()
conf_data.set('HAVE_LIBVIRT', '1')
endif
gtk_vnc_dep = dependency('gtk-vnc-2.0', version: gtk_vnc_min_version, required: get_option('vnc'))
if gtk_vnc_dep.found()
conf_data.set('HAVE_GTK_VNC', '1')
endif
spice_glib_dep = dependency('spice-client-glib-2.0', version: spice_gtk_min_version, required: get_option('spice'))
spice_gtk_dep = dependency('spice-client-gtk-3.0', version: spice_gtk_min_version, required: get_option('spice'))
spice_protocol_dep = dependency('spice-protocol', version: spice_protocol_min_version, required: get_option('spice'))
if get_option('spice').auto()
if not spice_protocol_dep.found() or not spice_gtk_dep.found() or not spice_glib_dep.found()
spice_protocol_dep = dependency('', required: false)
spice_glib_dep = dependency('', required: false)
spice_gtk_dep = dependency('', required: false)
endif
endif
if spice_gtk_dep.found()
conf_data.set('HAVE_SPICE_GTK', '1')
endif
govirt_dep = dependency('govirt-1.0', version: govirt_min_version, required: get_option('ovirt'))
rest_dep = dependency('rest-0.7', version: rest_min_version, required: get_option('ovirt'))
if get_option('ovirt').auto()
if govirt_dep.found() and not rest_dep.found()
govirt_dep = dependency('', required: false)
endif
if not govirt_dep.found() and rest_dep.found()
rest_dep = dependency('', required: false)
endif
endif
if govirt_dep.found()
new_govirt_dep = dependency('govirt-1.0', version: govirt_max_version, required: false)
if new_govirt_dep.found()
if get_option('ovirt').auto()
govirt_dep = dependency('', required: false)
else
error('libgovirt >= 0.3.9 (with librest-1.0) not supported')
endif
endif
endif
if govirt_dep.found()
if cc.has_function('ovirt_storage_domain_get_disks', dependencies: govirt_dep)
conf_data.set('HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS', '1')
endif
conf_data.set('HAVE_OVIRT', '1')
endif
vte_dep = dependency('vte-2.91', version: vte_min_version, required: get_option('vte'))
if vte_dep.found()
conf_data.set('HAVE_VTE', '1')
endif
bash_completion_dep = dependency('bash-completion', version: '>=' + bash_completion_version, required: get_option('bash_completion'))
if bash_completion_dep.found()
bash_completion_dir = get_option('bash_completion_dir')
if bash_completion_dir == ''
bash_completion_dir = bash_completion_dep.get_variable(pkgconfig: 'completionsdir')
bash_completion_prefix = bash_completion_dep.get_variable(pkgconfig: 'prefix')
rc = run_command(
'python3', '-c',
'print("@0@".replace("@1@", "@2@"))'.format(
bash_completion_dir, bash_completion_prefix, prefix,
),
check: true,
)
bash_completion_dir = rc.stdout().strip()
endif
endif
id = get_option('build-id')
if id != ''
conf_data.set('BUILDID', '-@0@'.format(id))
else
conf_data.set('BUILDID', '')
endif
osid = get_option('os-id')
if osid != ''
conf_data.set('REMOTE_VIEWER_OS_ID', '"' + osid + '"')
endif
arr_version = meson.project_version().split('.')
conf_data.set('WINDOWS_PRODUCTVERSION', '@0@.@1@.@2@'.format(
arr_version[0],
arr_version[1],
get_option('build-id')))
if host_machine.system() == 'windows'
if host_machine.cpu() != 'x86_64'
wixl_arch = 'x86'
else
wixl_arch = 'x64'
endif
conf_data.set('WIXL_ARCH', wixl_arch)
endif
configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: conf_data
)
subdir('build-aux')
if git
authors = run_command(python3.full_path(), gen_authors_prog.full_path(), env: runutf8, check: true)
authors_file = 'AUTHORS.in'
authors_conf = configuration_data()
authors_conf.set('authorslist', authors.stdout())
configure_file(
input: authors_file,
output: '@BASENAME@',
configuration: authors_conf,
)
configure_file(
input: 'virt-viewer.spec.in',
output: 'virt-viewer.spec',
configuration: conf_data
)
configure_file(
input: 'mingw-virt-viewer.spec.in',
output: 'mingw-virt-viewer.spec',
configuration: conf_data
)
meson.add_dist_script(python3.full_path(), dist_prog.full_path(), meson.project_build_root(), 'AUTHORS')
meson.add_dist_script(python3.full_path(), dist_prog.full_path(), meson.project_build_root(), 'virt-viewer.spec')
endif
gnome = import('gnome')
i18n = import('i18n')
i18n_itsdir = join_paths(meson.project_source_root(), 'data', 'gettext')
top_include_dir = [include_directories('.')]
update_mime_database = find_program('update-mime-database', required: false)
update_icon_cache = find_program('gtk-update-icon-cache', required: false)
update_desktop_database = find_program('update-desktop-database', required: false)
update_mime_database_path = ''
if update_mime_database.found()
update_mime_database_path = update_mime_database.full_path()
endif
update_icon_cache_path = ''
if update_icon_cache.found()
update_icon_cache_path = update_icon_cache.full_path()
endif
update_desktop_database_path = ''
if update_desktop_database.found()
update_desktop_database_path = update_desktop_database.full_path()
endif
meson.add_install_script('build-aux/post_install.py',
update_mime_database_path,
update_icon_cache_path,
update_desktop_database_path)
subdir('icons')
subdir('src')
subdir('po')
subdir('man')
subdir('tests')
if bash_completion_dep.found()
subdir('bash-completion')
endif
subdir('data')

Some files were not shown because too many files have changed in this diff Show More