summaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-08-02 08:17:25 +1000
committerGitHub <[email protected]>2018-08-02 08:17:25 +1000
commit4cc0855f21a2704314aa7b8973ceae7a8b463a1a (patch)
tree92d5b04c01c2da2bce20819ade8ed834bf2e420c /sway/tree/view.c
parentf078f7fdfa8c1b2549178b8137c6731c2fff6d3f (diff)
parent46cfa8ff56acff0139b2e24300cbc3ea19da723f (diff)
Merge pull request #2264 from ianyfan/ipc
IPC Events (1.0)
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 8f54cc11..48b39e80 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -864,6 +864,8 @@ void view_update_title(struct sway_view *view, bool force) {
// Update title after the global font height is updated
container_update_title_textures(view->swayc);
+
+ ipc_event_window(view->swayc, "title");
}
static bool find_by_mark_iterator(struct sway_container *con,
@@ -886,6 +888,7 @@ bool view_find_and_unmark(char *mark) {
free(view_mark);
list_del(view->marks, i);
view_update_marks_textures(view);
+ ipc_event_window(container, "mark");
return true;
}
}
@@ -893,11 +896,10 @@ bool view_find_and_unmark(char *mark) {
}
void view_clear_marks(struct sway_view *view) {
- for (int i = 0; i < view->marks->length; ++i) {
- free(view->marks->items[i]);
+ while (view->marks->length) {
+ list_del(view->marks, 0);
+ ipc_event_window(view->swayc, "mark");
}
- list_free(view->marks);
- view->marks = create_list();
}
bool view_has_mark(struct sway_view *view, char *mark) {
@@ -910,6 +912,11 @@ bool view_has_mark(struct sway_view *view, char *mark) {
return false;
}
+void view_add_mark(struct sway_view *view, char *mark) {
+ list_add(view->marks, strdup(mark));
+ ipc_event_window(view->swayc, "mark");
+}
+
static void update_marks_texture(struct sway_view *view,
struct wlr_texture **texture, struct border_colors *class) {
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);