Merge pull request #2281 from pvsr/X11_click

Send clicks to swaybar blocks as X11 button ids
This commit is contained in:
emersion 2018-07-18 00:16:15 +01:00 committed by GitHub
commit 48b911a459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 6 deletions

View file

@ -16,11 +16,24 @@ struct swaybar_pointer {
int x, y;
};
enum x11_button {
NONE,
LEFT,
MIDDLE,
RIGHT,
SCROLL_UP,
SCROLL_DOWN,
SCROLL_LEFT,
SCROLL_RIGHT,
BACK,
FORWARD,
};
struct swaybar_hotspot {
struct wl_list link;
int x, y, width, height;
void (*callback)(struct swaybar_output *output,
int x, int y, uint32_t button, void *data);
int x, int y, enum x11_button button, void *data);
void (*destroy)(void *data);
void *data;
};

View file

@ -72,7 +72,9 @@ bool status_handle_readable(struct status_line *status);
void status_line_free(struct status_line *status);
bool i3bar_handle_readable(struct status_line *status);
void i3bar_block_send_click(struct status_line *status,
struct i3bar_block *block, int x, int y, uint32_t button);
struct i3bar_block *block, int x, int y, enum x11_button button);
void i3bar_block_free(struct i3bar_block *block);
enum x11_button wl_button_to_x11_button(uint32_t button);
enum x11_button wl_axis_to_x11_button(uint32_t axis, wl_fixed_t value);
#endif