Ticket #2229: mc-no-mcview_update-on-quit.patch

File mc-no-mcview_update-on-quit.patch, 1.9 KB (added by gotar, 12 years ago)
  • actions_cmd.c

    old new mcview_handle_editkey (mcview_t * view,  
    242242 
    243243/* --------------------------------------------------------------------------------------------- */ 
    244244 
    245 static cb_ret_t 
     245static int 
    246246mcview_execute_cmd (mcview_t * view, unsigned long command) 
    247247{ 
    248248    int res = MSG_HANDLED; 
    mcview_execute_cmd (mcview_t * view, uns 
    376376    case CK_ViewQuit: 
    377377        if (!mcview_is_in_panel (view)) 
    378378            dlg_stop (view->widget.owner); 
    379         break; 
     379        return -1; 
    380380    default: 
    381381        res = MSG_NOT_HANDLED; 
    382382    } 
    mcview_execute_cmd (mcview_t * view, uns 
    384384} 
    385385 
    386386/* Both views */ 
    387 static cb_ret_t 
     387static int 
    388388mcview_handle_key (mcview_t * view, int key) 
    389389{ 
    390390    unsigned long command; 
     391    int res; 
    391392 
    392393    key = convert_from_input_c (key); 
    393394 
    mcview_handle_key (mcview_t * view, int  
    402403    } 
    403404 
    404405    command = lookup_keymap_command (view->plain_map, key); 
    405     if ((command != CK_Ignore_Key) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) 
    406         return MSG_HANDLED; 
     406    if (command != CK_Ignore_Key) 
     407    { 
     408        res = mcview_execute_cmd (view, command); 
     409        if (res != MSG_NOT_HANDLED) 
     410            return res; 
     411    } 
    407412 
    408413#ifdef MC_ENABLE_DEBUGGING_CODE 
    409414    if (c == 't') 
    cb_ret_t 
    450455mcview_callback (Widget * w, widget_msg_t msg, int parm) 
    451456{ 
    452457    mcview_t *view = (mcview_t *) w; 
    453     cb_ret_t i; 
     458    int i; 
    454459 
    455460    mcview_compute_areas (view); 
    456461    mcview_update_bytes_per_line (view); 
    mcview_callback (Widget * w, widget_msg_ 
    475480 
    476481    case WIDGET_KEY: 
    477482        i = mcview_handle_key (view, parm); 
    478         mcview_update (view); 
     483        if (i == MSG_HANDLED) 
     484            mcview_update (view); 
     485        if (i == -1) 
     486            i = MSG_HANDLED; 
    479487        return i; 
    480488 
    481489    case WIDGET_COMMAND: