[mutter] frames: Pass MetaFrameType into ensure_layout



commit 9e199e6350086558eff3caa7881ae115a34fb1bb
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Dec 31 21:40:57 2014 -0800

    frames: Pass MetaFrameType into ensure_layout
    
    All the callers already have it, so don't make us fetch it again.

 src/ui/frames.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 39e8706..7acdcf7 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -69,9 +69,6 @@ static void meta_frames_calc_geometry (MetaFrames        *frames,
                                        MetaUIFrame         *frame,
                                        MetaFrameGeometry *fgeom);
 
-static void meta_frames_ensure_layout (MetaFrames      *frames,
-                                       MetaUIFrame     *frame);
-
 static MetaUIFrame* meta_frames_lookup_window (MetaFrames *frames,
                                                Window      xwindow);
 
@@ -377,23 +374,17 @@ meta_frames_style_updated  (GtkWidget *widget)
 }
 
 static void
-meta_frames_ensure_layout (MetaFrames  *frames,
-                           MetaUIFrame *frame)
+meta_frames_ensure_layout (MetaFrames     *frames,
+                           MetaUIFrame    *frame,
+                           MetaFrameType   type)
 {
   GtkWidget *widget;
-  MetaFrameFlags flags;
-  MetaFrameType type;
   MetaFrameLayout *layout;
 
   widget = GTK_WIDGET (frames);
 
   g_return_if_fail (gtk_widget_get_realized (widget));
 
-  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
-                 META_CORE_GET_FRAME_FLAGS, &flags,
-                 META_CORE_GET_FRAME_TYPE, &type,
-                 META_CORE_GET_END);
-
   layout = meta_theme_get_frame_layout (meta_theme_get_default (), type);
 
   if (layout != frame->cache_layout)
@@ -473,7 +464,7 @@ meta_frames_calc_geometry (MetaFrames        *frames,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_END);
 
-  meta_frames_ensure_layout (frames, frame);
+  meta_frames_ensure_layout (frames, frame, type);
 
   meta_prefs_get_button_layout (&button_layout);
 
@@ -638,7 +629,7 @@ meta_ui_frame_get_borders (MetaFrames *frames,
 
   g_return_if_fail (type < META_FRAME_TYPE_LAST);
 
-  meta_frames_ensure_layout (frames, frame);
+  meta_frames_ensure_layout (frames, frame, type);
 
   /* We can't get the full geometry, because that depends on
    * the client window size and probably we're being called
@@ -1740,7 +1731,7 @@ meta_frames_paint (MetaFrames   *frames,
                  META_CORE_GET_CLIENT_HEIGHT, &h,
                  META_CORE_GET_END);
 
-  meta_frames_ensure_layout (frames, frame);
+  meta_frames_ensure_layout (frames, frame, type);
 
   meta_prefs_get_button_layout (&button_layout);
 


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