gnu: Fix virt-manager for systems with no GTK cursor.

* gnu/packages/patches/virt-manager-fix-gtk-cursor-theme-backtace.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register file.
* gnu/packages/virtualization.scm (virt-manager)[source]: Use it.

Change-Id: I4db2015a5d4ac3eca3cfa5d3eec20b357c2d3ff9
Signed-off-by: Leo Famulari <leo@famulari.name>
This commit is contained in:
Karl Hallsby 2024-06-28 12:11:37 -05:00 committed by Leo Famulari
parent a800c49fb7
commit 6cfc88e3be
No known key found for this signature in database
GPG key ID: 6AAC1963757F47FF
3 changed files with 44 additions and 1 deletions

View file

@ -2218,6 +2218,7 @@ dist_patch_DATA = \
%D%/packages/patches/vinagre-newer-freerdp.patch \
%D%/packages/patches/vinagre-newer-rdp-parameters.patch \
%D%/packages/patches/virtuoso-ose-remove-pre-built-jar-files.patch \
%D%/packages/patches/virt-manager-fix-gtk-cursor-theme-backtace.patch \
%D%/packages/patches/vsearch-unbundle-cityhash.patch \
%D%/packages/patches/vte-CVE-2012-2738-pt1.patch \
%D%/packages/patches/vte-CVE-2012-2738-pt2.patch \

View file

@ -0,0 +1,40 @@
This patch fixes an issue in virt-manager 4.1.0 where it errors and returns a
stack trace. Namely, Gdk.Cursor.new_from_name yields a "constructor returned
NULL" error, which causes a "'NoneType' object has no attribute 'conn'" error
later.
See the upstream bug report for more information:
https://github.com/virt-manager/virt-manager/issues/479
Patch copied from upstream source repository:
https://github.com/virt-manager/virt-manager/commit/cc4a39ea94f42bc92765eb3bb56e2b7f9198be67
From cc4a39ea94f42bc92765eb3bb56e2b7f9198be67 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 19 Jan 2023 11:13:56 -0500
Subject: [PATCH] asyncjob: Fix backtrace when no cursor theme installed
Fixes: https://github.com/virt-manager/virt-manager/issues/479
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
virtManager/asyncjob.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py
index 32d9c0a16..46692acea 100644
--- a/virtManager/asyncjob.py
+++ b/virtManager/asyncjob.py
@@ -265,9 +265,7 @@ def run(self):
self.topwin.present()
if not self.cancel_cb and self.show_progress:
- gdk_window = self.topwin.get_window()
- gdk_window.set_cursor(
- Gdk.Cursor.new_from_name(gdk_window.get_display(), "progress"))
+ self._set_cursor("progress")
self._bg_thread.start()

View file

@ -33,6 +33,7 @@
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2023, 2024 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -1663,7 +1664,8 @@ (define-public virt-manager
version ".tar.gz"))
(sha256
(base32
"18lhlnd3gmyzhbnjc16gdyzhjcd33prlxnca4xlidiidngbq21lm"))))
"18lhlnd3gmyzhbnjc16gdyzhjcd33prlxnca4xlidiidngbq21lm"))
(patches (search-patches "virt-manager-fix-gtk-cursor-theme-backtace.patch"))))
(build-system python-build-system)
(arguments
(list #:use-setuptools? #f ; uses custom distutils 'install' command