aboutsummaryrefslogtreecommitdiffstats
path: root/grab.c
diff options
context:
space:
mode:
authoroga2008-01-16 11:39:20 +0000
committeroga2008-01-16 11:39:20 +0000
commit475e835196e065d2010dc146b3ca01598b554893 (patch)
treef2ef0da87afd85a3a3bd26c4cf3e13647a69a05c /grab.c
parent923c9f8936be6a656e3f9b6607c69a820b411330 (diff)
downloadcwm-475e835196e065d2010dc146b3ca01598b554893.tar.gz
huge amount of cleanup and dead code removal.
full description of changes: -remove fontlist, and all associated structures/calls, it's not needed. this also removes any doubt about leftover 9wm code (the list was borrowed from it). Since cwm now uses Xft for everything, the legacy font handling is just not needed. -add /* FALLTHROUGH */ comments into grab_{label,menu}. I actually didn't intend grab_menu to be a fallthrough, but it actually works quite well there, so remove the extra rectangle drawing. I love it when that happens. -remove a couple of unused prototypes that were obviously missed before. -remove a bunch of commented out or if 0ed out code. It doesn't look to be coming back anytime soon. -several functions returned an int, but this was never checked. most of them only failed if they failed to grab the pointer (thus the internal state didn't change), so just make them void and return early if this is the case. -remove several unused functions and some useless variables. knocks something like 200bytes off the stripped binary size for me. ok marc@, tested by several others.
Diffstat (limited to '')
-rw-r--r--grab.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/grab.c b/grab.c
index ac8e2a9..6a79e76 100644
--- a/grab.c
+++ b/grab.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.
*
- * $Id: grab.c,v 1.7 2008/01/14 15:21:10 oga Exp $
+ * $Id: grab.c,v 1.8 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -53,7 +53,7 @@ grab_sweep_draw(struct client_ctx *cc, int dx, int dy)
wide/2 - wide_size/2, height + font_ascent(font) + 1);
}
-int
+void
grab_sweep(struct client_ctx *cc)
{
XEvent ev;
@@ -68,7 +68,7 @@ grab_sweep(struct client_ctx *cc)
client_ptrsave(cc);
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_resize) < 0)
- return (-1);
+ return;
xu_ptr_setpos(cc->win, cc->geom.width, cc->geom.height);
grab_sweep_draw(cc, dx, dy);
@@ -101,13 +101,13 @@ grab_sweep(struct client_ctx *cc)
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
xu_ptr_ungrab();
client_ptrwarp(cc);
- return (0);
+ return;
}
}
/* NOTREACHED */
}
-int
+void
grab_drag(struct client_ctx *cc)
{
int x0 = cc->geom.x, y0 = cc->geom.y, xm, ym;
@@ -117,7 +117,7 @@ grab_drag(struct client_ctx *cc)
client_raise(cc);
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_move) < 0)
- return (-1);
+ return;
xu_ptr_getpos(sc->rootwin, &xm, &ym);
@@ -138,7 +138,7 @@ grab_drag(struct client_ctx *cc)
break;
case ButtonRelease:
xu_ptr_ungrab();
- return (0);
+ return;
}
}
/* NOTREACHED */
@@ -219,9 +219,7 @@ grab_menu(XButtonEvent *e, struct menu_q *menuq)
sc->menuwin, fx, fy);
i++;
}
- if (entry != -1)
- XFillRectangle(X_Dpy, sc->menuwin, sc->hlgc,
- 0, entry*height, width, height);
+ /* FALLTHROUGH */
case MotionNotify:
prev = entry;
entry = menu_calc_entry(event.xbutton.x,
@@ -320,7 +318,7 @@ grab_label(struct client_ctx *cc)
xfree(cc->label);
cc->label = xstrdup(labelstr);
-
+ /* FALLTHROUGH */
case CTL_ABORT:
goto out;
default: