summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2014-01-29 22:30:01 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2014-01-29 22:30:01 +0000
commita2063639dc9c5ba7f0a2e76d09cc805d648c8303 (patch)
tree5db2d9e09348feb31b946ff85c66988881ea76c4 /app
parenta54f77b95177b9ca469f0a1573cda91cf2a3a21c (diff)
Minimize trivial differences between a few kb and mb functions.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.h4
-rw-r--r--app/cwm/conf.c4
-rw-r--r--app/cwm/kbfunc.c4
-rw-r--r--app/cwm/mousefunc.c15
4 files changed, 13 insertions, 14 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index 11c4a02fc..65954be23 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.250 2014/01/29 21:13:52 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.251 2014/01/29 22:30:00 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -477,7 +477,7 @@ void kbfunc_cmdexec(struct client_ctx *, union arg *);
void kbfunc_cwm_status(struct client_ctx *, union arg *);
void kbfunc_exec(struct client_ctx *, union arg *);
void kbfunc_lock(struct client_ctx *, union arg *);
-void kbfunc_menu_search(struct client_ctx *, union arg *);
+void kbfunc_menu_cmd(struct client_ctx *, union arg *);
void kbfunc_ssh(struct client_ctx *, union arg *);
void kbfunc_term(struct client_ctx *, union arg *);
void kbfunc_tile(struct client_ctx *, union arg *);
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index c7b4cf86d..00726c8c4 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.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: conf.c,v 1.166 2014/01/29 21:13:52 okan Exp $
+ * $OpenBSD: conf.c,v 1.167 2014/01/29 22:30:00 okan Exp $
*/
#include <sys/param.h>
@@ -353,7 +353,7 @@ static const struct {
{ "lower", kbfunc_client_lower, CWM_WIN, {0} },
{ "raise", kbfunc_client_raise, CWM_WIN, {0} },
{ "search", kbfunc_client_search, 0, {0} },
- { "menusearch", kbfunc_menu_search, 0, {0} },
+ { "menusearch", kbfunc_menu_cmd, 0, {0} },
{ "hide", kbfunc_client_hide, CWM_WIN, {0} },
{ "cycle", kbfunc_client_cycle, 0, {.i = CWM_CYCLE} },
{ "rcycle", kbfunc_client_cycle, 0, {.i = CWM_RCYCLE} },
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index b4fc3e5b5..c9c39d462 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.93 2014/01/23 16:51:28 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.94 2014/01/29 22:30:00 okan Exp $
*/
#include <sys/param.h>
@@ -167,7 +167,7 @@ kbfunc_client_search(struct client_ctx *cc, union arg *arg)
}
void
-kbfunc_menu_search(struct client_ctx *cc, union arg *arg)
+kbfunc_menu_cmd(struct client_ctx *cc, union arg *arg)
{
struct screen_ctx *sc = cc->sc;
struct cmd *cmd;
diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c
index 4a9829543..28b8e1662 100644
--- a/app/cwm/mousefunc.c
+++ b/app/cwm/mousefunc.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: mousefunc.c,v 1.68 2014/01/20 22:31:53 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.69 2014/01/29 22:30:00 okan Exp $
*/
#include <sys/param.h>
@@ -221,7 +221,6 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
old_cc = client_current();
TAILQ_INIT(&menuq);
-
TAILQ_FOREACH(cc, &Clientq, entry)
if (cc->flags & CLIENT_HIDDEN) {
wname = (cc->label) ? cc->label : cc->name;
@@ -235,8 +234,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
if (TAILQ_EMPTY(&menuq))
return;
- mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL);
- if (mi != NULL) {
+ if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+ NULL, NULL)) != NULL) {
cc = (struct client_ctx *)mi->ctx;
client_unhide(cc);
@@ -252,19 +251,19 @@ void
mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg)
{
struct screen_ctx *sc = cc->sc;
+ struct cmd *cmd;
struct menu *mi;
struct menu_q menuq;
- struct cmd *cmd;
TAILQ_INIT(&menuq);
-
TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
menuq_add(&menuq, cmd, "%s", cmd->name);
+
if (TAILQ_EMPTY(&menuq))
return;
- mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL);
- if (mi != NULL)
+ if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+ NULL, NULL)) != NULL)
u_spawn(((struct cmd *)mi->ctx)->path);
menuq_clear(&menuq);