Ticket #7165: PopUpMenu.diff

File PopUpMenu.diff, 1.4 KB (added by Pete, 10 years ago)

PopUpMenu.diff (from hrev40241)

  • BFS_User/haiku/haiku/src/kits/interface/PopUpMenu.cpp

     
    317317BPopUpMenu::_Go(BPoint where, bool autoInvoke, bool startOpened,
    318318        BRect *_specialRect, bool async)
    319319{
    320     // Force start opened. This is just better behavior.
    321     startOpened = true;
    322320
    323     BRect clickToOpenRect;
    324 
    325     // If no click to open rect was provided make one around the opening
    326     // point.
    327     if (startOpened && _specialRect == NULL) {
    328         clickToOpenRect.Set(where.x, where.y, where.x, where.y);
    329         clickToOpenRect.InsetBy(-2, -2);
    330         _specialRect = &clickToOpenRect;
    331     }
    332 
    333321    if (fTrackThread >= B_OK) {
    334322        // we already have an active menu, wait for it to go away before
    335323        // spawning another
     
    430418    // called by BMenu::Track()
    431419    fUseWhere = true;
    432420
     421    // Determine when mouse-down-up will be taken as a 'press', rather than a 'click'
     422    bigtime_t clickMaxTime = 0;
     423    get_click_speed(&clickMaxTime);
     424    clickMaxTime += system_time();
     425   
    433426    // Show the menu's window
    434427    Show();
    435428    snooze(50000);
    436429    BMenuItem *result = Track(startOpened, _specialRect);
     430    if (system_time() <= clickMaxTime)  // if it was a click
     431        result = Track(true, _specialRect); // keep menu open and tracking
    437432    if (result != NULL && autoInvoke)
    438433        result->Invoke();
    439434