[hackers] [wmii] Remove tests for menu bounds in 9menu.c, since the mouse is confined to the menu.

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Feb 26 11:52:06 2007

changeset: 1964:5a8df3a13a46
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Feb 26 05:51:49 2007 -0500
summary: Remove tests for menu bounds in 9menu.c, since the mouse is confined to the menu.

diff -r 26a5d6eb0c8e -r 5a8df3a13a46 9menu.c
--- a/9menu.c Mon Feb 26 05:17:10 2007 -0500
+++ b/9menu.c Mon Feb 26 05:51:49 2007 -0500
@@ -569,10 +569,10 @@ run_menu()
                 case MotionNotify:
                         old = cur;
                         cur = ev.xbutton.y/high;
- if (ev.xbutton.x < 0 || ev.xbutton.x > wide)
- cur = -1;
- else if (cur < 0 || cur >= numitems)
- cur = -1;
+ if (cur < 0)
+ cur = 0;
+ else if (cur >= numitems)
+ cur = numitems - 1;
                         if (cur == old)
                                 break;
                         redraw(cur, high, wide);
Received on Mon Feb 26 2007 - 11:52:06 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:57 UTC