[hackers] [dmenu] cleaned up || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Fri, 25 Jun 2010 03:33:47 +0000 (UTC)

changeset: 326:d0542132480c
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Fri Jun 25 04:33:41 2010 +0100
files: dinput.c dmenu.c
description:
cleaned up

diff -r bf880c68fff4 -r d0542132480c dinput.c
--- a/dinput.c Thu Jun 24 17:44:35 2010 +0100
+++ b/dinput.c Fri Jun 25 04:33:41 2010 +0100
@@ -25,7 +25,7 @@
 static void drawcursor(void);
 static void drawinput(void);
 static Bool grabkeyboard(void);
-static void kpress(XKeyEvent * e);
+static void kpress(XKeyEvent *e);
 static void run(void);
 static void setup(Bool topbar);
 
@@ -100,7 +100,7 @@
 }
 
 void
-kpress(XKeyEvent * e) {
+kpress(XKeyEvent *e) {
         char buf[sizeof text];
         int num;
         unsigned int i, len;
@@ -140,6 +140,7 @@
                         ksym = XK_BackSpace;
                         break;
                 case XK_j:
+ case XK_m:
                         ksym = XK_Return;
                         break;
                 case XK_k:
@@ -274,12 +275,11 @@
         selcol[ColBG] = getcolor(&dc, selbgcolor);
         selcol[ColFG] = getcolor(&dc, selfgcolor);
         initfont(&dc, font);
- fprintf(stderr, "dc.font.xfont: %u\n", (size_t)dc.font.xfont);
 
         /* input window */
         wa.override_redirect = True;
         wa.background_pixmap = ParentRelative;
- wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask | VisibilityChangeMask;
+ wa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
 
         /* input window geometry */
         mh = dc.font.height + 2;
diff -r bf880c68fff4 -r d0542132480c dmenu.c
--- a/dmenu.c Thu Jun 24 17:44:35 2010 +0100
+++ b/dmenu.c Fri Jun 25 04:33:41 2010 +0100
@@ -39,7 +39,7 @@
 static void drawmenuh(void);
 static void drawmenuv(void);
 static Bool grabkeyboard(void);
-static void kpress(XKeyEvent * e);
+static void kpress(XKeyEvent *e);
 static void match(char *pattern);
 static void readstdin(void);
 static void run(void);
@@ -191,7 +191,7 @@
         dc.w = spaceitem;
         drawtext(&dc, curr->left ? "<" : NULL, normcol);
         dc.x += dc.w;
- for(i = curr; i != next; i=i->right) {
+ for(i = curr; i != next; i = i->right) {
                 dc.w = MIN(textw(&dc, i->text), mw / 3);
                 drawtext(&dc, i->text, (sel == i) ? selcol : normcol);
                 dc.x += dc.w;
@@ -208,7 +208,7 @@
         dc.w = mw - dc.x;
         dc.h = dc.font.height + 2;
         dc.y = dc.h;
- for(i = curr; i != next; i=i->right) {
+ for(i = curr; i != next; i = i->right) {
                 drawtext(&dc, i->text, (sel == i) ? selcol : normcol);
                 dc.y += dc.h;
         }
@@ -230,7 +230,7 @@
 }
 
 void
-kpress(XKeyEvent * e) {
+kpress(XKeyEvent *e) {
         char buf[sizeof text];
         int num;
         unsigned int i, len;
@@ -273,6 +273,7 @@
                         ksym = XK_Tab;
                         break;
                 case XK_j:
+ case XK_m:
                         ksym = XK_Return;
                         break;
                 case XK_n:
@@ -501,7 +502,7 @@
         /* menu window */
         wa.override_redirect = True;
         wa.background_pixmap = ParentRelative;
- wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask | VisibilityChangeMask;
+ wa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
 
         /* menu window geometry */
         mh = (dc.font.height + 2) * (lines + 1);
Received on Fri Jun 25 2010 - 03:33:47 UTC

This archive was generated by hypermail 2.2.0 : Fri Jun 25 2010 - 03:36:04 UTC