Skip to content

Commit

Permalink
Add support for XIconifyWindow and unminimizng
Browse files Browse the repository at this point in the history
  • Loading branch information
nwwdles committed Dec 10, 2019
1 parent df7c6cc commit 2ddc151
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bspwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ void setup(void)
GETATOM(WM_STATE)
GETATOM(WM_DELETE_WINDOW)
GETATOM(WM_TAKE_FOCUS)
GETATOM(WM_CHANGE_STATE)
#undef GETATOM

const xcb_query_extension_reply_t *qep = xcb_get_extension_data(dpy, &xcb_randr_id);
Expand Down
1 change: 1 addition & 0 deletions src/bspwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct {
xcb_atom_t WM_STATE;
xcb_atom_t WM_TAKE_FOCUS;
xcb_atom_t WM_DELETE_WINDOW;
xcb_atom_t WM_CHANGE_STATE;
int exit_status;

bool auto_raise;
Expand Down
10 changes: 10 additions & 0 deletions src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ void client_message(xcb_generic_event_t *evt)
loc.node == mon->desk->focus) {
return;
}
set_hidden(loc.monitor, loc.desktop, loc.node, false);
arrange(loc.monitor, loc.desktop);
focus_node(loc.monitor, loc.desktop, loc.node);
} else if (e->type == ewmh->_NET_WM_DESKTOP) {
coordinates_t dloc;
Expand All @@ -335,6 +337,14 @@ void client_message(xcb_generic_event_t *evt)
}
} else if (e->type == ewmh->_NET_CLOSE_WINDOW) {
close_node(loc.node);
} else if (e->type == WM_CHANGE_STATE) {
if (e->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC || e->data.data32[0] == XCB_ICCCM_WM_STATE_WITHDRAWN) {
set_hidden(loc.monitor, loc.desktop, loc.node, true);
arrange(loc.monitor, loc.desktop);
} else if (e->data.data32[0] == XCB_ICCCM_WM_STATE_NORMAL) {
set_hidden(loc.monitor, loc.desktop, loc.node, false);
arrange(loc.monitor, loc.desktop);
}
}
}

Expand Down

0 comments on commit 2ddc151

Please sign in to comment.