leigh123linux pushed to muffin (f22). "build fix"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Apr 2 06:27:30 UTC 2015


>From 3da8e2e0ee7ffe11aa9146a53c3bb50ec7961455 Mon Sep 17 00:00:00 2001
From: leigh123linux <leigh123linux at googlemail.com>
Date: Thu, 2 Apr 2015 07:18:13 +0100
Subject: build fix


diff --git a/inlining_fix.patch b/inlining_fix.patch
new file mode 100644
index 0000000..5644c8a
--- /dev/null
+++ b/inlining_fix.patch
@@ -0,0 +1,237 @@
+From 1635e7560f801fec937eecd7881393f5624fc01c Mon Sep 17 00:00:00 2001
+From: Michael Webster <miketwebster at gmail.com>
+Date: Tue, 31 Mar 2015 18:13:42 -0400
+Subject: [PATCH] window.c, constraints.c - Duplicate the get_size_limits
+ function where needed, so inlining it works correctly.
+
+---
+ src/core/constraints.c    | 52 ++++++++++++++++++++++++++++----
+ src/core/window-private.h |  6 ----
+ src/core/window.c         | 76 ++++++++++++++++++++++++-----------------------
+ 3 files changed, 86 insertions(+), 48 deletions(-)
+
+diff --git a/src/core/constraints.c b/src/core/constraints.c
+index eede286..4efb695 100644
+--- a/src/core/constraints.c
++++ b/src/core/constraints.c
+@@ -211,6 +211,12 @@ static void unextend_by_frame            (MetaWindow *window,
+                                           MetaRectangle           *rect,
+                                           const MetaFrameBorders  *borders);
+ 
++static inline void get_size_limits   (const MetaWindow        *window,
++                                      const MetaFrameBorders  *borders,
++                                            gboolean           include_frame,
++                                            MetaRectangle     *min_size,
++                                            MetaRectangle     *max_size);
++
+ typedef gboolean (* ConstraintFunc) (MetaWindow         *window,
+                                      ConstraintInfo     *info,
+                                      ConstraintPriority  priority,
+@@ -773,6 +779,42 @@ unextend_by_frame (MetaWindow              *window,
+     }
+ }
+ 
++static inline void
++get_size_limits (const MetaWindow       *window,
++                 const MetaFrameBorders *borders,
++                       gboolean          include_frame,
++                       MetaRectangle    *min_size,
++                       MetaRectangle    *max_size)
++{
++  /* We pack the results into MetaRectangle structs just for convienience; we
++   * don't actually use the position of those rects.
++   */
++  min_size->width  = window->size_hints.min_width;
++  min_size->height = window->size_hints.min_height;
++  max_size->width  = window->size_hints.max_width;
++  max_size->height = window->size_hints.max_height;
++
++  if (include_frame)
++    {
++      int fw = borders->visible.left + borders->visible.right;
++      int fh = borders->visible.top + borders->visible.bottom;
++
++      min_size->width  += fw;
++      min_size->height += fh;
++      /* Do check to avoid overflow (e.g. max_size->width & max_size->height
++       * may be set to G_MAXINT by meta_set_normal_hints()).
++       */
++      if (max_size->width < (G_MAXINT - fw))
++        max_size->width += fw;
++      else
++        max_size->width = G_MAXINT;
++      if (max_size->height < (G_MAXINT - fh))
++        max_size->height += fh;
++      else
++        max_size->height = G_MAXINT;
++    }
++}
++
+ static gboolean
+ constrain_modal_dialog (MetaWindow         *window,
+                         ConstraintInfo     *info,
+@@ -904,7 +946,7 @@ constrain_maximization (MetaWindow         *window,
+   /* Check min size constraints; max size constraints are ignored for maximized
+    * windows, as per bug 327543.
+    */
+-  meta_window_get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
++  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
+   hminbad = target_size.width < min_size.width && window->maximized_horizontally;
+   vminbad = target_size.height < min_size.height && window->maximized_vertically;
+   if (hminbad || vminbad)
+@@ -1059,7 +1101,7 @@ constrain_tiling (MetaWindow         *window,
+   /* Check min size constraints; max size constraints are ignored as for
+    * maximized windows.
+    */
+-  meta_window_get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
++  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
+   hminbad = target_size.width < min_size.width;
+   vminbad = target_size.height < min_size.height;
+   if (hminbad || vminbad)
+@@ -1102,7 +1144,7 @@ constrain_fullscreen (MetaWindow         *window,
+ 
+   monitor = info->entire_monitor;
+ 
+-  meta_window_get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
++  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
+   too_big =   !meta_rectangle_could_fit_rect (&monitor, &min_size);
+   too_small = !meta_rectangle_could_fit_rect (&max_size, &monitor);
+   if (too_big || too_small)
+@@ -1212,7 +1254,7 @@ constrain_size_limits (MetaWindow         *window,
+     return TRUE;
+ 
+   /* Determine whether constraint is already satisfied; exit if it is */
+-  meta_window_get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
++  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
+   /* We ignore max-size limits for maximized windows; see #327543 */
+   if (window->maximized_horizontally)
+     max_size.width = MAX (max_size.width, info->current.width);
+@@ -1404,7 +1446,7 @@ do_screen_and_monitor_relative_constraints (
+ 
+   /* Determine whether constraint applies; exit if it doesn't */
+   how_far_it_can_be_smushed = info->current;
+-  meta_window_get_size_limits (window, info->borders, TRUE, &min_size, &max_size);
++  get_size_limits (window, info->borders, TRUE, &min_size, &max_size);
+   extend_by_frame (window, &info->current, info->borders);
+ 
+   if (info->action_type != ACTION_MOVE)
+diff --git a/src/core/window-private.h b/src/core/window-private.h
+index 001c013..9dd7156 100644
+--- a/src/core/window-private.h
++++ b/src/core/window-private.h
+@@ -770,12 +770,6 @@ gboolean meta_window_can_tile_top_bottom (MetaWindow *window);
+ gboolean meta_window_can_tile_corner         (MetaWindow *window);
+ MetaSide meta_window_get_tile_side (MetaWindow *window);
+ 
+-inline void meta_window_get_size_limits   (const MetaWindow        *window,
+-                                          const MetaFrameBorders  *borders,
+-                                          gboolean include_frame,
+-                                          MetaRectangle *min_size,
+-                                          MetaRectangle *max_size);
+-
+ void meta_window_compute_tile_match (MetaWindow *window);
+ 
+ gboolean meta_window_mouse_on_edge (MetaWindow *window,
+diff --git a/src/core/window.c b/src/core/window.c
+index 9f8809a..98e485b 100644
+--- a/src/core/window.c
++++ b/src/core/window.c
+@@ -9041,6 +9041,44 @@ get_mask_from_snap_keysym (MetaWindow *window)
+     return XkbKeysymToModifiers(window->display->xdisplay, pref[0]);
+ }
+ 
++static inline void
++get_size_limits (const MetaWindow       *window,
++                 const MetaFrameBorders *borders,
++                       gboolean          include_frame,
++                       MetaRectangle    *min_size,
++                       MetaRectangle    *max_size)
++{
++  /* We pack the results into MetaRectangle structs just for convienience; we
++   * don't actually use the position of those rects.
++   */
++  min_size->width  = window->size_hints.min_width;
++  min_size->height = window->size_hints.min_height;
++  max_size->width  = window->size_hints.max_width;
++  max_size->height = window->size_hints.max_height;
++
++  if (include_frame)
++    {
++      int fw = borders->visible.left + borders->visible.right;
++      int fh = borders->visible.top + borders->visible.bottom;
++
++      min_size->width  += fw;
++      min_size->height += fh;
++      /* Do check to avoid overflow (e.g. max_size->width & max_size->height
++       * may be set to G_MAXINT by meta_set_normal_hints()).
++       */
++      if (max_size->width < (G_MAXINT - fw))
++        max_size->width += fw;
++      else
++        max_size->width = G_MAXINT;
++      if (max_size->height < (G_MAXINT - fh))
++        max_size->height += fh;
++      else
++        max_size->height = G_MAXINT;
++    }
++}
++
++
++
+ static void
+ update_move (MetaWindow  *window,
+              gboolean     legacy_snap,
+@@ -9292,7 +9330,7 @@ update_move (MetaWindow  *window,
+     gboolean hminbad = FALSE;
+     gboolean vminbad = FALSE;
+     if (window->tile_mode != META_TILE_NONE) {
+-        meta_window_get_size_limits (window, NULL, FALSE, &min_size, &max_size);
++        get_size_limits (window, NULL, FALSE, &min_size, &max_size);
+         meta_window_get_current_tile_area (window, &target_size);
+         hminbad = target_size.width < min_size.width;
+         vminbad = target_size.height < min_size.height;
+@@ -11627,42 +11627,6 @@ meta_window_get_tile_type (MetaWindow *w
+     return window->tile_type;
+ }
+ 
+-inline void
+-meta_window_get_size_limits (const MetaWindow        *window,
+-                             const MetaFrameBorders *borders,
+-                                   gboolean          include_frame,
+-                                   MetaRectangle    *min_size,
+-                                   MetaRectangle    *max_size)
+-{
+-  /* We pack the results into MetaRectangle structs just for convienience; we
+-   * don't actually use the position of those rects.
+-   */
+-  min_size->width  = window->size_hints.min_width;
+-  min_size->height = window->size_hints.min_height;
+-  max_size->width  = window->size_hints.max_width;
+-  max_size->height = window->size_hints.max_height;
+-
+-  if (include_frame)
+-    {
+-      int fw = borders->visible.left + borders->visible.right;
+-      int fh = borders->visible.top + borders->visible.bottom;
+-
+-      min_size->width  += fw;
+-      min_size->height += fh;
+-      /* Do check to avoid overflow (e.g. max_size->width & max_size->height
+-       * may be set to G_MAXINT by meta_set_normal_hints()).
+-       */
+-      if (max_size->width < (G_MAXINT - fw))
+-        max_size->width += fw;
+-      else
+-        max_size->width = G_MAXINT;
+-      if (max_size->height < (G_MAXINT - fh))
+-        max_size->height += fh;
+-      else
+-        max_size->height = G_MAXINT;
+-    }
+-}
+-
+ HUDTileRestrictions
+ meta_window_get_tile_restrictions (MetaWindow *window)
+ {
+-- 
+2.1.4
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/muffin.git/commit/?h=f22&id=3da8e2e0ee7ffe11aa9146a53c3bb50ec7961455


More information about the scm-commits mailing list