import virt-viewer-9.0-9.el8
This commit is contained in:
parent
02e8d3b209
commit
28b75a4193
@ -0,0 +1,38 @@
|
|||||||
|
From 21b482e6b85df7dca46e1dc8501b0f28ce4570a1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||||
|
Date: Fri, 15 May 2020 10:24:08 -0300
|
||||||
|
Subject: [PATCH virt-viewer] 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>
|
||||||
|
---
|
||||||
|
src/ovirt-foreign-menu.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
|
||||||
|
index dc6ecf4..c31c93f 100644
|
||||||
|
--- a/src/ovirt-foreign-menu.c
|
||||||
|
+++ b/src/ovirt-foreign-menu.c
|
||||||
|
@@ -661,8 +661,8 @@ static gboolean storage_domain_validate(OvirtForeignMenu *menu G_GNUC_UNUSED,
|
||||||
|
|
||||||
|
g_object_get(domain, "name", &name, "type", &type, "state", &state, NULL);
|
||||||
|
|
||||||
|
- if (type != OVIRT_STORAGE_DOMAIN_TYPE_ISO) {
|
||||||
|
- g_debug("Storage domain '%s' type is not ISO", name);
|
||||||
|
+ if (type != OVIRT_STORAGE_DOMAIN_TYPE_ISO && type != OVIRT_STORAGE_DOMAIN_TYPE_DATA) {
|
||||||
|
+ g_debug("Storage domain '%s' type is not ISO or DATA", name);
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,103 @@
|
|||||||
|
From 0a16fd513034c2a1475ed84b38461faea7a12250 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||||
|
Date: Thu, 25 Jun 2020 21:19:32 -0300
|
||||||
|
Subject: [PATCH virt-viewer] 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>
|
||||||
|
---
|
||||||
|
configure.ac | 2 +-
|
||||||
|
src/ovirt-foreign-menu.c | 36 ++++++++++++++++++++++++++++++++++--
|
||||||
|
2 files changed, 35 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 9da056f..a313ce1 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -203,7 +203,7 @@ AS_IF([test "x$with_ovirt" = "xyes"],
|
||||||
|
SAVED_LIBS="$LIBS"
|
||||||
|
CFLAGS="$SAVED_CFLAGS $OVIRT_CFLAGS"
|
||||||
|
LIBS="$SAVED_LIBS $OVIRT_LIBS"
|
||||||
|
- AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center],
|
||||||
|
+ AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center ovirt_storage_domain_get_disks],
|
||||||
|
[AC_DEFINE([HAVE_OVIRT_DATA_CENTER], 1, [Have support for data center])],
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
|
||||||
|
index c31c93f..3c67f1a 100644
|
||||||
|
--- a/src/ovirt-foreign-menu.c
|
||||||
|
+++ b/src/ovirt-foreign-menu.c
|
||||||
|
@@ -481,6 +481,18 @@ static void ovirt_foreign_menu_set_files(OvirtForeignMenu *menu,
|
||||||
|
for (it = files; it != NULL; it = it->next) {
|
||||||
|
char *name;
|
||||||
|
g_object_get(it->data, "name", &name, NULL);
|
||||||
|
+
|
||||||
|
+#ifdef HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS
|
||||||
|
+ if (OVIRT_IS_DISK(it->data)) {
|
||||||
|
+ OvirtDiskContentType content_type;
|
||||||
|
+ g_object_get(it->data, "content-type", &content_type, NULL);
|
||||||
|
+ if (content_type != OVIRT_DISK_CONTENT_TYPE_ISO) {
|
||||||
|
+ g_debug("Ignoring %s disk which content-type is not ISO", name);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* The oVirt REST API is supposed to have a 'type' node
|
||||||
|
* associated with file resources , but as of 3.2, this node
|
||||||
|
* is not present, so we do an extension check instead
|
||||||
|
@@ -695,6 +707,26 @@ static gboolean ovirt_foreign_menu_set_file_collection(OvirtForeignMenu *menu, O
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static OvirtCollection *storage_domain_get_files(OvirtStorageDomain *domain)
|
||||||
|
+{
|
||||||
|
+ OvirtCollection *files = NULL;
|
||||||
|
+ OvirtStorageDomainType type;
|
||||||
|
+
|
||||||
|
+ if (domain == NULL)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ g_object_get(domain, "type", &type, NULL);
|
||||||
|
+
|
||||||
|
+ if (type == OVIRT_STORAGE_DOMAIN_TYPE_ISO)
|
||||||
|
+ files = ovirt_storage_domain_get_files(domain);
|
||||||
|
+#ifdef HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS
|
||||||
|
+ else if (type == OVIRT_STORAGE_DOMAIN_TYPE_DATA)
|
||||||
|
+ files = ovirt_storage_domain_get_disks(domain);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ return files;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMenu *menu, OvirtStorageDomain *domain)
|
||||||
|
{
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
@@ -716,7 +748,7 @@ static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMen
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
- ret = ovirt_foreign_menu_set_file_collection(menu, ovirt_storage_domain_get_files(OVIRT_STORAGE_DOMAIN(resource)));
|
||||||
|
+ ret = ovirt_foreign_menu_set_file_collection(menu, storage_domain_get_files(OVIRT_STORAGE_DOMAIN(resource)));
|
||||||
|
|
||||||
|
end:
|
||||||
|
g_clear_error(&error);
|
||||||
|
@@ -756,7 +788,7 @@ static void storage_domains_fetched_cb(GObject *source_object,
|
||||||
|
if (!domain_valid)
|
||||||
|
domain_valid = TRUE;
|
||||||
|
|
||||||
|
- file_collection = ovirt_storage_domain_get_files(domain);
|
||||||
|
+ file_collection = storage_domain_get_files(domain);
|
||||||
|
if (!ovirt_foreign_menu_set_file_collection(menu, file_collection)) {
|
||||||
|
/* Retry with toplevel storage domain */
|
||||||
|
if (!set_file_collection_from_toplevel_storage_domain(menu, domain))
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,99 @@
|
|||||||
|
From f5936a87795dfdefee10f87672abcf8f9175a7c9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||||
|
Date: Mon, 15 Jun 2020 20:53:18 -0300
|
||||||
|
Subject: [PATCH virt-viewer] 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>
|
||||||
|
---
|
||||||
|
src/ovirt-foreign-menu.c | 39 ++++++++++++++++++++++-----------------
|
||||||
|
1 file changed, 22 insertions(+), 17 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
|
||||||
|
index 3c67f1a..8d02a79 100644
|
||||||
|
--- a/src/ovirt-foreign-menu.c
|
||||||
|
+++ b/src/ovirt-foreign-menu.c
|
||||||
|
@@ -734,6 +734,9 @@ static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMen
|
||||||
|
OvirtResource *resource = NULL;
|
||||||
|
gchar *href = NULL, *id = NULL;
|
||||||
|
|
||||||
|
+ if (domain == NULL)
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
g_object_get(domain, "guid", &id, NULL);
|
||||||
|
href = g_strdup_printf("/ovirt-engine/api/storagedomains/%s", id);
|
||||||
|
resource = g_initable_new(OVIRT_TYPE_STORAGE_DOMAIN, NULL, &error, "guid", id, "href", href, NULL);
|
||||||
|
@@ -767,8 +770,8 @@ static void storage_domains_fetched_cb(GObject *source_object,
|
||||||
|
OvirtForeignMenu *menu = OVIRT_FOREIGN_MENU(g_task_get_source_object(task));
|
||||||
|
OvirtCollection *collection = OVIRT_COLLECTION(source_object);
|
||||||
|
GHashTableIter iter;
|
||||||
|
- OvirtStorageDomain *domain;
|
||||||
|
- gboolean domain_valid = FALSE;
|
||||||
|
+ OvirtStorageDomain *domain, *valid_domain = NULL;
|
||||||
|
+ OvirtCollection *file_collection;
|
||||||
|
|
||||||
|
ovirt_collection_fetch_finish(collection, result, &error);
|
||||||
|
if (error != NULL) {
|
||||||
|
@@ -780,35 +783,37 @@ static void storage_domains_fetched_cb(GObject *source_object,
|
||||||
|
|
||||||
|
g_hash_table_iter_init(&iter, ovirt_collection_get_resources(collection));
|
||||||
|
while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&domain)) {
|
||||||
|
- OvirtCollection *file_collection;
|
||||||
|
-
|
||||||
|
if (!storage_domain_validate(menu, domain))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- if (!domain_valid)
|
||||||
|
- domain_valid = TRUE;
|
||||||
|
+ /* Storage domain of type ISO has precedence over type DATA */
|
||||||
|
+ if (valid_domain != NULL) {
|
||||||
|
+ OvirtStorageDomainType domain_type, valid_type;
|
||||||
|
+ g_object_get(domain, "type", &domain_type, NULL);
|
||||||
|
+ g_object_get(valid_domain, "type", &valid_type, NULL);
|
||||||
|
|
||||||
|
- file_collection = storage_domain_get_files(domain);
|
||||||
|
- if (!ovirt_foreign_menu_set_file_collection(menu, file_collection)) {
|
||||||
|
- /* Retry with toplevel storage domain */
|
||||||
|
- if (!set_file_collection_from_toplevel_storage_domain(menu, domain))
|
||||||
|
- continue;
|
||||||
|
+ if (domain_type > valid_type)
|
||||||
|
+ valid_domain = domain;
|
||||||
|
+
|
||||||
|
+ continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
- break; /* There can only be one valid storage domain at a time,
|
||||||
|
- no need to iterate more on the list */
|
||||||
|
+ valid_domain = domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (menu->priv->files != NULL) {
|
||||||
|
- ovirt_foreign_menu_next_async_step(menu, task, STATE_STORAGE_DOMAIN);
|
||||||
|
- } else {
|
||||||
|
- const char *msg = domain_valid ? "Could not find ISO file collection"
|
||||||
|
+ file_collection = storage_domain_get_files(valid_domain);
|
||||||
|
+ if (!ovirt_foreign_menu_set_file_collection(menu, file_collection) &&
|
||||||
|
+ !set_file_collection_from_toplevel_storage_domain(menu, valid_domain)) { /* Retry with toplevel storage domain */
|
||||||
|
+ const char *msg = valid_domain ? "Could not find ISO file collection"
|
||||||
|
: "Could not find valid ISO storage domain";
|
||||||
|
|
||||||
|
g_debug("%s", msg);
|
||||||
|
g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED, "%s", msg);
|
||||||
|
g_object_unref(task);
|
||||||
|
+ return;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ ovirt_foreign_menu_next_async_step(menu, task, STATE_STORAGE_DOMAIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
32
SOURCES/0008-More-specific-key-accelerator-description.patch
Normal file
32
SOURCES/0008-More-specific-key-accelerator-description.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From ae25f6ca6b46e95281186492de5bc0a0fe4974a6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frediano Ziglio <freddy77@gmail.com>
|
||||||
|
Date: Fri, 10 Jul 2020 10:58:35 +0100
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-window.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
|
||||||
|
index 6c9bc41..614120f 100644
|
||||||
|
--- a/src/virt-viewer-window.c
|
||||||
|
+++ b/src/virt-viewer-window.c
|
||||||
|
@@ -1395,7 +1395,7 @@ virt_viewer_window_update_title(VirtViewerWindow *self)
|
||||||
|
g_debug("release-cursor accel key: key=%u, mods=%x, flags=%u", key.accel_key, key.accel_mods, key.accel_flags);
|
||||||
|
label = gtk_accelerator_get_label(key.accel_key, key.accel_mods);
|
||||||
|
} else {
|
||||||
|
- label = g_strdup(_("Ctrl+Alt"));
|
||||||
|
+ label = g_strdup(_("Ctrl_L+Alt_L"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ungrab = g_strdup_printf(_("(Press %s to release pointer)"), label);
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
@ -0,0 +1,122 @@
|
|||||||
|
From 522cca5ac1473405d325fce4fef0d6e0343f6257 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frediano Ziglio <freddy77@gmail.com>
|
||||||
|
Date: Wed, 10 Jun 2020 13:27:36 +0100
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-file-transfer-dialog.c | 47 +++++++++++++++++++++++---
|
||||||
|
1 file changed, 43 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-file-transfer-dialog.c b/src/virt-viewer-file-transfer-dialog.c
|
||||||
|
index b510d8e..975346f 100644
|
||||||
|
--- a/src/virt-viewer-file-transfer-dialog.c
|
||||||
|
+++ b/src/virt-viewer-file-transfer-dialog.c
|
||||||
|
@@ -188,6 +188,23 @@ error_dialog_response(GtkDialog *dialog,
|
||||||
|
gtk_widget_destroy(GTK_WIDGET(dialog));
|
||||||
|
}
|
||||||
|
|
||||||
|
+static const gchar*
|
||||||
|
+file_error_message(GError *err)
|
||||||
|
+{
|
||||||
|
+ if (err && err->message) {
|
||||||
|
+ return err->message;
|
||||||
|
+ }
|
||||||
|
+ return _("Unspecified error");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static gint
|
||||||
|
+compare_file_error(gconstpointer a, gconstpointer b)
|
||||||
|
+{
|
||||||
|
+ GError *error_a = g_object_get_data(G_OBJECT(a), "virt-viewer-error");
|
||||||
|
+ GError *error_b = g_object_get_data(G_OBJECT(b), "virt-viewer-error");
|
||||||
|
+ return g_strcmp0(file_error_message(error_a), file_error_message(error_b));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static gboolean hide_transfer_dialog(gpointer data)
|
||||||
|
{
|
||||||
|
VirtViewerFileTransferDialog *self = data;
|
||||||
|
@@ -202,10 +219,26 @@ static gboolean hide_transfer_dialog(gpointer data)
|
||||||
|
GString *msg = g_string_new("");
|
||||||
|
GtkWidget *dialog, *files_label, *scrolled_window, *area;
|
||||||
|
GtkRequisition files_label_sz;
|
||||||
|
+ const gchar *last_error = NULL;
|
||||||
|
+ const gchar *group_separator = "";
|
||||||
|
+
|
||||||
|
+ self->priv->failed = g_slist_sort(self->priv->failed, compare_file_error);
|
||||||
|
|
||||||
|
for (sl = self->priv->failed; sl != NULL; sl = g_slist_next(sl)) {
|
||||||
|
SpiceFileTransferTask *failed_task = sl->data;
|
||||||
|
gchar *filename = spice_file_transfer_task_get_filename(failed_task);
|
||||||
|
+
|
||||||
|
+ const gchar *error_message =
|
||||||
|
+ file_error_message(g_object_get_data(G_OBJECT(failed_task), "virt-viewer-error"));
|
||||||
|
+ if (g_strcmp0(error_message, last_error) != 0) {
|
||||||
|
+ // add error message
|
||||||
|
+ gchar *header = g_markup_printf_escaped("%s<b>%s</b>:", group_separator, error_message);
|
||||||
|
+ g_string_append(msg, header);
|
||||||
|
+ g_free(header);
|
||||||
|
+ last_error = error_message;
|
||||||
|
+ group_separator = "\n\n";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (filename == NULL) {
|
||||||
|
guint id;
|
||||||
|
|
||||||
|
@@ -214,15 +247,16 @@ static gboolean hide_transfer_dialog(gpointer data)
|
||||||
|
filename = g_strdup_printf("(task #%u)", id);
|
||||||
|
}
|
||||||
|
|
||||||
|
- g_string_append_printf(msg, "\n%s", filename);
|
||||||
|
+ gchar *escaped_filename = g_markup_printf_escaped("\n%s", filename);
|
||||||
|
+ g_string_append(msg, escaped_filename);
|
||||||
|
+ g_free(escaped_filename);
|
||||||
|
g_free(filename);
|
||||||
|
}
|
||||||
|
g_slist_free_full(self->priv->failed, g_object_unref);
|
||||||
|
self->priv->failed = NULL;
|
||||||
|
|
||||||
|
dialog = gtk_message_dialog_new(GTK_WINDOW(self), 0, GTK_MESSAGE_ERROR,
|
||||||
|
- GTK_BUTTONS_OK,
|
||||||
|
- _("An error caused the following file transfers to fail:"));
|
||||||
|
+ GTK_BUTTONS_OK, NULL);
|
||||||
|
gtk_window_set_title(GTK_WINDOW(dialog), "Transfer error");
|
||||||
|
|
||||||
|
scrolled_window = gtk_scrolled_window_new(NULL, NULL);
|
||||||
|
@@ -232,8 +266,9 @@ static gboolean hide_transfer_dialog(gpointer data)
|
||||||
|
area = gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog));
|
||||||
|
gtk_container_add(GTK_CONTAINER(area), scrolled_window);
|
||||||
|
|
||||||
|
- files_label = gtk_label_new(msg->str + 1); /* skip the initial '\n' */
|
||||||
|
+ files_label = gtk_label_new(NULL);
|
||||||
|
gtk_label_set_selectable(GTK_LABEL(files_label), TRUE);
|
||||||
|
+ gtk_label_set_markup(GTK_LABEL(files_label), msg->str);
|
||||||
|
gtk_container_add(GTK_CONTAINER(scrolled_window), files_label);
|
||||||
|
|
||||||
|
g_string_free(msg, TRUE);
|
||||||
|
@@ -242,6 +277,8 @@ static gboolean hide_transfer_dialog(gpointer data)
|
||||||
|
|
||||||
|
/* adjust panel to file_label height */
|
||||||
|
gtk_widget_get_preferred_size(files_label, NULL, &files_label_sz);
|
||||||
|
+ gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW(scrolled_window),
|
||||||
|
+ MIN(files_label_sz.width, 500));
|
||||||
|
gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled_window),
|
||||||
|
MIN(files_label_sz.height, 170));
|
||||||
|
}
|
||||||
|
@@ -256,6 +293,8 @@ static void task_finished(SpiceFileTransferTask *task,
|
||||||
|
VirtViewerFileTransferDialog *self = VIRT_VIEWER_FILE_TRANSFER_DIALOG(user_data);
|
||||||
|
|
||||||
|
if (error && !g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
|
+ g_object_set_data_full(G_OBJECT(task), "virt-viewer-error",
|
||||||
|
+ g_error_copy(error), (GDestroyNotify) g_error_free);
|
||||||
|
self->priv->failed = g_slist_prepend(self->priv->failed, g_object_ref(task));
|
||||||
|
g_warning("File transfer task %p failed: %s", task, error->message);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
32
SOURCES/0010-ui-improve-homepage-in-about-dialog.patch
Normal file
32
SOURCES/0010-ui-improve-homepage-in-about-dialog.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From 671f79bd7d0668fb0c70cd17d09a77482b9f5fbe Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pino Toscano <ptoscano@redhat.com>
|
||||||
|
Date: Wed, 22 Jul 2020 12:08:25 +0200
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/resources/ui/virt-viewer-about.ui | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/resources/ui/virt-viewer-about.ui b/src/resources/ui/virt-viewer-about.ui
|
||||||
|
index 5f6ce70..681590f 100644
|
||||||
|
--- a/src/resources/ui/virt-viewer-about.ui
|
||||||
|
+++ b/src/resources/ui/virt-viewer-about.ui
|
||||||
|
@@ -16,8 +16,8 @@
|
||||||
|
<property name="copyright" translatable="yes">Copyright (C) 2007-2012 Daniel P. Berrange
|
||||||
|
Copyright (C) 2007-2014 Red Hat, Inc.</property>
|
||||||
|
<property name="comments" translatable="yes">A remote desktop client built with GTK-VNC, SPICE-GTK and libvirt</property>
|
||||||
|
- <property name="website">http://gitlab.com/virt-viewer/virt-viewer/</property>
|
||||||
|
- <property name="website_label" translatable="yes">gitlab.com/virt-viewer/virt-viewer</property>
|
||||||
|
+ <property name="website">https://gitlab.com/virt-viewer/virt-viewer</property>
|
||||||
|
+ <property name="website_label">https://gitlab.com/virt-viewer/virt-viewer</property>
|
||||||
|
<property name="license" translatable="yes">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 2 of the License, or
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
28
SOURCES/0011-about-ui-year-2020-in-Copyright.patch
Normal file
28
SOURCES/0011-about-ui-year-2020-in-Copyright.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From d880ce4a4097d4e7efa1ba1a7fe28147b2e439bc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 25 Aug 2020 20:10:59 +0300
|
||||||
|
Subject: [PATCH] about ui: year 2020 in Copyright
|
||||||
|
|
||||||
|
rhbz#1848267
|
||||||
|
|
||||||
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||||||
|
---
|
||||||
|
src/resources/ui/virt-viewer-about.ui | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/resources/ui/virt-viewer-about.ui b/src/resources/ui/virt-viewer-about.ui
|
||||||
|
index 681590f..25b2165 100644
|
||||||
|
--- a/src/resources/ui/virt-viewer-about.ui
|
||||||
|
+++ b/src/resources/ui/virt-viewer-about.ui
|
||||||
|
@@ -15,7 +15,7 @@
|
||||||
|
<property name="skip_pager_hint">True</property>
|
||||||
|
<property name="program_name">Virtual Machine Viewer</property>
|
||||||
|
<property name="copyright" translatable="yes">Copyright (C) 2007-2012 Daniel P. Berrange
|
||||||
|
-Copyright (C) 2007-2014 Red Hat, Inc.</property>
|
||||||
|
+Copyright (C) 2007-2020 Red Hat, Inc.</property>
|
||||||
|
<property name="comments" translatable="yes">A remote desktop client built with GTK-VNC, SPICE-GTK and libvirt</property>
|
||||||
|
<property name="website">https://gitlab.com/virt-viewer/virt-viewer</property>
|
||||||
|
<property name="website_label">https://gitlab.com/virt-viewer/virt-viewer</property>
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
35
SOURCES/0012-ui-about-po-update-pot-file.patch
Normal file
35
SOURCES/0012-ui-about-po-update-pot-file.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From b7a2f05266e82fbdf0642b27276099a55844dbae Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pino Toscano <ptoscano@redhat.com>
|
||||||
|
Date: Fri, 11 Sep 2020 11:35:00 +0200
|
||||||
|
Subject: [PATCH] po: update pot file
|
||||||
|
|
||||||
|
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
|
||||||
|
---
|
||||||
|
po/virt-viewer.pot | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/po/virt-viewer.pot b/po/virt-viewer.pot
|
||||||
|
index a3e49ad..1853fcd 100644
|
||||||
|
--- a/po/virt-viewer.pot
|
||||||
|
+++ b/po/virt-viewer.pot
|
||||||
|
@@ -8,7 +8,7 @@ msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: virt-viewer 9.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.com/virt-viewer/virt-viewer/-/issues\n"
|
||||||
|
-"POT-Creation-Date: 2020-05-01 17:38+0100\n"
|
||||||
|
+"POT-Creation-Date: 2020-09-11 11:34+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@@ -199,7 +199,7 @@ msgstr ""
|
||||||
|
#: src/resources/ui/virt-viewer-about.ui:16
|
||||||
|
msgid ""
|
||||||
|
"Copyright (C) 2007-2012 Daniel P. Berrange\n"
|
||||||
|
-"Copyright (C) 2007-2014 Red Hat, Inc."
|
||||||
|
+"Copyright (C) 2007-2020 Red Hat, Inc."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/resources/ui/virt-viewer-about.ui:18
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
134
SOURCES/0013-vnc-show-an-error-dialog-upon-vnc-error.patch
Normal file
134
SOURCES/0013-vnc-show-an-error-dialog-upon-vnc-error.patch
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
From de5cd71013532d1a1240315c92fd0b5ca708fe01 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 27 Oct 2020 19:53:36 +0200
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-app.c | 20 +++++++++++++++++---
|
||||||
|
src/virt-viewer-session-vnc.c | 13 +++++++++++++
|
||||||
|
src/virt-viewer-session.c | 9 +++++++++
|
||||||
|
3 files changed, 39 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
|
||||||
|
index c0e0c9c..8cfdc2d 100644
|
||||||
|
--- a/src/virt-viewer-app.c
|
||||||
|
+++ b/src/virt-viewer-app.c
|
||||||
|
@@ -78,6 +78,9 @@ void virt_viewer_app_about_delete(GtkWidget *dialog, void *dummy, VirtViewerApp
|
||||||
|
/* Internal methods */
|
||||||
|
static void virt_viewer_app_connected(VirtViewerSession *session,
|
||||||
|
VirtViewerApp *self);
|
||||||
|
+static void virt_viewer_app_error(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
+ const gchar *msg,
|
||||||
|
+ VirtViewerApp *self);
|
||||||
|
static void virt_viewer_app_initialized(VirtViewerSession *session,
|
||||||
|
VirtViewerApp *self);
|
||||||
|
static void virt_viewer_app_disconnected(VirtViewerSession *session,
|
||||||
|
@@ -1292,6 +1295,8 @@ virt_viewer_app_create_session(VirtViewerApp *self, const gchar *type, GError **
|
||||||
|
|
||||||
|
g_signal_connect(priv->session, "session-initialized",
|
||||||
|
G_CALLBACK(virt_viewer_app_initialized), self);
|
||||||
|
+ g_signal_connect(priv->session, "session-error",
|
||||||
|
+ G_CALLBACK(virt_viewer_app_error), self);
|
||||||
|
g_signal_connect(priv->session, "session-connected",
|
||||||
|
G_CALLBACK(virt_viewer_app_connected), self);
|
||||||
|
g_signal_connect(priv->session, "session-disconnected",
|
||||||
|
@@ -1654,8 +1659,6 @@ virt_viewer_app_connected(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
virt_viewer_app_show_status(self, _("Connected to graphic server"));
|
||||||
|
}
|
||||||
|
|
||||||
|
-
|
||||||
|
-
|
||||||
|
static void
|
||||||
|
virt_viewer_app_initialized(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
VirtViewerApp *self)
|
||||||
|
@@ -1690,6 +1693,18 @@ virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED, const gch
|
||||||
|
virt_viewer_app_deactivate(self, connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+virt_viewer_app_error(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
+ const gchar *msg,
|
||||||
|
+ VirtViewerApp *self)
|
||||||
|
+{
|
||||||
|
+ VirtViewerAppPrivate *priv = self->priv;
|
||||||
|
+
|
||||||
|
+ priv->connected = FALSE; /* display error dialog */
|
||||||
|
+
|
||||||
|
+ virt_viewer_app_disconnected(session, msg, self);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void virt_viewer_app_cancelled(VirtViewerSession *session,
|
||||||
|
VirtViewerApp *self)
|
||||||
|
{
|
||||||
|
@@ -1698,7 +1713,6 @@ static void virt_viewer_app_cancelled(VirtViewerSession *session,
|
||||||
|
virt_viewer_app_disconnected(session, NULL, self);
|
||||||
|
}
|
||||||
|
|
||||||
|
-
|
||||||
|
static void virt_viewer_app_auth_refused(VirtViewerSession *session,
|
||||||
|
const char *msg,
|
||||||
|
VirtViewerApp *self)
|
||||||
|
diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
|
||||||
|
index 261d984..2598c70 100644
|
||||||
|
--- a/src/virt-viewer-session-vnc.c
|
||||||
|
+++ b/src/virt-viewer-session-vnc.c
|
||||||
|
@@ -128,6 +128,15 @@ virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED,
|
||||||
|
VIRT_VIEWER_DISPLAY_SHOW_HINT_READY, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+virt_viewer_session_vnc_error(VncDisplay *vnc G_GNUC_UNUSED,
|
||||||
|
+ const gchar* msg,
|
||||||
|
+ VirtViewerSessionVnc *session)
|
||||||
|
+{
|
||||||
|
+ g_warning("vnc-session: got vnc error %s", msg);
|
||||||
|
+ g_signal_emit_by_name(session, "session-error", msg);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
virt_viewer_session_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED,
|
||||||
|
VirtViewerSessionVnc *session)
|
||||||
|
@@ -386,6 +395,8 @@ virt_viewer_session_vnc_close(VirtViewerSession* session)
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_initialized), session);
|
||||||
|
g_signal_connect(self->priv->vnc, "vnc-disconnected",
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
|
||||||
|
+ g_signal_connect(self->priv->vnc, "vnc-error",
|
||||||
|
+ G_CALLBACK(virt_viewer_session_vnc_error), session);
|
||||||
|
|
||||||
|
g_signal_connect(self->priv->vnc, "vnc-bell",
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_bell), session);
|
||||||
|
@@ -418,6 +429,8 @@ virt_viewer_session_vnc_new(VirtViewerApp *app, GtkWindow *main_window)
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_initialized), session);
|
||||||
|
g_signal_connect(session->priv->vnc, "vnc-disconnected",
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_disconnected), session);
|
||||||
|
+ g_signal_connect(session->priv->vnc, "vnc-error",
|
||||||
|
+ G_CALLBACK(virt_viewer_session_vnc_error), session);
|
||||||
|
|
||||||
|
g_signal_connect(session->priv->vnc, "vnc-bell",
|
||||||
|
G_CALLBACK(virt_viewer_session_vnc_bell), session);
|
||||||
|
diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
|
||||||
|
index a809814..d58fc37 100644
|
||||||
|
--- a/src/virt-viewer-session.c
|
||||||
|
+++ b/src/virt-viewer-session.c
|
||||||
|
@@ -272,6 +272,15 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
|
||||||
|
G_TYPE_NONE,
|
||||||
|
0);
|
||||||
|
|
||||||
|
+ g_signal_new("session-error",
|
||||||
|
+ G_OBJECT_CLASS_TYPE(object_class),
|
||||||
|
+ G_SIGNAL_RUN_FIRST,
|
||||||
|
+ 0,
|
||||||
|
+ NULL, NULL,
|
||||||
|
+ g_cclosure_marshal_VOID__STRING,
|
||||||
|
+ G_TYPE_NONE,
|
||||||
|
+ 1,
|
||||||
|
+ G_TYPE_STRING);
|
||||||
|
g_signal_new("session-disconnected",
|
||||||
|
G_OBJECT_CLASS_TYPE(object_class),
|
||||||
|
G_SIGNAL_RUN_FIRST,
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
69
SOURCES/0014-Fix-warning-by-Coverity.patch
Normal file
69
SOURCES/0014-Fix-warning-by-Coverity.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
From 1573a790da7370f547d542191d530ba8580e5a03 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frediano Ziglio <freddy77@gmail.com>
|
||||||
|
Date: Mon, 14 Sep 2020 13:51:15 +0100
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-display-vte.c | 10 ++++++++--
|
||||||
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-display-vte.c b/src/virt-viewer-display-vte.c
|
||||||
|
index ef0d5ac..9e4f734 100644
|
||||||
|
--- a/src/virt-viewer-display-vte.c
|
||||||
|
+++ b/src/virt-viewer-display-vte.c
|
||||||
|
@@ -147,7 +147,6 @@ virt_viewer_display_vte_commit(VirtViewerDisplayVte *self,
|
||||||
|
{
|
||||||
|
g_signal_emit_by_name(self, "commit", text, size);
|
||||||
|
}
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
virt_viewer_display_vte_adj_changed(VirtViewerDisplayVte *self,
|
||||||
|
@@ -156,12 +155,16 @@ virt_viewer_display_vte_adj_changed(VirtViewerDisplayVte *self,
|
||||||
|
gtk_widget_set_visible(self->priv->scroll,
|
||||||
|
gtk_adjustment_get_upper(adjustment) > gtk_adjustment_get_page_size(adjustment));
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
GtkWidget *
|
||||||
|
virt_viewer_display_vte_new(VirtViewerSession *session, const char *name)
|
||||||
|
{
|
||||||
|
VirtViewerDisplayVte *self;
|
||||||
|
- GtkWidget *grid, *scroll = NULL, *vte;
|
||||||
|
+ GtkWidget *grid, *vte;
|
||||||
|
+#ifdef HAVE_VTE
|
||||||
|
+ GtkWidget *scroll = NULL;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
self = g_object_new(VIRT_VIEWER_TYPE_DISPLAY_VTE,
|
||||||
|
"session", session,
|
||||||
|
@@ -185,6 +188,8 @@ virt_viewer_display_vte_new(VirtViewerSession *session, const char *name)
|
||||||
|
grid = gtk_grid_new();
|
||||||
|
|
||||||
|
gtk_container_add(GTK_CONTAINER(grid), vte);
|
||||||
|
+
|
||||||
|
+#ifdef HAVE_VTE
|
||||||
|
if (scroll) {
|
||||||
|
gtk_container_add(GTK_CONTAINER(grid), scroll);
|
||||||
|
gtk_widget_hide(scroll);
|
||||||
|
@@ -192,6 +197,7 @@ virt_viewer_display_vte_new(VirtViewerSession *session, const char *name)
|
||||||
|
"changed", G_CALLBACK(virt_viewer_display_vte_adj_changed),
|
||||||
|
self, G_CONNECT_SWAPPED);
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
gtk_container_add(GTK_CONTAINER(self), grid);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
From a40c8f4508e96c29ea5a24042906d5ded90241fb Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Jakub=20Jank=C5=AF?= <jjanku@redhat.com>
|
||||||
|
Date: Thu, 3 Dec 2020 13:40:33 +0100
|
||||||
|
Subject: [PATCH] windows: fix nonuniform behavior of zoom hotkeys
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-window.c | 24 +++++++++++++++---------
|
||||||
|
1 file changed, 15 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
|
||||||
|
index eed3086..5647023 100644
|
||||||
|
--- a/src/virt-viewer-window.c
|
||||||
|
+++ b/src/virt-viewer-window.c
|
||||||
|
@@ -887,6 +887,7 @@ virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
|
||||||
|
VirtViewerWindowPrivate *priv = self->priv;
|
||||||
|
GSList *accels;
|
||||||
|
guint i;
|
||||||
|
+ GtkAccelKey key;
|
||||||
|
|
||||||
|
if (priv->accel_enabled)
|
||||||
|
return;
|
||||||
|
@@ -904,15 +905,20 @@ virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
|
||||||
|
"gtk-enable-mnemonics", priv->enable_mnemonics_save,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
- g_action_map_add_action_entries(G_ACTION_MAP(priv->window),
|
||||||
|
- keypad_action_entries, G_N_ELEMENTS(keypad_action_entries),
|
||||||
|
- self);
|
||||||
|
- for (i = 0; i < G_N_ELEMENTS(keypad_action_entries); i++) {
|
||||||
|
- gchar *detailed_name = g_strdup_printf("win.%s", keypad_action_entries[i].name);
|
||||||
|
- gtk_application_set_accels_for_action(GTK_APPLICATION(priv->app),
|
||||||
|
- detailed_name,
|
||||||
|
- keypad_action_accels[i]);
|
||||||
|
- g_free(detailed_name);
|
||||||
|
+ /* if zoom actions using "normal" +/-/0 keys are enabled,
|
||||||
|
+ * allow the user to use the numpad +/-/0 keys as well */
|
||||||
|
+ if (gtk_accel_map_lookup_entry("<virt-viewer>/view/zoom-out", &key)
|
||||||
|
+ && key.accel_key != 0) {
|
||||||
|
+ g_action_map_add_action_entries(G_ACTION_MAP(priv->window),
|
||||||
|
+ keypad_action_entries, G_N_ELEMENTS(keypad_action_entries),
|
||||||
|
+ self);
|
||||||
|
+ for (i = 0; i < G_N_ELEMENTS(keypad_action_entries); i++) {
|
||||||
|
+ gchar *detailed_name = g_strdup_printf("win.%s", keypad_action_entries[i].name);
|
||||||
|
+ gtk_application_set_accels_for_action(GTK_APPLICATION(priv->app),
|
||||||
|
+ detailed_name,
|
||||||
|
+ keypad_action_accels[i]);
|
||||||
|
+ g_free(detailed_name);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
priv->accel_enabled = TRUE;
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,30 @@
|
|||||||
|
From e89e82eeb9a917f077720d4821c0e306a6d130d1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 8 Dec 2020 19:50:01 +0200
|
||||||
|
Subject: [PATCH 16/19] hotkeys: enable setting zoom hotkeys from command line
|
||||||
|
|
||||||
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||||||
|
---
|
||||||
|
src/virt-viewer-app.c | 6 ++++++
|
||||||
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
|
||||||
|
index 3ee5990..8d795ca 100644
|
||||||
|
--- a/src/virt-viewer-app.c
|
||||||
|
+++ b/src/virt-viewer-app.c
|
||||||
|
@@ -2511,6 +2511,12 @@ virt_viewer_app_set_hotkeys(VirtViewerApp *self, const gchar *hotkeys_str)
|
||||||
|
status = gtk_accel_map_change_entry("<virt-viewer>/view/toggle-fullscreen", accel_key, accel_mods, TRUE);
|
||||||
|
} else if (g_str_equal(*hotkey, "release-cursor")) {
|
||||||
|
status = gtk_accel_map_change_entry("<virt-viewer>/view/release-cursor", accel_key, accel_mods, TRUE);
|
||||||
|
+ } else if (g_str_equal(*hotkey, "zoom-reset")) {
|
||||||
|
+ status = gtk_accel_map_change_entry("<virt-viewer>/view/zoom-reset", accel_key, accel_mods, TRUE);
|
||||||
|
+ } else if (g_str_equal(*hotkey, "zoom-out")) {
|
||||||
|
+ status = gtk_accel_map_change_entry("<virt-viewer>/view/zoom-out", accel_key, accel_mods, TRUE);
|
||||||
|
+ } else if (g_str_equal(*hotkey, "zoom-in")) {
|
||||||
|
+ status = gtk_accel_map_change_entry("<virt-viewer>/view/zoom-in", accel_key, accel_mods, TRUE);
|
||||||
|
} else if (g_str_equal(*hotkey, "secure-attention")) {
|
||||||
|
status = gtk_accel_map_change_entry("<virt-viewer>/send/secure-attention", accel_key, accel_mods, TRUE);
|
||||||
|
} else if (g_str_equal(*hotkey, "smartcard-insert")) {
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,164 @@
|
|||||||
|
From 8cc06670239ae382a3b2e17fe39f5ecfb7bfe2f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 8 Dec 2020 19:50:57 +0200
|
||||||
|
Subject: [PATCH 17/19] hotkeys: enable setting zoom hotkeys from a vv file
|
||||||
|
|
||||||
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||||||
|
---
|
||||||
|
src/virt-viewer-file.c | 79 ++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
src/virt-viewer-file.h | 7 ++++
|
||||||
|
2 files changed, 86 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
|
||||||
|
index 7d2b2cb..143074f 100644
|
||||||
|
--- a/src/virt-viewer-file.c
|
||||||
|
+++ b/src/virt-viewer-file.c
|
||||||
|
@@ -57,6 +57,9 @@
|
||||||
|
* - title: string
|
||||||
|
* - toggle-fullscreen: string in spice hotkey format
|
||||||
|
* - release-cursor: string in spice hotkey format
|
||||||
|
+ * - zoom-in: zoom in and make the client window larger
|
||||||
|
+ * - zoom-out: zoom out and make the client window smaller
|
||||||
|
+ * - zoom-reset: reset zoom and client window size
|
||||||
|
* - smartcard-insert: string in spice hotkey format
|
||||||
|
* - smartcard-remove: string in spice hotkey format
|
||||||
|
* - secure-attention: string in spice hotkey format
|
||||||
|
@@ -117,6 +120,9 @@ enum {
|
||||||
|
PROP_TITLE,
|
||||||
|
PROP_TOGGLE_FULLSCREEN,
|
||||||
|
PROP_RELEASE_CURSOR,
|
||||||
|
+ PROP_ZOOM_IN,
|
||||||
|
+ PROP_ZOOM_OUT,
|
||||||
|
+ PROP_ZOOM_RESET,
|
||||||
|
PROP_ENABLE_SMARTCARD,
|
||||||
|
PROP_ENABLE_USBREDIR,
|
||||||
|
PROP_COLOR_DEPTH,
|
||||||
|
@@ -514,6 +520,46 @@ virt_viewer_file_set_release_cursor(VirtViewerFile* self, const gchar* value)
|
||||||
|
g_object_notify(G_OBJECT(self), "release-cursor");
|
||||||
|
}
|
||||||
|
|
||||||
|
+gchar*
|
||||||
|
+virt_viewer_file_get_zoom_in(VirtViewerFile* self)
|
||||||
|
+{
|
||||||
|
+ return virt_viewer_file_get_string(self, MAIN_GROUP, "zoom-in");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+virt_viewer_file_set_zoom_in(VirtViewerFile* self, const gchar* value)
|
||||||
|
+{
|
||||||
|
+ virt_viewer_file_set_string(self, MAIN_GROUP, "zoom-in", value);
|
||||||
|
+ g_object_notify(G_OBJECT(self), "zoom-in");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+gchar*
|
||||||
|
+virt_viewer_file_get_zoom_out(VirtViewerFile* self)
|
||||||
|
+{
|
||||||
|
+ return virt_viewer_file_get_string(self, MAIN_GROUP, "zoom-out");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+virt_viewer_file_set_zoom_out(VirtViewerFile* self, const gchar* value)
|
||||||
|
+{
|
||||||
|
+ virt_viewer_file_set_string(self, MAIN_GROUP, "zoom-out", value);
|
||||||
|
+ g_object_notify(G_OBJECT(self), "zoom-out");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+gchar*
|
||||||
|
+virt_viewer_file_get_zoom_reset(VirtViewerFile* self)
|
||||||
|
+{
|
||||||
|
+ return virt_viewer_file_get_string(self, MAIN_GROUP, "zoom-reset");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+virt_viewer_file_set_zoom_reset(VirtViewerFile* self, const gchar* value)
|
||||||
|
+{
|
||||||
|
+ virt_viewer_file_set_string(self, MAIN_GROUP, "zoom-reset", value);
|
||||||
|
+ g_object_notify(G_OBJECT(self), "zoom-reset");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
gchar*
|
||||||
|
virt_viewer_file_get_secure_attention(VirtViewerFile* self)
|
||||||
|
{
|
||||||
|
@@ -917,6 +963,9 @@ virt_viewer_file_fill_app(VirtViewerFile* self, VirtViewerApp *app, GError **err
|
||||||
|
} accels[] = {
|
||||||
|
{ "release-cursor", "<virt-viewer>/view/release-cursor" },
|
||||||
|
{ "toggle-fullscreen", "<virt-viewer>/view/toggle-fullscreen" },
|
||||||
|
+ { "zoom-in", "<virt-viewer>/view/zoom-in" },
|
||||||
|
+ { "zoom-out", "<virt-viewer>/view/zoom-out" },
|
||||||
|
+ { "zoom-reset", "<virt-viewer>/view/zoom-reset" },
|
||||||
|
{ "smartcard-insert", "<virt-viewer>/file/smartcard-insert" },
|
||||||
|
{ "smartcard-remove", "<virt-viewer>/file/smartcard-remove" },
|
||||||
|
{ "secure-attention", "<virt-viewer>/send/secure-attention" }
|
||||||
|
@@ -995,6 +1044,15 @@ virt_viewer_file_set_property(GObject* object, guint property_id,
|
||||||
|
case PROP_RELEASE_CURSOR:
|
||||||
|
virt_viewer_file_set_release_cursor(self, g_value_get_string(value));
|
||||||
|
break;
|
||||||
|
+ case PROP_ZOOM_IN:
|
||||||
|
+ virt_viewer_file_set_zoom_in(self, g_value_get_string(value));
|
||||||
|
+ break;
|
||||||
|
+ case PROP_ZOOM_OUT:
|
||||||
|
+ virt_viewer_file_set_zoom_out(self, g_value_get_string(value));
|
||||||
|
+ break;
|
||||||
|
+ case PROP_ZOOM_RESET:
|
||||||
|
+ virt_viewer_file_set_zoom_reset(self, g_value_get_string(value));
|
||||||
|
+ break;
|
||||||
|
case PROP_SECURE_ATTENTION:
|
||||||
|
virt_viewer_file_set_secure_attention(self, g_value_get_string(value));
|
||||||
|
break;
|
||||||
|
@@ -1112,6 +1170,15 @@ virt_viewer_file_get_property(GObject* object, guint property_id,
|
||||||
|
case PROP_RELEASE_CURSOR:
|
||||||
|
g_value_take_string(value, virt_viewer_file_get_release_cursor(self));
|
||||||
|
break;
|
||||||
|
+ case PROP_ZOOM_IN:
|
||||||
|
+ g_value_take_string(value, virt_viewer_file_get_zoom_in(self));
|
||||||
|
+ break;
|
||||||
|
+ case PROP_ZOOM_OUT:
|
||||||
|
+ g_value_take_string(value, virt_viewer_file_get_zoom_out(self));
|
||||||
|
+ break;
|
||||||
|
+ case PROP_ZOOM_RESET:
|
||||||
|
+ g_value_take_string(value, virt_viewer_file_get_zoom_reset(self));
|
||||||
|
+ break;
|
||||||
|
case PROP_SECURE_ATTENTION:
|
||||||
|
g_value_take_string(value, virt_viewer_file_get_secure_attention(self));
|
||||||
|
break;
|
||||||
|
@@ -1255,6 +1322,18 @@ virt_viewer_file_class_init(VirtViewerFileClass* klass)
|
||||||
|
g_param_spec_string("release-cursor", "release-cursor", "release-cursor", NULL,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
+ g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_ZOOM_IN,
|
||||||
|
+ g_param_spec_string("zoom-in", "zoom-in", "zoom-in", NULL,
|
||||||
|
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
+
|
||||||
|
+ g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_ZOOM_OUT,
|
||||||
|
+ g_param_spec_string("zoom-out", "zoom-out", "zoom-out", NULL,
|
||||||
|
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
+
|
||||||
|
+ g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_ZOOM_RESET,
|
||||||
|
+ g_param_spec_string("zoom-reset", "zoom-reset", "zoom-reset", NULL,
|
||||||
|
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
+
|
||||||
|
g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_SECURE_ATTENTION,
|
||||||
|
g_param_spec_string("secure-attention", "secure-attention", "secure-attention", NULL,
|
||||||
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
diff --git a/src/virt-viewer-file.h b/src/virt-viewer-file.h
|
||||||
|
index 108bcbf..b0aef6d 100644
|
||||||
|
--- a/src/virt-viewer-file.h
|
||||||
|
+++ b/src/virt-viewer-file.h
|
||||||
|
@@ -86,6 +86,13 @@ gchar* virt_viewer_file_get_toggle_fullscreen(VirtViewerFile* self);
|
||||||
|
void virt_viewer_file_set_toggle_fullscreen(VirtViewerFile* self, const gchar* value);
|
||||||
|
gchar* virt_viewer_file_get_release_cursor(VirtViewerFile* self);
|
||||||
|
void virt_viewer_file_set_release_cursor(VirtViewerFile* self, const gchar* value);
|
||||||
|
+gchar* virt_viewer_file_get_zoom_in(VirtViewerFile* self);
|
||||||
|
+void virt_viewer_file_set_zoom_in(VirtViewerFile* self, const gchar* value);
|
||||||
|
+gchar* virt_viewer_file_get_zoom_out(VirtViewerFile* self);
|
||||||
|
+void virt_viewer_file_set_zoom_out(VirtViewerFile* self, const gchar* value);
|
||||||
|
+gchar* virt_viewer_file_get_zoom_reset(VirtViewerFile* self);
|
||||||
|
+void virt_viewer_file_set_zoom_reset(VirtViewerFile* self, const gchar* value);
|
||||||
|
+
|
||||||
|
gint virt_viewer_file_get_enable_smartcard(VirtViewerFile* self);
|
||||||
|
void virt_viewer_file_set_enable_smartcard(VirtViewerFile* self, gint value);
|
||||||
|
gint virt_viewer_file_get_enable_usbredir(VirtViewerFile* self);
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
25
SOURCES/0018-tests-hotkeys-add-zoom-hotkeys.patch
Normal file
25
SOURCES/0018-tests-hotkeys-add-zoom-hotkeys.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 8de1e49136599842d52823295c0d3f4b941601de Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 8 Dec 2020 20:11:23 +0200
|
||||||
|
Subject: [PATCH 18/19] tests: hotkeys: add zoom hotkeys
|
||||||
|
|
||||||
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||||||
|
---
|
||||||
|
tests/test-hotkeys.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/tests/test-hotkeys.c b/tests/test-hotkeys.c
|
||||||
|
index cd2bd88..8275647 100644
|
||||||
|
--- a/tests/test-hotkeys.c
|
||||||
|
+++ b/tests/test-hotkeys.c
|
||||||
|
@@ -67,6 +67,7 @@ test_hotkeys_good(void)
|
||||||
|
const gchar *hotkeys[] = {
|
||||||
|
"toggle-fullscreen=shift+f11",
|
||||||
|
"release-cursor=shift+f12,secure-attention=ctrl+shift+b",
|
||||||
|
+ "zoom-in=shift+f2,zoom-out=shift+f3,zoom-reset=shift+f4",
|
||||||
|
"smartcard-insert=shift+I,smartcard-remove=shift+R",
|
||||||
|
};
|
||||||
|
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
61
SOURCES/0019-man-add-zoom-hotkeys.patch
Normal file
61
SOURCES/0019-man-add-zoom-hotkeys.patch
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
From ae3e15f851605e5551406412fed00a034fc66f58 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Tue, 8 Dec 2020 20:12:19 +0200
|
||||||
|
Subject: [PATCH 19/19] man: add zoom hotkeys
|
||||||
|
|
||||||
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||||||
|
---
|
||||||
|
man/remote-viewer.pod | 15 ++++++++++++++-
|
||||||
|
man/virt-viewer.pod | 3 ++-
|
||||||
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
|
||||||
|
index 73c829f..e820f4b 100644
|
||||||
|
--- a/man/remote-viewer.pod
|
||||||
|
+++ b/man/remote-viewer.pod
|
||||||
|
@@ -69,7 +69,8 @@ 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, secure-attention, smartcard-insert and smartcard-remove. The
|
||||||
|
+release-cursor, zoom-in, zoom-out, zoom-reset,
|
||||||
|
+secure-attention, smartcard-insert and smartcard-remove. The
|
||||||
|
C<secure-attention> action sends a secure attention sequence (Ctrl+Alt+Del) to
|
||||||
|
the guest. Examples:
|
||||||
|
|
||||||
|
@@ -224,6 +225,18 @@ Key binding for entering and leaving fullscreen mode. (see L<HOTKEY> for descrip
|
||||||
|
|
||||||
|
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 reseting 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)
|
||||||
|
diff --git a/man/virt-viewer.pod b/man/virt-viewer.pod
|
||||||
|
index d55c5be..a42134b 100644
|
||||||
|
--- a/man/virt-viewer.pod
|
||||||
|
+++ b/man/virt-viewer.pod
|
||||||
|
@@ -89,7 +89,8 @@ 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, secure-attention, smartcard-insert and smartcard-remove. The
|
||||||
|
+release-cursor, zoom-in, zoom-out, zoom-reset,
|
||||||
|
+secure-attention, smartcard-insert and smartcard-remove. The
|
||||||
|
C<secure-attention> action sends a secure attention sequence (Ctrl+Alt+Del) to
|
||||||
|
the guest. Examples:
|
||||||
|
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
From a0f227c723d424c6f1cf63efa213668e69800e98 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Sun, 10 Jan 2021 17:05:09 +0200
|
||||||
|
Subject: [PATCH] zoom hotkeys: disable numpad when users set new hotkeys
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-window.c | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
|
||||||
|
index 5647023..448ef74 100644
|
||||||
|
--- a/src/virt-viewer-window.c
|
||||||
|
+++ b/src/virt-viewer-window.c
|
||||||
|
@@ -905,9 +905,11 @@ virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
|
||||||
|
"gtk-enable-mnemonics", priv->enable_mnemonics_save,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
- /* if zoom actions using "normal" +/-/0 keys are enabled,
|
||||||
|
+ /* if the user did not set hotkeys and
|
||||||
|
+ * zoom actions using "normal" +/-/0 keys are enabled,
|
||||||
|
* allow the user to use the numpad +/-/0 keys as well */
|
||||||
|
- if (gtk_accel_map_lookup_entry("<virt-viewer>/view/zoom-out", &key)
|
||||||
|
+ if (!virt_viewer_app_get_enable_accel(priv->app)
|
||||||
|
+ && gtk_accel_map_lookup_entry("<virt-viewer>/view/zoom-out", &key)
|
||||||
|
&& key.accel_key != 0) {
|
||||||
|
g_action_map_add_action_entries(G_ACTION_MAP(priv->window),
|
||||||
|
keypad_action_entries, G_N_ELEMENTS(keypad_action_entries),
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,70 @@
|
|||||||
|
From c3a3f23968edceaf097f20450c795c762ec36fc0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Jakub=20Jank=C5=AF?= <jjanku@redhat.com>
|
||||||
|
Date: Sun, 20 Dec 2020 12:29:27 +0100
|
||||||
|
Subject: [PATCH] disable default grab sequence in kiosk mode
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-display-spice.c | 6 +++++-
|
||||||
|
src/virt-viewer-display-vnc.c | 6 +++++-
|
||||||
|
2 files changed, 10 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
|
||||||
|
index a82422c..799403c 100644
|
||||||
|
--- a/src/virt-viewer-display-spice.c
|
||||||
|
+++ b/src/virt-viewer-display-spice.c
|
||||||
|
@@ -238,10 +238,14 @@ enable_accel_changed(VirtViewerApp *app,
|
||||||
|
VirtViewerDisplaySpice *self)
|
||||||
|
{
|
||||||
|
GtkAccelKey key = {0, 0, 0};
|
||||||
|
+ gboolean kiosk;
|
||||||
|
+
|
||||||
|
if (virt_viewer_app_get_enable_accel(app))
|
||||||
|
gtk_accel_map_lookup_entry("<virt-viewer>/view/release-cursor", &key);
|
||||||
|
|
||||||
|
- if (key.accel_key || key.accel_mods) {
|
||||||
|
+ g_object_get(app, "kiosk", &kiosk, NULL);
|
||||||
|
+
|
||||||
|
+ if (key.accel_key || key.accel_mods || kiosk) {
|
||||||
|
SpiceGrabSequence *seq = spice_grab_sequence_new(0, NULL);
|
||||||
|
/* disable default grab sequence */
|
||||||
|
spice_display_set_grab_keys(self->priv->display, seq);
|
||||||
|
diff --git a/src/virt-viewer-display-vnc.c b/src/virt-viewer-display-vnc.c
|
||||||
|
index d38dcac..537173c 100644
|
||||||
|
--- a/src/virt-viewer-display-vnc.c
|
||||||
|
+++ b/src/virt-viewer-display-vnc.c
|
||||||
|
@@ -188,10 +188,14 @@ enable_accel_changed(VirtViewerApp *app,
|
||||||
|
VncDisplay *vnc)
|
||||||
|
{
|
||||||
|
GtkAccelKey key = {0, 0, 0};
|
||||||
|
+ gboolean kiosk;
|
||||||
|
+
|
||||||
|
if (virt_viewer_app_get_enable_accel(app))
|
||||||
|
gtk_accel_map_lookup_entry("<virt-viewer>/view/release-cursor", &key);
|
||||||
|
|
||||||
|
- if (key.accel_key || key.accel_mods) {
|
||||||
|
+ g_object_get(app, "kiosk", &kiosk, NULL);
|
||||||
|
+
|
||||||
|
+ if (key.accel_key || key.accel_mods || kiosk) {
|
||||||
|
VncGrabSequence *seq = vnc_grab_sequence_new(0, NULL);
|
||||||
|
/* disable default grab sequence */
|
||||||
|
vnc_display_set_grab_keys(vnc, seq);
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,62 @@
|
|||||||
|
From 74fdd26c949847bca41c7ca71bc88d30d92d92aa Mon Sep 17 00:00:00 2001
|
||||||
|
From: Uri Lublin <uril@redhat.com>
|
||||||
|
Date: Sun, 17 Jan 2021 19:25:57 +0200
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
src/virt-viewer-app.c | 8 +++++++-
|
||||||
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
|
||||||
|
index 8d795ca..4a579f8 100644
|
||||||
|
--- a/src/virt-viewer-app.c
|
||||||
|
+++ b/src/virt-viewer-app.c
|
||||||
|
@@ -139,6 +139,7 @@ struct _VirtViewerAppPrivate {
|
||||||
|
gboolean kiosk;
|
||||||
|
gboolean vm_ui;
|
||||||
|
gboolean vm_running;
|
||||||
|
+ gboolean initialized;
|
||||||
|
|
||||||
|
VirtViewerSession *session;
|
||||||
|
gboolean active;
|
||||||
|
@@ -1651,6 +1652,7 @@ virt_viewer_app_deactivate(VirtViewerApp *self, gboolean connect_error)
|
||||||
|
virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ priv->initialized = FALSE;
|
||||||
|
priv->connected = FALSE;
|
||||||
|
priv->active = FALSE;
|
||||||
|
priv->started = FALSE;
|
||||||
|
@@ -1689,6 +1691,7 @@ static void
|
||||||
|
virt_viewer_app_initialized(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
VirtViewerApp *self)
|
||||||
|
{
|
||||||
|
+ self->priv->initialized = TRUE;
|
||||||
|
virt_viewer_app_update_title(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1727,7 +1730,10 @@ virt_viewer_app_error(VirtViewerSession *session G_GNUC_UNUSED,
|
||||||
|
{
|
||||||
|
VirtViewerAppPrivate *priv = self->priv;
|
||||||
|
|
||||||
|
- priv->connected = FALSE; /* display error dialog */
|
||||||
|
+ /* Do not open a dialog if the connection was initialized
|
||||||
|
+ * This happens when the VNC server closes the connection */
|
||||||
|
+ if (!priv->initialized)
|
||||||
|
+ priv->connected = FALSE; /* display error dialog */
|
||||||
|
|
||||||
|
virt_viewer_app_disconnected(session, msg, self);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
Name: virt-viewer
|
Name: virt-viewer
|
||||||
Version: 9.0
|
Version: 9.0
|
||||||
Release: 4%{?dist}%{?extra_release}
|
Release: 9%{?dist}%{?extra_release}
|
||||||
Summary: Virtual Machine Viewer
|
Summary: Virtual Machine Viewer
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -29,8 +29,41 @@ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar
|
|||||||
Patch001: 0001-DOWNSTREAM-Workaround-inconsistency-with-REST-API.patch
|
Patch001: 0001-DOWNSTREAM-Workaround-inconsistency-with-REST-API.patch
|
||||||
Patch002: 0002-DOWNSTREAM-ovirt-foreign-menu-Bypass-errors-from-Hos.patch
|
Patch002: 0002-DOWNSTREAM-ovirt-foreign-menu-Bypass-errors-from-Hos.patch
|
||||||
Patch003: 0003-DOWNSTREAM-remote-viewer-Set-admin-privileges-when-c.patch
|
Patch003: 0003-DOWNSTREAM-remote-viewer-Set-admin-privileges-when-c.patch
|
||||||
|
Patch004: 0004-ovirt-Do-not-filter-out-DATA-storage-domains.patch
|
||||||
Patch005: 0005-display-error-message-on-no-extension-for-screenshot.patch
|
Patch005: 0005-display-error-message-on-no-extension-for-screenshot.patch
|
||||||
|
Patch006: 0006-ovirt-foreign-menu-Use-proper-function-in-the-case-o.patch
|
||||||
|
Patch007: 0007-ovirt-foreign-menu-Take-into-account-StorageDomains-.patch
|
||||||
|
|
||||||
|
#rhbz#1548371
|
||||||
|
Patch008: 0008-More-specific-key-accelerator-description.patch
|
||||||
|
|
||||||
|
#rhbz#1753563
|
||||||
|
Patch009: 0009-virt-viewer-file-transfer-dialog-Reports-detailed-er.patch
|
||||||
|
|
||||||
|
# rhbz#1848267
|
||||||
|
# Patches 10 and 12 slightly modified to match downstream
|
||||||
|
Patch010: 0010-ui-improve-homepage-in-about-dialog.patch
|
||||||
|
Patch011: 0011-about-ui-year-2020-in-Copyright.patch
|
||||||
|
Patch012: 0012-ui-about-po-update-pot-file.patch
|
||||||
|
|
||||||
|
# rhbz#1448151
|
||||||
|
Patch013: 0013-vnc-show-an-error-dialog-upon-vnc-error.patch
|
||||||
|
Patch022: 0022-vnc-no-dialog-for-server-closed-connection-error.patch
|
||||||
|
|
||||||
|
# rhbz#1876719
|
||||||
|
Patch014: 0014-Fix-warning-by-Coverity.patch
|
||||||
|
|
||||||
|
# rhbz#1791261
|
||||||
|
Patch015: 0015-windows-fix-nonuniform-behavior-of-zoom-hotkeys.patch
|
||||||
|
Patch016: 0016-hotkeys-enable-setting-zoom-hotkeys-from-command-lin.patch
|
||||||
|
Patch017: 0017-hotkeys-enable-setting-zoom-hotkeys-from-a-vv-file.patch
|
||||||
|
Patch018: 0018-tests-hotkeys-add-zoom-hotkeys.patch
|
||||||
|
# patch19 slightly modified, no usb-device-reset accel
|
||||||
|
Patch019: 0019-man-add-zoom-hotkeys.patch
|
||||||
|
Patch020: 0020-zoom-hotkeys-disable-numpad-when-users-set-new-hotke.patch
|
||||||
|
|
||||||
|
# rhbz#1893584
|
||||||
|
Patch021: 0021-disable-default-grab-sequence-in-kiosk-mode.patch
|
||||||
|
|
||||||
Requires: openssh-clients
|
Requires: openssh-clients
|
||||||
Requires(post): %{_sbindir}/update-alternatives
|
Requires(post): %{_sbindir}/update-alternatives
|
||||||
@ -78,7 +111,30 @@ the display, and libvirt for looking up VNC/SPICE server details.
|
|||||||
%patch001 -p1
|
%patch001 -p1
|
||||||
%patch002 -p1
|
%patch002 -p1
|
||||||
%patch003 -p1
|
%patch003 -p1
|
||||||
|
%patch004 -p1
|
||||||
%patch005 -p1
|
%patch005 -p1
|
||||||
|
%patch006 -p1
|
||||||
|
%patch007 -p1
|
||||||
|
|
||||||
|
%patch008 -p1
|
||||||
|
%patch009 -p1
|
||||||
|
|
||||||
|
%patch010 -p1
|
||||||
|
%patch011 -p1
|
||||||
|
%patch012 -p1
|
||||||
|
|
||||||
|
%patch013 -p1
|
||||||
|
%patch014 -p1
|
||||||
|
|
||||||
|
%patch015 -p1
|
||||||
|
%patch016 -p1
|
||||||
|
%patch017 -p1
|
||||||
|
%patch018 -p1
|
||||||
|
%patch019 -p1
|
||||||
|
%patch020 -p1
|
||||||
|
|
||||||
|
%patch021 -p1
|
||||||
|
%patch022 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -118,6 +174,34 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_mandir}/man1/remote-viewer.1*
|
%{_mandir}/man1/remote-viewer.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 21 2021 Uri Lublin <uril@redhat.com> - 9.0-9
|
||||||
|
- Show an error dialog upon vnc-error only if session was initialized
|
||||||
|
Resolves: rhbz#1448151
|
||||||
|
|
||||||
|
* Mon Jan 18 2021 Uri Lublin <uril@redhat.com> - 9.0-8
|
||||||
|
- Disable default grab sequence in kiosk mode
|
||||||
|
Resolves: rhbz#1893584
|
||||||
|
|
||||||
|
* Mon Jan 11 2021 Uri Lublin <uril@redhat.com> - 9.0-7
|
||||||
|
- Fix some zoom hotkeys issues
|
||||||
|
Resolves: rhbz#1791261
|
||||||
|
|
||||||
|
* Tue Dec 22 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 9.0-6
|
||||||
|
- Add back support for DATA storage domains.
|
||||||
|
Resolves: rhbz#1835640
|
||||||
|
|
||||||
|
* Thu Dec 03 2020 Uri Lublin <uril@redhat.com> - 9.0-5
|
||||||
|
- More specific key accelerator description for cursor release
|
||||||
|
Resolves: rhbz#1548371
|
||||||
|
- Report detailed error when file transfer fails
|
||||||
|
Resolves: rhbz#1753563
|
||||||
|
- Update copyright year in "about ui"
|
||||||
|
Resolves: rhbz#1848267
|
||||||
|
- Show an error dialog upon vnc-error
|
||||||
|
Resolves: rhbz#1448151
|
||||||
|
- Fix warning by Coverity
|
||||||
|
Resolves: rhbz#1876719
|
||||||
|
|
||||||
* Fri Aug 28 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 9.0-4
|
* Fri Aug 28 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 9.0-4
|
||||||
- Revert support for DATA storage domains temporarily.
|
- Revert support for DATA storage domains temporarily.
|
||||||
Resolves: rhbz#1873549
|
Resolves: rhbz#1873549
|
||||||
|
Loading…
Reference in New Issue
Block a user