summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2017-12-29 12:54:55 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2017-12-29 12:54:55 +0000
commit66cbb9f6e913b1652216045da296e11ed23cab87 (patch)
tree931519afc711cf50a60e626e136a3372e910b50a /app
parent840940052b69ff4b86b3a3043a4a15bb15ef79e1 (diff)
add helper function client_show to bring together like actions for unhide/raise
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.h3
-rw-r--r--app/cwm/client.c11
-rw-r--r--app/cwm/kbfunc.c7
-rw-r--r--app/cwm/xevents.c7
4 files changed, 16 insertions, 12 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index cd1f161d2..54406f6b6 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.347 2017/12/19 14:30:53 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.348 2017/12/29 12:54:54 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -412,6 +412,7 @@ void client_send_delete(struct client_ctx *);
void client_set_wm_state(struct client_ctx *, long);
void client_setactive(struct client_ctx *);
void client_setname(struct client_ctx *);
+void client_show(struct client_ctx *);
int client_snapcalc(int, int, int, int, int);
void client_toggle_freeze(struct client_ctx *);
void client_toggle_fullscreen(struct client_ctx *);
diff --git a/app/cwm/client.c b/app/cwm/client.c
index dcc4afc99..a9776b078 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.242 2017/12/22 21:21:44 okan Exp $
+ * $OpenBSD: client.c,v 1.243 2017/12/29 12:54:54 okan Exp $
*/
#include <sys/types.h>
@@ -532,6 +532,15 @@ client_hide(struct client_ctx *cc)
}
void
+client_show(struct client_ctx *cc)
+{
+ if (cc->flags & CLIENT_HIDDEN)
+ client_unhide(cc);
+ else
+ client_raise(cc);
+}
+
+void
client_unhide(struct client_ctx *cc)
{
XMapRaised(X_Dpy, cc->win);
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 03a0ee78f..a79cfc9a1 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.155 2017/12/19 19:38:43 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.156 2017/12/29 12:54:54 okan Exp $
*/
#include <sys/types.h>
@@ -471,10 +471,7 @@ kbfunc_menu_client(void *ctx, struct cargs *cargs)
if ((mi = menu_filter(sc, &menuq, "window", NULL, mflags,
search_match_client, search_print_client)) != NULL) {
cc = (struct client_ctx *)mi->ctx;
- if (cc->flags & CLIENT_HIDDEN)
- client_unhide(cc);
- else
- client_raise(cc);
+ client_show(cc);
if (old_cc)
client_ptrsave(old_cc);
client_ptrwarp(cc);
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c
index 71411f883..cc5aaf8cd 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.129 2017/12/27 17:04:35 okan Exp $
+ * $OpenBSD: xevents.c,v 1.130 2017/12/29 12:54:54 okan Exp $
*/
/*
@@ -357,10 +357,7 @@ 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_show(cc);
client_ptrwarp(cc);
}
} else if (e->message_type == ewmh[_NET_WM_DESKTOP]) {