summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-01-19 16:40:28 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-01-19 10:19:01 -0500
commit9e30a82e250b5214c44593f5692f334b66f7aba3 (patch)
tree13aa32ed221e770a8b020ead1713e95fb932a9bc
parentcb108439d2cb2ea688391c2b2e0eff508bf5a6bd (diff)
desktop-shell: don't crash on menu
Add dummy menu callback function, so we don't crash after every time someone opens the menu. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
-rw-r--r--clients/desktop-shell.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 642e92a..f50f425 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -132,6 +132,12 @@ sigchild_handler(int s)
}
static void
+menu_func(struct window *window, int index, void *data)
+{
+ printf("Selected index %d from a panel menu.\n", index);
+}
+
+static void
show_menu(struct panel *panel, struct input *input, uint32_t time)
{
int32_t x, y;
@@ -142,7 +148,7 @@ show_menu(struct panel *panel, struct input *input, uint32_t time)
input_get_position(input, &x, &y);
window_show_menu(window_get_display(panel->window),
input, time, panel->window,
- x - 10, y - 10, NULL, entries, 4);
+ x - 10, y - 10, menu_func, entries, 4);
}
static void