spkp

Stacking wayland compositor
git clone git://git.z3bra.org/sp:kp.git
Log | Files | Refs

commit 628ab33aeafa8ccd566717c78759c9cd1c3ce493
parent 7206ecf40360ea2b96aad0104135c744bfd47ffc
Author: Willy Goiffon <dev@z3bra.org>
Date:   Fri, 13 Nov 2020 17:44:35 +0100

Add keybind to show the desktop

Diffstat:
Mcompositor.c | 18++++++++++++++++++
Mconfig.def.h | 1+
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/compositor.c b/compositor.c @@ -55,6 +55,8 @@ struct state { struct wlr_seat *seat; + int desktop; /* wether desktop is visible */ + int grabmode; double gx, gy; struct wlr_box grabbox; @@ -201,6 +203,7 @@ static struct window *underneath(struct state *, double, double); static void kb_terminate(struct state *, union keyarg *); static void kb_alttab(struct state *, union keyarg *); static void kb_exec(struct state *, union keyarg *); +static void kb_desktop(struct state *, union keyarg *); #include "config.h" @@ -1089,6 +1092,21 @@ kb_exec(struct state *server, union keyarg *arg) } } +/* + * Hide/show all windows on the desktop + */ +void +kb_desktop(struct state *server, union keyarg *arg) +{ + (void)arg; + struct window *w; + + server->desktop = !server->desktop; + wl_list_for_each(w, &server->windows, link) + w->mapped = !server->desktop; + +} + int main(int argc, char *argv[]) { diff --git a/config.def.h b/config.def.h @@ -15,4 +15,5 @@ struct key keys[] = { { ALT , XKB_KEY_Tab , kb_alttab , {.i = 0} }, { ALT|SHFT , XKB_KEY_Tab , kb_alttab , {.i = 1} }, { LOGO , XKB_KEY_Return, kb_exec , {.v = "alacritty"} }, + { LOGO , XKB_KEY_d , kb_desktop , {0 } }, };