[mutter] frames: Use an early return



commit c8432cc430d32b6659ebb0d3ba3d3d3660b87322
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Dec 31 22:42:31 2014 -0800

    frames: Use an early return
    
    To be more consistent with the rest of the code.

 src/ui/frames.c |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index fa56588..1603a6f 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -554,33 +554,34 @@ meta_frames_unmanage_window (MetaFrames *frames,
 
   frame = g_hash_table_lookup (frames->frames, &xwindow);
 
-  if (frame)
+  if (!frame)
     {
-      /* restore the cursor */
-      meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                                   frame->xwindow,
-                                   META_CURSOR_DEFAULT);
+      meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
+      return;
+    }
 
-      gdk_window_set_user_data (frame->window, NULL);
+  /* restore the cursor */
+  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+                               frame->xwindow,
+                               META_CURSOR_DEFAULT);
 
-      if (frames->last_motion_frame == frame)
-        frames->last_motion_frame = NULL;
+  gdk_window_set_user_data (frame->window, NULL);
 
-      g_hash_table_remove (frames->frames, &frame->xwindow);
+  if (frames->last_motion_frame == frame)
+    frames->last_motion_frame = NULL;
 
-      meta_style_info_unref (frame->style_info);
+  g_hash_table_remove (frames->frames, &frame->xwindow);
 
-      gdk_window_destroy (frame->window);
+  meta_style_info_unref (frame->style_info);
 
-      if (frame->text_layout)
-        g_object_unref (G_OBJECT (frame->text_layout));
+  gdk_window_destroy (frame->window);
 
-      g_free (frame->title);
+  if (frame->text_layout)
+    g_object_unref (G_OBJECT (frame->text_layout));
 
-      g_free (frame);
-    }
-  else
-    meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
+  g_free (frame->title);
+
+  g_free (frame);
 }
 
 static MetaUIFrame*


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