aboutsummaryrefslogtreecommitdiff
path: root/include/swaybar
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-30 17:45:43 -0500
committerGitHub <noreply@github.com>2017-08-30 17:45:43 -0500
commit82d6afc91d270f3761588b54a46b7f8fbbacaa3f (patch)
treedf50d6f095cbeeb5256527245c5e1adeb51b6860 /include/swaybar
parent7553103e345c6fb65b18cf5bc18a60218f810b77 (diff)
parent2b927685cae73cb4e29e5c83f1fad5c906cb7857 (diff)
Merge pull request #1336 from akokshar/master
click_events
Diffstat (limited to 'include/swaybar')
-rw-r--r--include/swaybar/bar.h1
-rw-r--r--include/swaybar/status_line.h10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h
index 010e1f84..50d36e76 100644
--- a/include/swaybar/bar.h
+++ b/include/swaybar/bar.h
@@ -14,6 +14,7 @@ struct bar {
int ipc_event_socketfd;
int ipc_socketfd;
int status_read_fd;
+ int status_write_fd;
pid_t status_command_pid;
};
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h
index 9b77e8a7..0664ddee 100644
--- a/include/swaybar/status_line.h
+++ b/include/swaybar/status_line.h
@@ -13,6 +13,7 @@ struct status_line {
list_t *block_line;
const char *text_line;
command_protocol protocol;
+ bool click_events;
};
struct status_block {
@@ -31,6 +32,10 @@ struct status_block {
int border_bottom;
int border_left;
int border_right;
+
+ // Set during rendering
+ int x;
+ int width;
};
/**
@@ -44,6 +49,11 @@ struct status_line *init_status_line();
bool handle_status_line(struct bar *bar);
/**
+ * Handle mouse clicks.
+ */
+bool status_line_mouse_event(struct bar *bar, int x, int y, uint32_t button);
+
+/**
* Free status line struct.
*/
void free_status_line(struct status_line *line);