titler fixes, auto paste bug, resize popup hang, focus policy fix, chk lang
[goodguy/history.git] / cinelerra-5.1 / guicast / bcpopupmenu.C
index 0c8281469610f702cd44029b841630e3fad1960f..6a8c63e2f9daaafa61089100eaf36798d685e89c 100644 (file)
@@ -94,7 +94,8 @@ BC_PopupMenu::BC_PopupMenu(int x,
 
 BC_PopupMenu::~BC_PopupMenu()
 {
-       if(menu_popup) delete menu_popup;
+       use_title = 0;
+       deactivate();
        for(int i = 0; i < TOTAL_IMAGES; i++)
        {
                if(images[i]) delete images[i];
@@ -354,12 +355,11 @@ int BC_PopupMenu::focus_out_event()
 
 int BC_PopupMenu::repeat_event(int64_t duration)
 {
-       if( status == BUTTON_HI && !tooltip_done &&
+       if( status == BUTTON_HI &&
                tooltip_text && tooltip_text[0] != 0 &&
                duration == top_level->get_resources()->tooltip_delay )
        {
                show_tooltip();
-               tooltip_done = 1;
                return 1;
        }
        return 0;
@@ -419,8 +419,6 @@ int BC_PopupMenu::button_release_event()
 {
 // try the title
        int result = 0;
-       if( pending )
-               return menu_activate();
 
        if(is_event_win() && use_title)
        {
@@ -432,6 +430,9 @@ int BC_PopupMenu::button_release_event()
                }
        }
 
+       if( pending )
+               return menu_activate();
+
        if( !use_title && status == BUTTON_DN ) {
                result = 1;
        }
@@ -483,7 +484,6 @@ int BC_PopupMenu::cursor_enter_event()
 {
        if(is_event_win() && use_title)
        {
-               tooltip_done = 0;
                if(top_level->button_down)
                {
                        status = BUTTON_DN;
@@ -502,25 +502,19 @@ int BC_PopupMenu::cursor_motion_event()
        int result = 0;
 
 // This menu is down.
-       if(popup_down)
-       {
+       if(popup_down) {
                result = menu_popup->dispatch_motion_event();
        }
 
-       if(!result && use_title && top_level->event_win == win)
-       {
-               if(highlighted)
-               {
-                       if(!cursor_inside())
-                       {
+       if(!result && use_title && is_event_win()) {
+               if(highlighted) {
+                       if(!cursor_inside()) {
                                highlighted = 0;
                                draw_title(1);
                        }
                }
-               else
-               {
-                       if(cursor_inside())
-                       {
+               else {
+                       if(cursor_inside()) {
                                highlighted = 1;
                                draw_title(1);
                                result = 1;