6505c36ecc
virtman-netstats-fix.diff virtman-finish-button-fix.diff virtman-shutoff-fix.diff virtman-set-has-window-fix.diff virtman-grep-fix.diff virtman-no-cd-present-fix.diff virtman-resize-menu-fix.diff virtman-vcpu-count-fix.diff virtman-storage-pool-fix.diff virtman-domain-name-fix.diff virtman-unapplied-changes-fix.diff virtman-details-fix.diff virtman-delete-fix.diff virtman-collidelist-fix.diff virtman-char-device-mode-fix.diff virtinst-hv-version-fix.diff virtinst-initrd-inject-fix.diff virtinst-initrd-inject2-fix.diff virtinst-no-volume-fix.diff virtinst-prompts-fix.diff virtinst-cpu-model-name-fix.diff virtinst-xml-clear-fix.diff virtinst-remote-storage-fix.diff virtinst-error-message-fix.diff virtinst-typo-fix.diff virtinst-cdrom.diff virtinst-storage-ocfs2.diff OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=63
74 lines
2.5 KiB
Diff
74 lines
2.5 KiB
Diff
|
|
Subject: autodrawer: Make it work on RHEL6
|
|
From: Cole Robinson crobinso@redhat.com Tue Aug 2 12:54:21 2011 -0400
|
|
Date: Tue Aug 2 12:55:02 2011 -0400:
|
|
Git: 347b02b29fbe984f63c05f705d76ef95b3545c96
|
|
|
|
|
|
Index: virt-manager-0.9.0/src/virtManager/autodrawer.py
|
|
===================================================================
|
|
--- virt-manager-0.9.0.orig/src/virtManager/autodrawer.py
|
|
+++ virt-manager-0.9.0/src/virtManager/autodrawer.py
|
|
@@ -27,6 +27,21 @@ import gtk
|
|
|
|
parentclass = gtk.VBox
|
|
|
|
+def _set_has_window(widget, val):
|
|
+ if hasattr(widget, "set_has_window"):
|
|
+ # Only available on gtk 2.18 or later
|
|
+ widget.set_has_window(val)
|
|
+ elif val:
|
|
+ widget.set_flags(widget.flags() & ~gtk.NO_WINDOW)
|
|
+ else:
|
|
+ widget.set_flags(widget.flags() | gtk.NO_WINDOW)
|
|
+
|
|
+def _is_toplevel(widget):
|
|
+ if hasattr(widget, "is_toplevel"):
|
|
+ # Only available on gtk 2.18 or later
|
|
+ return widget.is_toplevel()
|
|
+ return bool(widget.flags() & gtk.TOPLEVEL)
|
|
+
|
|
class OverBox(parentclass):
|
|
"""
|
|
Implementation of an overlapping box
|
|
@@ -44,7 +59,7 @@ class OverBox(parentclass):
|
|
self._fraction = 0
|
|
self.verticalOffset = 0
|
|
|
|
- self.set_has_window(True)
|
|
+ _set_has_window(self, True)
|
|
|
|
####################
|
|
# Internal helpers #
|
|
@@ -418,7 +433,7 @@ class AutoDrawer(Drawer):
|
|
|
|
def _update(self, do_immediate):
|
|
toplevel = self.get_toplevel()
|
|
- if not toplevel or not toplevel.is_toplevel():
|
|
+ if not toplevel or not _is_toplevel(toplevel):
|
|
# The autoDrawer cannot function properly without a toplevel.
|
|
return
|
|
|
|
@@ -535,10 +550,10 @@ class AutoDrawer(Drawer):
|
|
def _on_hierarchy_changed(self, oldTopLevel, ignore):
|
|
newTopLevel = self.get_toplevel()
|
|
|
|
- if oldTopLevel and oldTopLevel.is_toplevel():
|
|
+ if oldTopLevel and _is_toplevel(oldTopLevel):
|
|
oldTopLevel.disconnect_by_func(self._set_focus)
|
|
|
|
- if newTopLevel and newTopLevel.is_toplevel():
|
|
+ if newTopLevel and _is_toplevel(newTopLevel):
|
|
newTopLevel.connect_after("set_focus", self._set_focus)
|
|
|
|
self._update(True)
|
|
@@ -589,7 +604,7 @@ class AutoDrawer(Drawer):
|
|
|
|
def drawer_close(self):
|
|
toplevel = self.get_toplevel()
|
|
- if not toplevel or not toplevel.is_toplevel():
|
|
+ if not toplevel or not _is_toplevel(toplevel):
|
|
# The autoDrawer cannot function properly without a toplevel.
|
|
return
|
|
|