Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8bba1ae rd12a8c7  
    216216  /* redisplay etc. */
    217217  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     218  owl_global_set_needrefresh(&g);
    218219}
    219220
     
    292293  owl_editwin_set_cbdata(e, data, cleanup);
    293294  owl_editwin_set_callback(e, callback);
    294   owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti", owl_global_get_typwin_window(&g));
     295  owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti");
    295296}
    296297
     
    807808{
    808809  owl_global_set_rightshift(&g, owl_global_get_rightshift(&g)+10);
     810  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     811  owl_global_set_needrefresh(&g);
    809812}
    810813
     
    816819  if (shift > 0) {
    817820    owl_global_set_rightshift(&g, MAX(shift - 10, 0));
     821    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     822    owl_global_set_needrefresh(&g);
    818823  } else {
    819824    owl_function_beep();
     
    11991204    return;
    12001205
    1201   file = fopen(owl_global_get_debug_file(&g), "a");
     1206  file = owl_global_get_debug_file_handle(&g);
    12021207  if (!file) /* XXX should report this */
    12031208    return;
     
    12091214  vfprintf(file, fmt, ap);
    12101215  putc('\n', file);
    1211   fclose(file);
     1216  fflush(file);
    12121217
    12131218  va_end(ap);
     
    12181223  if (owl_global_is_bell(&g)) {
    12191224    beep();
     1225    owl_global_set_needrefresh(&g); /* do we really need this? */
    12201226  }
    12211227}
     
    12461252}
    12471253
    1248 static void _dirty_everything(owl_window *w) {
    1249   if (!owl_window_is_realized(w))
    1250     return;
    1251   owl_window_dirty(w);
    1252   owl_window_children_foreach(w, (GFunc)_dirty_everything, NULL);
     1254void owl_function_set_cursor(WINDOW *win)
     1255{
     1256  /* Be careful that this window is actually empty, otherwise panels get confused */
     1257  if (is_wintouched(win)) {
     1258    owl_function_debugmsg("Warning: owl_function_set_cursor called on dirty window");
     1259    update_panels();
     1260  }
     1261  wnoutrefresh(win);
    12531262}
    12541263
    12551264void owl_function_full_redisplay(void)
    12561265{
    1257   _dirty_everything(owl_window_get_screen());
     1266  touchwin(owl_global_get_curs_recwin(&g));
     1267  touchwin(owl_global_get_curs_sepwin(&g));
     1268  touchwin(owl_global_get_curs_typwin(&g));
     1269  touchwin(owl_global_get_curs_msgwin(&g));
     1270
     1271  sepbar("");
     1272  owl_function_makemsg("");
     1273
     1274  owl_global_set_needrefresh(&g);
    12581275}
    12591276
     
    12671284
    12681285  owl_popwin_up(pw);
    1269   owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL);
    1270   owl_viewwin_init_text(v, owl_popwin_get_content(pw), text);
     1286  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless");
     1287  owl_viewwin_init_text(v, owl_popwin_get_curswin(pw),
     1288                        owl_popwin_get_lines(pw), owl_popwin_get_cols(pw),
     1289                        text);
     1290  owl_viewwin_redisplay(v);
     1291  owl_global_set_needrefresh(&g);
    12711292}
    12721293
     
    12801301
    12811302  owl_popwin_up(pw);
    1282   owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL);
    1283   owl_viewwin_init_fmtext(v, owl_popwin_get_content(pw), fm);
     1303  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless");
     1304  owl_viewwin_init_fmtext(v, owl_popwin_get_curswin(pw),
     1305                   owl_popwin_get_lines(pw), owl_popwin_get_cols(pw),
     1306                   fm);
     1307  owl_viewwin_redisplay(v);
     1308  owl_global_set_needrefresh(&g);
    12841309}
    12851310
     
    15411566  /* redisplay */
    15421567  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     1568  owl_global_set_needrefresh(&g);
    15431569}
    15441570
     
    15461572{
    15471573  owl_global_set_typwin_lines(&g, newsize);
    1548   owl_mainpanel_layout_contents(&g.mainpanel);
     1574  owl_global_set_relayout_pending(&g);
    15491575}
    15501576
     
    16601686    }
    16611687    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     1688    owl_global_set_needrefresh(&g);
    16621689  } else {
    16631690    owl_function_error("No message with id %d: unable to mark for (un)delete",id);
     
    16951722  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    16961723  owl_function_makemsg("%i messages marked for deletion", count);
     1724  owl_global_set_needrefresh(&g);
    16971725}
    16981726
     
    18991927
    19001928  owl_editwin_set_locktext(tw, "command: ");
     1929  owl_global_set_needrefresh(&g);
    19011930
    19021931  owl_editwin_insert_string(tw, line);
    1903 
    1904   owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline", owl_global_get_typwin_window(&g));
     1932  owl_editwin_redisplay(tw);
     1933
     1934  owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline");
    19051935  owl_editwin_set_callback(tw, owl_callback_command);
    19061936}
     
    19131943
    19141944  owl_editwin_set_locktext(tw, line);
    1915 
    1916   owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g));
     1945  owl_global_set_needrefresh(&g);
     1946
     1947  owl_editwin_redisplay(tw);
     1948
     1949  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    19171950  return tw;
    19181951}
     
    19271960
    19281961  owl_editwin_set_locktext(tw, line);
    1929 
    1930   owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g));
     1962  owl_global_set_needrefresh(&g);
     1963
     1964  owl_editwin_redisplay(tw);
     1965
     1966  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    19311967  return tw;
    19321968}
     
    19631999    pclose(p);
    19642000   
    1965     if (type == OWL_OUTPUT_RETURN) {
     2001    if (type == OWL_OUTPUT_POPUP) {
     2002      owl_function_popless_text(out);
     2003    } else if (type == OWL_OUTPUT_RETURN) {
    19662004      owl_free(newbuff);
    19672005      return out;
    19682006    } else if (type == OWL_OUTPUT_ADMINMSG) {
    19692007      owl_function_adminmsg(buff, out);
     2008    } else {
     2009      owl_function_popless_text(out);
    19702010    }
    19712011    owl_free(out);
     
    20002040    } else if (type == OWL_OUTPUT_RETURN) {
    20012041      return perlout;
     2042    } else {
     2043      owl_function_popless_text(perlout);
    20022044    }
    20032045    owl_free(perlout);
     
    20912133    }
    20922134    owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3]));
     2135    owl_global_set_needrefresh(&g);
    20932136    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    20942137    return;
     
    21052148    }
    21062149    owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3]));
     2150    owl_global_set_needrefresh(&g);
    21072151    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21082152    return;
     
    21332177    owl_function_change_currentview_filter(argv[1]);
    21342178  }
     2179  owl_global_set_needrefresh(&g);
    21352180  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21362181}
     
    24602505
    24612506  owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
    2462 }
    2463 
    2464 static char *owl_function_smartfilter_cc(const owl_message *m) {
    2465   const char *ccs;
    2466   char *filtname;
    2467   char *text;
    2468   owl_filter *f;
    2469 
    2470   ccs = owl_message_get_attribute_value(m, "zephyr_ccs");
    2471 
    2472   filtname = owl_sprintf("conversation-%s", ccs);
    2473   owl_text_tr(filtname, ' ', '-');
    2474 
    2475   if (owl_global_get_filter(&g, filtname)) {
    2476     return filtname;
    2477   }
    2478 
    2479   text = owl_sprintf("type ^zephyr$ and filter personal and "
    2480                      "zephyr_ccs ^%s%s%s$",
    2481                      owl_getquoting(ccs), ccs, owl_getquoting(ccs));
    2482 
    2483   f = owl_filter_new_fromstring(filtname, text);
    2484 
    2485   owl_global_add_filter(&g, f);
    2486 
    2487   owl_free(text);
    2488 
    2489   return filtname;
    24902507}
    24912508
     
    25432560  if (owl_message_is_type_zephyr(m)) {
    25442561    if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
    2545       if (owl_message_get_attribute_value(m, "zephyr_ccs") != NULL) {
    2546         return owl_function_smartfilter_cc(m);
    2547       }
    2548 
    25492562      if (owl_message_is_direction_in(m)) {
    25502563        zperson=short_zuser(owl_message_get_sender(m));
     
    26762689  owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor));
    26772690 
     2691  owl_global_set_needrefresh(&g);
    26782692  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    26792693  return(0);
     
    28392853    km = owl_keyhandler_get_keymap(kh, kmname);
    28402854    owl_fmtext_append_bold(&fm, "\n\n----------------------------------------------------------------------------------------------------\n\n");
    2841     owl_keymap_get_details(km, &fm, 0);
     2855    owl_keymap_get_details(km, &fm);   
    28422856  }
    28432857  owl_fmtext_append_normal(&fm, "\n");
     
    28652879  km = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name);
    28662880  if (km) {
    2867     owl_keymap_get_details(km, &fm, 1);
     2881    owl_keymap_get_details(km, &fm);
    28682882  } else {
    28692883    owl_fmtext_append_normal(&fm, "No such keymap...\n");
     
    33893403{
    33903404  va_list ap;
    3391   char *str;
     3405  char buff[2048];
     3406
     3407  if (!owl_global_get_curs_msgwin(&g)) return;
    33923408
    33933409  va_start(ap, fmt);
    3394   str = g_strdup_vprintf(fmt, ap);
     3410  werase(owl_global_get_curs_msgwin(&g));
     3411 
     3412  vsnprintf(buff, 2048, fmt, ap);
     3413  owl_function_debugmsg("makemsg: %s", buff);
     3414  waddstr(owl_global_get_curs_msgwin(&g), buff); 
     3415  owl_global_set_needrefresh(&g);
    33953416  va_end(ap);
    3396 
    3397   owl_function_debugmsg("makemsg: %s", str);
    3398   owl_msgwin_set_text(&g.msgwin, str);
    33993417}
    34003418
Note: See TracChangeset for help on using the changeset viewer.