Setup to receive mouse click events and log them

master
David Eklov 9 years ago
parent 5c4f52f953
commit 103954dd2b

@ -58,6 +58,10 @@ struct output *new_output(const char *name) {
return output; return output;
} }
static void mouse_button_notify(struct window *window, wl_fixed_t x, wl_fixed_t y, uint32_t button) {
sway_log(L_DEBUG, "Mouse button %d clicked at %d %d\n", button, x, y);
}
void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) { void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) {
/* initialize bar with default values */ /* initialize bar with default values */
bar_init(bar); bar_init(bar);
@ -92,6 +96,9 @@ void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) {
/* set font */ /* set font */
bar_output->window->font = bar->config->font; bar_output->window->font = bar->config->font;
/* set font */
bar_output->window->pointer_input.notify = mouse_button_notify;
/* set window height */ /* set window height */
set_window_height(bar_output->window, bar->config->height); set_window_height(bar_output->window, bar->config->height);
} }

Loading…
Cancel
Save