Changeset 17136

Show
Ignore:
Timestamp:
04/15/06 12:57:51 (3 years ago)
Author:
jackburton
Message:

PopUpMenus didn't respect the openanyway setting (sticky mode), they always set it. And even in that case, they weren't working correctly. This should fix bugs 463 and 476. This might not work if click to open isn't selected in the menu prefs, though.

Location:
haiku/trunk/src/kits/interface
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/kits/interface/Menu.cpp

    r17134 r17136  
    960960 
    961961BMenuItem * 
    962 BMenu::Track(bool openAnyway, BRect *clickToOpenRect) 
    963 { 
    964         if (!IsStickyPrefOn()) 
    965                 openAnyway = false; 
    966                  
    967         SetStickyMode(openAnyway); 
    968          
    969         if (openAnyway && LockLooper()) { 
     962BMenu::Track(bool sticky, BRect *clickToOpenRect) 
     963{        
     964        if (sticky && LockLooper()) { 
    970965                RedrawAfterSticky(Bounds()); 
    971966                UnlockLooper(); 
     
    978973        } 
    979974 
     975        // If sticky is false, pass 0 to the tracking function 
     976        // so the menu will stay in nonsticky mode, regardless 
     977        // of the "IsStickyPrefOn()" value 
     978        const bigtime_t trackTime = sticky ? system_time() : 0; 
    980979        int action; 
    981         BMenuItem *menuItem = _track(&action, system_time()); 
     980        BMenuItem *menuItem = _track(&action, trackTime); 
    982981         
    983982        SetStickyMode(false); 
  • haiku/trunk/src/kits/interface/PopUpMenu.cpp

    r17134 r17136  
    268268                BRect *_specialRect, bool async) 
    269269{ 
     270        if (fTrackThread >= 0) { 
     271                // Something bad happened: Go() was called on us twice, and we got here 
     272                // while the other instance hasn't finished yet. 
     273                // TODO: Maybe we should simply call debugger() ? 
     274                status_t unused; 
     275                wait_for_thread(fTrackThread, &unused); 
     276        } 
     277 
    270278        BMenuItem *selected = NULL; 
    271279