Pass the GravityPoint as const* instead of by value
authorMikael Magnusson <mikachu@gmail.com>
Mon, 6 Oct 2014 19:54:16 +0000 (21:54 +0200)
committerMikael Magnusson <mikachu@gmail.com>
Sat, 11 Oct 2014 00:13:49 +0000 (02:13 +0200)
openbox/actions/showmenu.c
openbox/menu.c
openbox/menu.h
openbox/menuframe.c
openbox/menuframe.h
openbox/screen.c
openbox/screen.h

index 13afe22..8151db5 100644 (file)
@@ -115,7 +115,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
     /* you cannot call ShowMenu from inside a menu */
     if (data->uact != OB_USER_ACTION_MENU_SELECTION && o->name)
 
     /* you cannot call ShowMenu from inside a menu */
     if (data->uact != OB_USER_ACTION_MENU_SELECTION && o->name)
-        menu_show(o->name, position, monitor,
+        menu_show(o->name, &position, monitor,
                   data->button != 0, o->use_position, data->client);
 
     return FALSE;
                   data->button != 0, o->use_position, data->client);
 
     return FALSE;
index b917a59..ae69acb 100644 (file)
@@ -457,7 +457,7 @@ static gboolean menu_hide_delay_func(gpointer data)
     return FALSE; /* no repeat */
 }
 
     return FALSE; /* no repeat */
 }
 
-void menu_show(gchar *name, GravityPoint pos, gint monitor,
+void menu_show(gchar *name, const GravityPoint *pos, gint monitor,
                gboolean mouse, gboolean user_positioned, ObClient *client)
 {
     ObMenu *self;
                gboolean mouse, gboolean user_positioned, ObClient *client)
 {
     ObMenu *self;
index d9de36a..3f5d024 100644 (file)
@@ -181,7 +181,7 @@ void menu_clear_pipe_caches(void);
 
 void menu_show_all_shortcuts(ObMenu *self, gboolean show);
 
 
 void menu_show_all_shortcuts(ObMenu *self, gboolean show);
 
-void menu_show(gchar *name, GravityPoint pos, gint monitor,
+void menu_show(gchar *name, const GravityPoint *pos, gint monitor,
                gboolean mouse, gboolean user_positioned,
                struct _ObClient *client);
 gboolean menu_hide_delay_reached(void);
                gboolean mouse, gboolean user_positioned,
                struct _ObClient *client);
 gboolean menu_hide_delay_reached(void);
index 0c363e7..c390c07 100644 (file)
@@ -232,7 +232,7 @@ void menu_frame_move(ObMenuFrame *self, gint x, gint y)
     XMoveWindow(obt_display, self->window, self->area.x, self->area.y);
 }
 
     XMoveWindow(obt_display, self->window, self->area.x, self->area.y);
 }
 
-static void menu_frame_place_topmenu(ObMenuFrame *self, GravityPoint *pos,
+static void menu_frame_place_topmenu(ObMenuFrame *self, const GravityPoint *pos,
                                      gint *x, gint *y, gint monitor,
                                      gboolean user_positioned)
 {
                                      gint *x, gint *y, gint monitor,
                                      gboolean user_positioned)
 {
@@ -997,7 +997,7 @@ static gboolean menu_frame_show(ObMenuFrame *self)
     return TRUE;
 }
 
     return TRUE;
 }
 
-gboolean menu_frame_show_topmenu(ObMenuFrame *self, GravityPoint pos,
+gboolean menu_frame_show_topmenu(ObMenuFrame *self, const GravityPoint *pos,
                                  gint monitor, gboolean mouse,
                                  gboolean user_positioned)
 {
                                  gint monitor, gboolean mouse,
                                  gboolean user_positioned)
 {
@@ -1010,11 +1010,11 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, GravityPoint pos,
         return FALSE;
 
     if (self->menu->place_func) {
         return FALSE;
 
     if (self->menu->place_func) {
-        x = pos.x.pos;
-        y = pos.y.pos;
+        x = pos->x.pos;
+        y = pos->y.pos;
         self->menu->place_func(self, &x, &y, mouse, self->menu->data);
     } else {
         self->menu->place_func(self, &x, &y, mouse, self->menu->data);
     } else {
-        menu_frame_place_topmenu(self, &pos, &x, &y, monitor,
+        menu_frame_place_topmenu(self, pos, &x, &y, monitor,
                                  user_positioned);
     }
 
                                  user_positioned);
     }
 
index 780290b..7b295b6 100644 (file)
@@ -120,7 +120,7 @@ void menu_frame_move(ObMenuFrame *self, gint x, gint y);
 void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
                                gint *dx, gint *dy);
 
 void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
                                gint *dx, gint *dy);
 
-gboolean menu_frame_show_topmenu(ObMenuFrame *self, GravityPoint pos,
+gboolean menu_frame_show_topmenu(ObMenuFrame *self, const GravityPoint *pos,
                                  gint monitor, gboolean mouse,
                                  gboolean user_positioned);
 gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent,
                                  gint monitor, gboolean mouse,
                                  gboolean user_positioned);
 gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent,
index 4b75b3e..e758ada 100644 (file)
@@ -1930,7 +1930,7 @@ gboolean screen_compare_desktops(guint a, guint b)
 }
 
 void screen_apply_gravity_point(gint *x, gint *y, gint width, gint height,
 }
 
 void screen_apply_gravity_point(gint *x, gint *y, gint width, gint height,
-                                GravityPoint *position, const Rect *area)
+                                const GravityPoint *position, const Rect *area)
 {
     if (position->x.center)
         *x = area->width / 2 - width / 2;
 {
     if (position->x.center)
         *x = area->width / 2 - width / 2;
index 56fa6c9..6c26ce8 100644 (file)
@@ -186,5 +186,5 @@ gboolean screen_compare_desktops(guint a, guint b);
  * width and height are the size of the object being placed, used for
  * aligning to right/bottom edges of the area. */
 void screen_apply_gravity_point(gint *x, gint *y, gint width, gint height,
  * width and height are the size of the object being placed, used for
  * aligning to right/bottom edges of the area. */
 void screen_apply_gravity_point(gint *x, gint *y, gint width, gint height,
-                                GravityPoint *position, const Rect *area);
+                                const GravityPoint *position, const Rect *area);
 #endif
 #endif