toggle_locked
Toggle the locked state of the current window (locked windows will not respond to the 'close' message).
+ toggle_visibility
+ Toggle the visibility of all the managed windows.
+
close
Close the focused window.
.B close
message).
.TP
+.BI toggle_visibility
+Toggle the visibility of all the managed windows.
+.TP
.BI close
Close the focused window.
.TP
get_pointer_position(&pointer_position);
last_entered = XCB_NONE;
split_mode = MODE_AUTOMATIC;
+ visible = true;
}
int main(int argc, char *argv[])
xcb_point_t pointer_position;
xcb_window_t last_entered;
+bool visible;
bool running;
void register_events(void);
} else if (strcmp(cmd, "toggle_locked") == 0) {
if (mon->desk->focus != NULL)
toggle_locked(mon->desk->focus->client);
+ } else if (strcmp(cmd, "toggle_visibility") == 0) {
+ toggle_visibility();
} else if (strcmp(cmd, "pad") == 0) {
char *name = strtok(NULL, TOK_SEP);
if (name != NULL) {
PRINTF("select desktop %s\n", d->name);
- node_t *n = first_extrema(d->root);
+ if (visible) {
+ node_t *n = first_extrema(d->root);
- while (n != NULL) {
- window_show(n->client->window);
- n = next_leaf(n);
- }
+ while (n != NULL) {
+ window_show(n->client->window);
+ n = next_leaf(n);
+ }
- n = first_extrema(mon->desk->root);
+ n = first_extrema(mon->desk->root);
- while (n != NULL) {
- window_hide(n->client->window);
- n = next_leaf(n);
+ while (n != NULL) {
+ window_hide(n->client->window);
+ n = next_leaf(n);
+ }
}
mon->last_desk = mon->desk;
arrange(m, d);
- if (d == m->desk)
+ if (d == m->desk && visible)
window_show(c->window);
if (takes_focus)
{
window_set_visibility(win, true);
}
+
+void toggle_visibility(void)
+{
+ uint32_t values_off[] = {CLIENT_EVENT_MASK & ~XCB_EVENT_MASK_ENTER_WINDOW};
+ uint32_t values_on[] = {CLIENT_EVENT_MASK};
+ visible = !visible;
+ for (node_t *n = first_extrema(mon->desk->root); n != NULL; n = next_leaf(n)) {
+ xcb_window_t win = n->client->window;
+ xcb_change_window_attributes(dpy, win, XCB_CW_EVENT_MASK, values_off);
+ window_set_visibility(win, visible);
+ xcb_change_window_attributes(dpy, win, XCB_CW_EVENT_MASK, values_on);
+ }
+}
void window_set_visibility(xcb_window_t, bool);
void window_hide(xcb_window_t);
void window_show(xcb_window_t);
+void toggle_visibility(void);
uint32_t get_main_border_color(client_t *, bool, bool);
void update_floating_rectangle(client_t *);
void list_windows(char *);