ipc new window event

This commit is contained in:
Tony Crisci 2018-02-27 19:53:15 -05:00
parent 3c80498891
commit 02804584e5
3 changed files with 102 additions and 3 deletions

View file

@ -15,6 +15,7 @@
#include "sway/server.h"
#include "sway/view.h"
#include "sway/workspace.h"
#include "sway/ipc-server.h"
#include "log.h"
static list_t *bfs_queue;
@ -32,6 +33,11 @@ static list_t *get_bfs_queue() {
return bfs_queue;
}
static void notify_new_container(swayc_t *container) {
wl_signal_emit(&root_container.sway_root->events.new_container, container);
ipc_event_window(container, "new");
}
swayc_t *swayc_by_test(swayc_t *container,
bool (*test)(swayc_t *view, void *data), void *data) {
if (!container->children) {
@ -175,7 +181,7 @@ swayc_t *new_output(struct sway_output *sway_output) {
}
free(ws_name);
wl_signal_emit(&root_container.sway_root->events.new_container, output);
notify_new_container(output);
return output;
}
@ -197,7 +203,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
add_child(output, workspace);
sort_workspaces(output);
wl_signal_emit(&root_container.sway_root->events.new_container, workspace);
notify_new_container(workspace);
return workspace;
}
@ -222,7 +228,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) {
// Regular case, create as sibling of current container
add_sibling(sibling, swayc);
}
wl_signal_emit(&root_container.sway_root->events.new_container, swayc);
notify_new_container(swayc);
return swayc;
}