[libdazzle] app-window: use dzl_clear_source()



commit 4f9a03bd64d94a19238632899afd89573173e600
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 25 15:30:25 2018 -0700

    app-window: use dzl_clear_source()

 src/app/dzl-application-window.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/app/dzl-application-window.c b/src/app/dzl-application-window.c
index 7e2939d..84a0aad 100644
--- a/src/app/dzl-application-window.c
+++ b/src/app/dzl-application-window.c
@@ -245,11 +245,7 @@ dzl_application_window_real_set_fullscreen (DzlApplicationWindow *self,
 
   priv->fullscreen = fullscreen;
 
-  if (priv->fullscreen_source != 0)
-    {
-      g_source_remove (priv->fullscreen_source);
-      priv->fullscreen_source = 0;
-    }
+  dzl_clear_source (&priv->fullscreen_source);
 
   if (priv->fullscreen)
     {
@@ -308,11 +304,7 @@ dzl_application_window_set_focus (GtkWindow *window,
       if (dzl_gtk_widget_is_ancestor_or_relative (widget, GTK_WIDGET (priv->titlebar_revealer)))
         {
           /* Disable transition while the revealer is focused */
-          if (priv->fullscreen_reveal_source != 0)
-            {
-              g_source_remove (priv->fullscreen_reveal_source);
-              priv->fullscreen_reveal_source = 0;
-            }
+          dzl_clear_source (&priv->fullscreen_reveal_source);
 
           /* If this was just focused, we might need to make it visible */
           gtk_revealer_set_reveal_child (priv->titlebar_revealer, TRUE);
@@ -323,11 +315,7 @@ dzl_application_window_set_focus (GtkWindow *window,
            * the titlebar immediately to get out of the users way.
            */
           gtk_revealer_set_reveal_child (priv->titlebar_revealer, FALSE);
-          if (priv->fullscreen_reveal_source != 0)
-            {
-              g_source_remove (priv->fullscreen_reveal_source);
-              priv->fullscreen_reveal_source = 0;
-            }
+          dzl_clear_source (&priv->fullscreen_reveal_source);
         }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]