fixed menu timer bug
fluxgen fluxgen
1 files changed,
6 insertions(+),
10 deletions(-)
jump to
M
src/FbTk/Menu.cc
→
src/FbTk/Menu.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.46 2003/12/12 18:18:49 fluxgen Exp $ +// $Id: Menu.cc,v 1.47 2003/12/12 19:45:46 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE@@ -1121,8 +1121,9 @@ }
void Menu::motionNotifyEvent(XMotionEvent &me) { - m_hide_timer.stop(); + if (me.window == menu.title && (me.state & Button1Mask)) { + stopHide(); if (movable) { if (! moving) { if (m_parent && (! torn)) {@@ -1147,6 +1148,7 @@ }
} else if ((! (me.state & Button1Mask)) && me.window == menu.frame && me.x >= 0 && me.x < (signed) width() && me.y >= 0 && me.y < (signed) menu.frame_h) { + stopHide(); int sbl = (me.x / menu.item_w), i = (me.y / menu.item_h), w = (sbl * menu.persub) + i;@@ -1186,10 +1188,7 @@
drawItem(w, true); if (theme().menuMode() == MenuTheme::DELAY_OPEN) { - cerr<<"menuMode DELAY_OPEN"<<endl; // setup show menu timer - stopHide(); - timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = theme().delayOpen();@@ -1392,18 +1391,15 @@ int item = which_sbl * menu.persub + which_press;
if (item < 0 || item >= menuitems.size()) return; - stopHide(); - + drawItem(item, true); if (menuitems[item]->submenu() != 0 && !menuitems[item]->submenu()->isVisible()) drawSubmenu(item); } void Menu::closeMenu() { - if (isVisible() && - !isTorn()) { + if (isVisible() && !isTorn()) internal_hide(); - } } void Menu::startHide() {