diff options
author | Ingo Bürk <admin@airblader.de> | 2019-11-29 08:16:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 08:16:57 +0100 |
commit | 8fdc38d25ff2dabf21463c39d29def955b02482c (patch) | |
tree | 919a513fa4a46f87b55643418af816747a4b7edd | |
parent | 1679bcc89a12efa7fe3172b83e3a2e7ef6fafae1 (diff) | |
parent | 46cf9fb91b09f0b9508d50ebae6fd0cad9e32aa9 (diff) | |
download | i3-8fdc38d25ff2dabf21463c39d29def955b02482c.tar.gz i3-8fdc38d25ff2dabf21463c39d29def955b02482c.zip |
Merge pull request #3797 from acheronfail/feat/add-window-type-ipc
feat: add window_type to ipc response
-rw-r--r-- | src/ipc.c | 30 | ||||
-rw-r--r-- | testcases/t/116-nestedcons.t | 1 |
2 files changed, 31 insertions, 0 deletions
@@ -528,6 +528,36 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) { else y(null); + ystr("window_type"); + if (con->window) { + if (con->window->window_type == A__NET_WM_WINDOW_TYPE_NORMAL) { + ystr("normal"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_DOCK) { + ystr("dock"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_DIALOG) { + ystr("dialog"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_UTILITY) { + ystr("utility"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_TOOLBAR) { + ystr("toolbar"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_SPLASH) { + ystr("splash"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_MENU) { + ystr("menu"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU) { + ystr("dropdown_menu"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_POPUP_MENU) { + ystr("popup_menu"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_TOOLTIP) { + ystr("tooltip"); + } else if (con->window->window_type == A__NET_WM_WINDOW_TYPE_NOTIFICATION) { + ystr("notification"); + } else { + ystr("unknown"); + } + } else + y(null); + if (con->window && !inplace_restart) { /* Window properties are useless to preserve when restarting because * they will be queried again anyway. However, for i3-save-tree(1), diff --git a/testcases/t/116-nestedcons.t b/testcases/t/116-nestedcons.t index 40ad6bb3..4f13b1e5 100644 --- a/testcases/t/116-nestedcons.t +++ b/testcases/t/116-nestedcons.t @@ -53,6 +53,7 @@ my $expected = { name => 'root', orientation => $ignore, type => 'root', + window_type => undef, id => $ignore, rect => $ignore, deco_rect => $ignore, |