commit 90e1c42

wf  ·  2026-07-05 15:30:00 +0000 UTC
parent 71bc1fa
Add unfocus command
6 files changed,  +23, -2
+4, -1
 1@@ -1,6 +1,6 @@
 2 .\" generated with Ronn-NG/v0.10.1
 3 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
 4-.TH "HOWLC" "1" "May 2026" ""
 5+.TH "HOWLC" "1" "July 2026" ""
 6 .SH "NAME"
 7 \fBhowlc\fR \- client to control the howl compositor
 8 .SH "SYNOPSIS"
 9@@ -76,6 +76,9 @@ $ howlc lower
10 .IP
11 $ howlc raise
12 .TP
13+\fBunfocus\fR
14+Unfocuces the currently focused window (if any)\.
15+.TP
16 \fBclose\fR
17 Closes the window\.
18 .IP
+3, -0
 1@@ -84,6 +84,9 @@ Most of the following (can be deduced logically) can take an optional window ID
 2 
 3     $ howlc raise
 4 
 5+  * `unfocus`:
 6+    Unfocuces the currently focused window (if any).
 7+
 8   * `close`:
 9     Closes the window.
10 
+1, -0
1@@ -15,6 +15,7 @@ enum cmd {
2 	cmd_raise,
3 	cmd_focus_prev,
4 	cmd_focus_next,
5+	cmd_unfocus,
6 	cmd_close,
7 	cmd_workspace,
8 	cmd_move_workspace,
+1, -0
1@@ -30,6 +30,7 @@ static const struct command commands[] = {
2 	{ "raise",               cmd_raise,               0, false },
3 	{ "focus_prev",          cmd_focus_prev,          0, false },
4 	{ "focus_next",          cmd_focus_next,          0, false },
5+	{ "unfocus",             cmd_unfocus,             0, false },
6 	{ "close",               cmd_close,               0, false },
7 	{ "workspace",           cmd_workspace,           1, false },
8 	{ "move_workspace",      cmd_move_workspace,      1, false },
+3, -1
 1@@ -38,6 +38,7 @@ extern status ipc_lower(char **);
 2 extern status ipc_raise(char **);
 3 extern status ipc_focus_prev(char **);
 4 extern status ipc_focus_next(char **);
 5+extern status ipc_unfocus(char **);
 6 extern status ipc_close(char **);
 7 extern status ipc_workspace(char **);
 8 extern status ipc_move_workspace(char **);
 9@@ -92,6 +93,7 @@ static const cmd_handler_t cmd_handler [cmd_last] = {
10 	[cmd_raise]               = ipc_raise,
11 	[cmd_focus_prev]          = ipc_focus_prev,
12 	[cmd_focus_next]          = ipc_focus_next,
13+	[cmd_unfocus]             = ipc_unfocus,
14 	[cmd_close]               = ipc_close,
15 	[cmd_workspace]           = ipc_workspace,
16 	[cmd_move_workspace]      = ipc_move_workspace,
17@@ -434,7 +436,7 @@ undecorate(struct client *c) {
18 	swc_window_set_decor(c->win, NULL);
19 }
20 
21-static void
22+void
23 focus(struct client *c) {
24 	if (wm.cur) {
25 		swc_window_set_border(
+11, -0
 1@@ -79,6 +79,7 @@ fn_bind(char *s) {
 2 
 3 extern void bind_handler(void *, uint32_t, uint32_t, uint32_t);
 4 extern void decorate(struct client *, bool);
 5+extern void focus(struct client *);
 6 extern bool load_decor(char *);
 7 extern void ws_go_to(int8_t);
 8 extern void ws_move_to(int8_t, struct client *);
 9@@ -286,6 +287,16 @@ ipc_focus_next(char **arg) {
10 	return (status){ true, "" };
11 }
12 
13+status
14+ipc_unfocus(char **arg) {
15+	ARG_CLIENT(arg[1]);
16+
17+	decorate(c, false);
18+	focus(NULL);
19+
20+	return (status){ true, "" };
21+}
22+
23 status
24 ipc_close(char **arg) {
25 	ARG_CLIENT(arg[1]);