baseclass: Catch cursor error if icon missing (bz 1516588)

Debian users who installed virt-manager on a bare system found
that a missing cursor icon theme caused addhardware wizard to fail

https://bugzilla.redhat.com/show_bug.cgi?id=1516588
This commit is contained in:
Cole Robinson 2018-04-03 13:09:12 -04:00
parent b17c7565e2
commit 9a87a8d5ea

View File

@ -338,8 +338,15 @@ class vmmGObjectUI(vmmGObject):
gdk_window = topwin.get_window()
if not gdk_window:
return
cursor = Gdk.Cursor.new_from_name(gdk_window.get_display(), "default")
gdk_window.set_cursor(cursor)
try:
cursor = Gdk.Cursor.new_from_name(
gdk_window.get_display(), "default")
gdk_window.set_cursor(cursor)
except:
# If a cursor icon theme isn't installed this can cause errors
# https://bugzilla.redhat.com/show_bug.cgi?id=1516588
logging.debug("Error setting cursor", exc_info=True)
def _cleanup_on_conn_removed(self):
from .connmanager import vmmConnectionManager