Rename internal functions to delinate between client remove, delete and xproto

delete; 'window-close' is now the proper action, but 'window-delete' as an
alias will remain until more interesting changes require breaking configs.
This commit is contained in:
okan 2019-02-22 19:40:32 +00:00
parent 044ef5a8cd
commit 535cf541c8
7 changed files with 16 additions and 15 deletions

View File

@ -401,7 +401,7 @@ void client_applysizehints(struct client_ctx *);
void client_config(struct client_ctx *); void client_config(struct client_ctx *);
struct client_ctx *client_current(void); struct client_ctx *client_current(void);
void client_cycle(struct screen_ctx *, int); void client_cycle(struct screen_ctx *, int);
void client_delete(struct client_ctx *); void client_remove(struct client_ctx *);
void client_draw_border(struct client_ctx *); void client_draw_border(struct client_ctx *);
struct client_ctx *client_find(Window); struct client_ctx *client_find(Window);
long client_get_wm_state(struct client_ctx *); long client_get_wm_state(struct client_ctx *);
@ -419,7 +419,7 @@ void client_ptrsave(struct client_ctx *);
void client_ptrwarp(struct client_ctx *); void client_ptrwarp(struct client_ctx *);
void client_raise(struct client_ctx *); void client_raise(struct client_ctx *);
void client_resize(struct client_ctx *, int); void client_resize(struct client_ctx *, int);
void client_send_delete(struct client_ctx *); void client_close(struct client_ctx *);
void client_set_wm_state(struct client_ctx *, long); void client_set_wm_state(struct client_ctx *, long);
void client_setactive(struct client_ctx *); void client_setactive(struct client_ctx *);
void client_setname(struct client_ctx *); void client_setname(struct client_ctx *);
@ -490,7 +490,7 @@ void kbfunc_ptrmove(void *, struct cargs *);
void kbfunc_client_snap(void *, struct cargs *); void kbfunc_client_snap(void *, struct cargs *);
void kbfunc_client_move(void *, struct cargs *); void kbfunc_client_move(void *, struct cargs *);
void kbfunc_client_resize(void *, struct cargs *); void kbfunc_client_resize(void *, struct cargs *);
void kbfunc_client_delete(void *, struct cargs *); void kbfunc_client_close(void *, struct cargs *);
void kbfunc_client_lower(void *, struct cargs *); void kbfunc_client_lower(void *, struct cargs *);
void kbfunc_client_raise(void *, struct cargs *); void kbfunc_client_raise(void *, struct cargs *);
void kbfunc_client_hide(void *, struct cargs *); void kbfunc_client_hide(void *, struct cargs *);

View File

