[rhel7/master] Don't call BusyCursor before Gdk is setup (#1078868)

Martin Kolman mkolman at redhat.com
Thu Sep 18 08:50:44 UTC 2014


On Wed, 2014-09-17 at 16:06 -0700, Brian C. Lane wrote:
> The setup method is too early, the Gdk.get_default_root_window call
> fails. So Remove the call to busyCursor, but just in case also silently
> return if busyCursor or unbusyCursor doesn't get a window.
What about logging it as warning/error ? Not having a window in this
case is always an error - either we are calling it too early or GTK is
blowing up.
> ---
>  pyanaconda/ui/gui/__init__.py | 2 --
>  pyanaconda/ui/gui/utils.py    | 6 ++++++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
> index b64d983..efd3400 100644
> --- a/pyanaconda/ui/gui/__init__.py
> +++ b/pyanaconda/ui/gui/__init__.py
> @@ -301,8 +301,6 @@ class GraphicalUserInterface(UserInterface):
>          return isinstance(obj, StandaloneSpoke)
>  
>      def setup(self, data):
> -        busyCursor()
> -
>          self._actions = self.getActionClasses(self._list_hubs())
>          self.data = data
>  
> diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py
> index c0682ea..c4fd214 100644
> --- a/pyanaconda/ui/gui/utils.py
> +++ b/pyanaconda/ui/gui/utils.py
> @@ -175,10 +175,16 @@ def timed_action(delay=300, threshold=750, busy_cursor=True):
>  
>  def busyCursor():
>      window = Gdk.get_default_root_window()
> +    if not window:
> +        return
> +
>      window.set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
>  
>  def unbusyCursor():
>      window = Gdk.get_default_root_window()
> +    if not window:
> +        return
> +
>      window.set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW))
>  
>  @contextmanager




More information about the anaconda-patches mailing list