diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2017-12-29 16:55:51 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2017-12-29 16:55:51 +0000 |
commit | 2ac6adfc517aafee63f26fd109cac34e00d092a8 (patch) | |
tree | 3dfe5e4db5e06f09e7eff7f33547a83be1e01ffd /app/cwm | |
parent | 66cbb9f6e913b1652216045da296e11ed23cab87 (diff) |
Merge group_toggle_membership_leave into the buttonrelease event and only do
border work for a group/ungroup action.
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/calmwm.h | 5 | ||||
-rw-r--r-- | app/cwm/group.c | 11 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 4 | ||||
-rw-r--r-- | app/cwm/xevents.c | 8 |
4 files changed, 11 insertions, 17 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 54406f6b6..1fd830537 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.348 2017/12/29 12:54:54 okan Exp $ + * $OpenBSD: calmwm.h,v 1.349 2017/12/29 16:55:50 okan Exp $ */ #ifndef _CALMWM_H_ @@ -442,8 +442,7 @@ void group_movetogroup(struct client_ctx *, int); void group_only(struct screen_ctx *, int); int group_restore(struct client_ctx *); void group_show(struct group_ctx *); -void group_toggle_membership_enter(struct client_ctx *); -void group_toggle_membership_leave(struct client_ctx *); +void group_toggle_membership(struct client_ctx *); void group_update_names(struct screen_ctx *); void search_match_client(struct menu_q *, struct menu_q *, diff --git a/app/cwm/group.c b/app/cwm/group.c index 68f2cb3d6..1c51979df 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.126 2017/02/10 15:00:54 okan Exp $ + * $OpenBSD: group.c,v 1.127 2017/12/29 16:55:50 okan Exp $ */ #include <sys/types.h> @@ -170,7 +170,7 @@ group_movetogroup(struct client_ctx *cc, int idx) } void -group_toggle_membership_enter(struct client_ctx *cc) +group_toggle_membership(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; struct group_ctx *gc = sc->group_active; @@ -186,13 +186,6 @@ group_toggle_membership_enter(struct client_ctx *cc) client_draw_border(cc); } -void -group_toggle_membership_leave(struct client_ctx *cc) -{ - cc->flags &= ~CLIENT_HIGHLIGHT; - client_draw_border(cc); -} - int group_holds_only_sticky(struct group_ctx *gc) { diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index a79cfc9a1..e2ecca18b 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.156 2017/12/29 12:54:54 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.157 2017/12/29 16:55:50 okan Exp $ */ #include <sys/types.h> @@ -411,7 +411,7 @@ kbfunc_client_toggle_group(void *ctx, struct cargs *cargs) XGrabKeyboard(X_Dpy, cc->win, True, GrabModeAsync, GrabModeAsync, CurrentTime); - group_toggle_membership_enter(cc); + group_toggle_membership(cc); } void diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index cc5aaf8cd..aa9856b56 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.130 2017/12/29 12:54:54 okan Exp $ + * $OpenBSD: xevents.c,v 1.131 2017/12/29 16:55:50 okan Exp $ */ /* @@ -260,8 +260,10 @@ xev_handle_buttonrelease(XEvent *ee) struct client_ctx *cc; if ((cc = client_find(e->window)) != NULL) { - if (cc->flags & CLIENT_ACTIVE) - group_toggle_membership_leave(cc); + if (cc->flags & (CLIENT_ACTIVE | CLIENT_HIGHLIGHT)) { + cc->flags &= ~CLIENT_HIGHLIGHT; + client_draw_border(cc); + } } } |