Merge pull request #3797 from acheronfail/feat/add-window-type-ipc
feat: add window_type to ipc response
This commit is contained in:
commit
8fdc38d25f
30
src/ipc.c
30
src/ipc.c
|
@ -528,6 +528,36 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||||
else
|
else
|
||||||
y(null);
|
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) {
|
if (con->window && !inplace_restart) {
|
||||||
/* Window properties are useless to preserve when restarting because
|
/* Window properties are useless to preserve when restarting because
|
||||||
* they will be queried again anyway. However, for i3-save-tree(1),
|
* they will be queried again anyway. However, for i3-save-tree(1),
|
||||||
|
|
|
@ -53,6 +53,7 @@ my $expected = {
|
||||||
name => 'root',
|
name => 'root',
|
||||||
orientation => $ignore,
|
orientation => $ignore,
|
||||||
type => 'root',
|
type => 'root',
|
||||||
|
window_type => undef,
|
||||||
id => $ignore,
|
id => $ignore,
|
||||||
rect => $ignore,
|
rect => $ignore,
|
||||||
deco_rect => $ignore,
|
deco_rect => $ignore,
|
||||||
|
|
Loading…
Reference in New Issue