[metacity] libmetacity: fix inverted button layout



commit c9483cacaed326ade6ae9f7ba00efc2604566688
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Oct 16 23:12:47 2016 +0300

    libmetacity: fix inverted button layout

 libmetacity/meta-button-layout.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libmetacity/meta-button-layout.c b/libmetacity/meta-button-layout.c
index 4679cbf..01a6045 100644
--- a/libmetacity/meta-button-layout.c
+++ b/libmetacity/meta-button-layout.c
@@ -189,14 +189,16 @@ meta_button_layout_new (const gchar *str,
       gint i;
 
       rtl_layout = g_new0 (MetaButtonLayout, 1);
+
       rtl_layout->left_buttons = g_new0 (MetaButton, layout->n_right_buttons);
-      rtl_layout->right_buttons = g_new0 (MetaButton, layout->n_left_buttons);
+      for (i = 0; i < layout->n_right_buttons; i++)
+        rtl_layout->left_buttons[i] = layout->right_buttons[layout->n_right_buttons - i - 1];
+      rtl_layout->n_left_buttons = layout->n_right_buttons;
 
+      rtl_layout->right_buttons = g_new0 (MetaButton, layout->n_left_buttons);
       for (i = 0; i < layout->n_left_buttons; i++)
-        rtl_layout->right_buttons[i] = rtl_layout->left_buttons[layout->n_left_buttons - i];
-
-      for (i = 0; i < layout->n_right_buttons; i++)
-        rtl_layout->left_buttons[i] = rtl_layout->right_buttons[layout->n_right_buttons - i];
+        rtl_layout->right_buttons[i] = layout->left_buttons[layout->n_left_buttons - i - 1];
+      rtl_layout->n_right_buttons = layout->n_left_buttons;
 
       meta_button_layout_free (layout);
 


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