summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-25 15:05:10 +0000
committerDana Jansens <danakj@orodu.net>2007-03-25 15:05:10 +0000
commit20f4d7fd44a268c1f461495f8c4c8f269aa0f292 (patch)
treea96196d3db3e7b9a952f76486d8a0adc1658c9b6
parenteb2a0feb0154e86a1c6c117fd0f6d1a18959b694 (diff)
when opening the client menu with a key, open it at the window's top left corner. is this clever or dumb?
-rw-r--r--openbox/action.c14
-rw-r--r--openbox/action.h4
2 files changed, 13 insertions, 5 deletions
diff --git a/openbox/action.c b/openbox/action.c
index 4fd86d30..4187c262 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -1013,7 +1013,7 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
}
void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
- guint state, guint button, gint x, gint y, Time time,
+ guint state, gint button, gint x, gint y, Time time,
gboolean cancel, gboolean done)
{
GSList *it;
@@ -1621,8 +1621,16 @@ void action_exit(union ActionData *data)
void action_showmenu(union ActionData *data)
{
if (data->showmenu.name) {
- menu_show(data->showmenu.name, data->any.x, data->any.y,
- data->showmenu.any.c);
+ gint x, y;
+ ObClient *c = data->showmenu.any.c;
+ if (data->any.button == -1 && c) {
+ x = c->frame->area.x + c->frame->size.left;
+ y = c->frame->area.y + c->frame->size.top;
+ } else {
+ x = data->any.x;
+ y = data->any.y;
+ }
+ menu_show(data->showmenu.name, x, y, c);
}
}
diff --git a/openbox/action.h b/openbox/action.h
index b1bc081f..26ae55d5 100644
--- a/openbox/action.h
+++ b/openbox/action.h
@@ -212,7 +212,7 @@ ObAction* action_copy(const ObAction *a);
affects interactive actions, but should generally always be FALSE.
*/
void action_run_list(GSList *acts, struct _ObClient *c, ObFrameContext context,
- guint state, guint button, gint x, gint y, Time time,
+ guint state, gint button, gint x, gint y, Time time,
gboolean cancel, gboolean done);
#define action_run_mouse(a, c, n, s, b, x, y, t) \
@@ -222,7 +222,7 @@ void action_run_list(GSList *acts, struct _ObClient *c, ObFrameContext context,
action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, t, n, d)
#define action_run_key(a, c, s, x, y, t) \
- action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, 0, x, y, t, FALSE, FALSE)
+ action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, -1, x, y, t, FALSE, FALSE)
#define action_run(a, c, s, t) \
action_run_list(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, t, FALSE, FALSE)