summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2014-10-06 21:54:16 +0200
committerMikael Magnusson <mikachu@gmail.com>2014-10-11 02:13:49 +0200
commit39dfb7458a75ca502fb0c18ec0f1a107f5d51249 (patch)
tree68775241fabce04d11b92f4e4731c27209fa911d
parentd3359676e49b558cb7c6e24ea889c037d044b79f (diff)
Pass the GravityPoint as const* instead of by value
-rw-r--r--openbox/actions/showmenu.c2
-rw-r--r--openbox/menu.c2
-rw-r--r--openbox/menu.h2
-rw-r--r--openbox/menuframe.c10
-rw-r--r--openbox/menuframe.h2
-rw-r--r--openbox/screen.c2
-rw-r--r--openbox/screen.h2
7 files changed, 11 insertions, 11 deletions
diff --git a/openbox/actions/showmenu.c b/openbox/actions/showmenu.c
index 13afe225..8151db5e 100644
--- a/openbox/actions/showmenu.c
+++ b/openbox/actions/showmenu.c
@@ -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)
- menu_show(o->name, position, monitor,
+ menu_show(o->name, &position, monitor,
data->button != 0, o->use_position, data->client);
return FALSE;
diff --git a/openbox/menu.c b/openbox/menu.c
index b917a59d..ae69acbb 100644
--- a/openbox/menu.c
+++ b/openbox/menu.c
@@ -457,7 +457,7 @@ static gboolean menu_hide_delay_func(gpointer data)
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;
diff --git a/openbox/menu.h b/openbox/menu.h
index d9de36ae..3f5d024a 100644
--- a/openbox/menu.h
+++ b/openbox/menu.h
@@ -181,7 +181,7 @@ void menu_clear_pipe_caches(void);
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);
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index 0c363e70..c390c078 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -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);
}
-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)
{
@@ -997,7 +997,7 @@ static gboolean menu_frame_show(ObMenuFrame *self)
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)
{
@@ -1010,11 +1010,11 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, GravityPoint pos,
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 {
- menu_frame_place_topmenu(self, &pos, &x, &y, monitor,
+ menu_frame_place_topmenu(self, pos, &x, &y, monitor,
user_positioned);
}
diff --git a/openbox/menuframe.h b/openbox/menuframe.h
index 780290ba..7b295b6f 100644
--- a/openbox/menuframe.h
+++ b/openbox/menuframe.h
@@ -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);
-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,
diff --git a/openbox/screen.c b/openbox/screen.c
index 4b75b3e7..e758ada1 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -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,
- GravityPoint *position, const Rect *area)
+ const GravityPoint *position, const Rect *area)
{
if (position->x.center)
*x = area->width / 2 - width / 2;
diff --git a/openbox/screen.h b/openbox/screen.h
index 56fa6c99..6c26ce89 100644
--- a/openbox/screen.h
+++ b/openbox/screen.h
@@ -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,
- GravityPoint *position, const Rect *area);
+ const GravityPoint *position, const Rect *area);
#endif