From ab47de82afc75c6ebaf4bc43fabf2c4921adad83 Mon Sep 17 00:00:00 2001 From: Okan Demirmen Date: Mon, 3 Oct 2016 13:41:31 +0000 Subject: client_ptrwarp should not deal with unhiding or raising clients (non ptr requests); most callers do this already - deal with the few that do not. client_ptrwarp becomes a simple wrapper (setpos) but it will be expanded. --- app/cwm/client.c | 8 ++------ app/cwm/kbfunc.c | 4 +++- app/cwm/xevents.c | 6 +++++- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/cwm/client.c b/app/cwm/client.c index 57971355f..6e9fa6eb4 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.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: client.c,v 1.225 2016/09/30 20:55:54 okan Exp $ + * $OpenBSD: client.c,v 1.226 2016/10/03 13:41:30 okan Exp $ */ #include @@ -469,11 +469,6 @@ client_config(struct client_ctx *cc) void client_ptrwarp(struct client_ctx *cc) { - if (cc->flags & CLIENT_HIDDEN) - client_unhide(cc); - else - client_raise(cc); - xu_ptr_setpos(cc->win, cc->ptr.x, cc->ptr.y); } @@ -686,6 +681,7 @@ client_cycle(struct screen_ctx *sc, int flags) /* reset when cycling mod is released. XXX I hate this hack */ sc->cycling = 1; client_ptrsave(oldcc); + client_raise(newcc); client_ptrwarp(newcc); } diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 91d7a2aa8..f30f809ff 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.127 2016/09/22 14:36:03 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.128 2016/10/03 13:41:30 okan Exp $ */ #include @@ -187,6 +187,8 @@ kbfunc_menu_client(struct client_ctx *cc, union arg *arg) cc = (struct client_ctx *)mi->ctx; if (cc->flags & CLIENT_HIDDEN) client_unhide(cc); + else + client_raise(cc); if (old_cc) client_ptrsave(old_cc); client_ptrwarp(cc); diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index cda021be5..a59aee665 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.122 2016/09/16 14:32:02 okan Exp $ + * $OpenBSD: xevents.c,v 1.123 2016/10/03 13:41:30 okan Exp $ */ /* @@ -344,6 +344,10 @@ xev_handle_clientmessage(XEvent *ee) if ((cc = client_find(e->window)) != NULL) { if ((old_cc = client_current()) != NULL) client_ptrsave(old_cc); + if (cc->flags & CLIENT_HIDDEN) + client_unhide(cc); + else + client_raise(cc); client_ptrwarp(cc); } } else if (e->message_type == ewmh[_NET_WM_DESKTOP]) { -- cgit v1.2.3