@ -170,7 +170,7 @@ client_find(Window win)
} }
void void
client_delete(struct client_ctx *cc) client_remove(struct client_ctx *cc)
{ {
struct screen_ctx *sc = cc->sc; struct screen_ctx *sc = cc->sc;
struct winname *wn; struct winname *wn;
@ -636,7 +636,7 @@ client_msg(struct client_ctx *cc, Atom proto, Time ts)
} }
void void
client_send_delete(struct client_ctx *cc) client_close(struct client_ctx *cc)
{ {
if (cc->flags & CLIENT_WM_DELETE_WINDOW) if (cc->flags & CLIENT_WM_DELETE_WINDOW)
client_msg(cc, cwmh[WM_DELETE_WINDOW], CurrentTime); client_msg(cc, cwmh[WM_DELETE_WINDOW], CurrentTime);

5
conf.c
View File

@ -67,7 +67,8 @@ static const struct {
{ FUNC_CC(window-lower, client_lower, 0) }, { FUNC_CC(window-lower, client_lower, 0) },
{ FUNC_CC(window-raise, client_raise, 0) }, { FUNC_CC(window-raise, client_raise, 0) },
{ FUNC_CC(window-hide, client_hide, 0) }, { FUNC_CC(window-hide, client_hide, 0) },
{ FUNC_CC(window-delete, client_delete, 0) }, { FUNC_CC(window-close, client_close, 0) },
{ FUNC_CC(window-delete, client_close, 0) },
{ FUNC_CC(window-htile, client_htile, 0) }, { FUNC_CC(window-htile, client_htile, 0) },
{ FUNC_CC(window-vtile, client_vtile, 0) }, { FUNC_CC(window-vtile, client_vtile, 0) },
{ FUNC_CC(window-stick, client_toggle_sticky, 0) }, { FUNC_CC(window-stick, client_toggle_sticky, 0) },
@ -194,7 +195,7 @@ static const struct {
{ "M-Tab", "window-cycle" }, { "M-Tab", "window-cycle" },
{ "MS-Tab", "window-rcycle" }, { "MS-Tab", "window-rcycle" },
{ "CM-n", "window-menu-label" }, { "CM-n", "window-menu-label" },
{ "CM-x", "window-delete" }, { "CM-x", "window-close" },
{ "CM-a", "group-toggle-all" }, { "CM-a", "group-toggle-all" },
{ "CM-0", "group-toggle-all" }, { "CM-0", "group-toggle-all" },
{ "CM-1", "group-toggle-1" }, { "CM-1", "group-toggle-1" },

2
cwm.1
View File

@ -100,7 +100,7 @@ Cycle through currently visible windows.
.It Ic MS-Tab .It Ic MS-Tab
Reverse cycle through currently visible windows. Reverse cycle through currently visible windows.
.It Ic CM-x .It Ic CM-x
Delete current window. Close current window.
.It Ic CM-[n] .It Ic CM-[n]
Toggle visibility of group n, where n is 1-9. Toggle visibility of group n, where n is 1-9.
.It Ic CM-a .It Ic CM-a

View File

@ -306,8 +306,8 @@ Reverse cycle through windows.
Forward cycle through windows in current group. Forward cycle through windows in current group.
.It window-rcycle-ingroup .It window-rcycle-ingroup
Reverse cycle through windows in current group. Reverse cycle through windows in current group.
.It window-delete .It window-close
Delete current window. Close current window.
.It window-hide .It window-hide
Hide current window. Hide current window.
.It window-lower .It window-lower

View File

@ -324,9 +324,9 @@ kbfunc_client_snap(void *ctx, struct cargs *cargs)
} }
void void
kbfunc_client_delete(void *ctx, struct cargs *cargs) kbfunc_client_close(void *ctx, struct cargs *cargs)
{ {
client_send_delete(ctx); client_close(ctx);
} }
void void

View File

@ -102,7 +102,7 @@ xev_handle_unmapnotify(XEvent *ee)
client_set_wm_state(cc, WithdrawnState); client_set_wm_state(cc, WithdrawnState);
} else { } else {
if (!(cc->flags & CLIENT_HIDDEN)) if (!(cc->flags & CLIENT_HIDDEN))
client_delete(cc); client_remove(cc);
} }
} }
} }
@ -116,7 +116,7 @@ xev_handle_destroynotify(XEvent *ee)
LOG_DEBUG3("window: 0x%lx", e->window); LOG_DEBUG3("window: 0x%lx", e->window);
if ((cc = client_find(e->window)) != NULL) if ((cc = client_find(e->window)) != NULL)
client_delete(cc); client_remove(cc);
} }
static void static void
@ -389,7 +389,7 @@ xev_handle_clientmessage(XEvent *ee)
} }
} else if (e->message_type == ewmh[_NET_CLOSE_WINDOW]) { } else if (e->message_type == ewmh[_NET_CLOSE_WINDOW]) {
if ((cc = client_find(e->window)) != NULL) { if ((cc = client_find(e->window)) != NULL) {
client_send_delete(cc); client_close(cc);
} }
} else if (e->message_type == ewmh[_NET_ACTIVE_WINDOW]) { } else if (e->message_type == ewmh[_NET_ACTIVE_WINDOW]) {
if ((cc = client_find(e->window)) != NULL) { if ((cc = client_find(e->window)) != NULL) {