Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    rf7cf6c2 r3aa0522  
    311311{
    312312  owl_input j;
    313   WINDOW *typwin;
    314 
    315   typwin = owl_global_get_curs_typwin(&g);
    316313
    317314  while (1) {
    318     j.ch = wgetch(typwin);
     315    j.ch = wgetch(g.input_pad);
    319316    if (j.ch == ERR) return;
    320317
     
    339336     
    340337      for (i = 1; i < bytes; i++) {
    341         int tmp =  wgetch(typwin);
     338        int tmp = wgetch(g.input_pad);
    342339        /* If what we got was not a byte, or not a continuation byte */
    343340        if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) {
     
    458455#endif /* OWL_STDERR_REDIR */
    459456
    460 void owl_zephyr_buddycheck_timer(owl_timer *t, void *data)
    461 {
    462   if (owl_global_is_pseudologins(&g)) {
    463     owl_function_debugmsg("Doing zephyr buddy check");
    464     owl_function_zephyr_buddy_check(1);
    465   }
     457static int owl_refresh_pre_select_action(owl_ps_action *a, void *data)
     458{
     459  /* if a resize has been scheduled, deal with it */
     460  owl_global_resize(&g, 0, 0);
     461  /* also handle relayouts */
     462  owl_global_relayout(&g);
     463
     464  /* update the terminal if we need to */
     465  if (owl_global_is_needrefresh(&g)) {
     466    /* these are here in case a relayout changes the windows */
     467    WINDOW *sepwin = owl_global_get_curs_sepwin(&g);
     468    WINDOW *typwin = owl_global_get_curs_typwin(&g);
     469
     470    /* push all changed windows to screen */
     471    update_panels();
     472    /* leave the cursor in the appropriate window */
     473    if (!owl_popwin_is_active(owl_global_get_popwin(&g))
     474        && owl_global_get_typwin(&g)) {
     475      owl_function_set_cursor(typwin);
     476    } else {
     477      owl_function_set_cursor(sepwin);
     478    }
     479    doupdate();
     480    owl_global_set_noneedrefresh(&g);
     481  }
     482  return 0;
    466483}
    467484
     
    469486int main(int argc, char **argv, char **env)
    470487{
    471   WINDOW *sepwin, *typwin;
    472488  int argcsave;
    473489  const char *const *argvsave;
     
    583599  owl_function_source(NULL);
    584600
    585   update_panels();
    586 
    587601  /* Set the default style */
    588602  owl_function_debugmsg("startup: setting startup and default style");
     
    605619  owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv");
    606620
    607   owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL);
    608 
    609   /* If we ever deprecate the mainloop hook, remove this. */
    610   owl_select_add_timer(0, 1, owl_perlconfig_mainloop, NULL, NULL);
    611 
     621  owl_select_add_pre_select_action(owl_refresh_pre_select_action, NULL, NULL);
    612622  owl_select_add_pre_select_action(owl_process_messages, NULL, NULL);
    613623
     
    615625  /* main loop */
    616626  while (1) {
    617 
    618     /* if a resize has been scheduled, deal with it */
    619     owl_global_resize(&g, 0, 0);
    620     /* also handle relayouts */
    621     owl_global_relayout(&g);
    622 
    623     /* these are here in case a relayout changes the windows */
    624     sepwin=owl_global_get_curs_sepwin(&g);
    625     typwin=owl_global_get_curs_typwin(&g);
    626 
    627     /* update the terminal if we need to */
    628     if (owl_global_is_needrefresh(&g)) {
    629       /* push all changed windows to screen */
    630       update_panels();
    631       /* leave the cursor in the appropriate window */
    632       if (!owl_popwin_is_active(owl_global_get_popwin(&g))
    633           && owl_global_get_typwin(&g)) {
    634         owl_function_set_cursor(typwin);
    635       } else {
    636         owl_function_set_cursor(sepwin);
    637       }
    638       doupdate();
    639       owl_global_set_noneedrefresh(&g);
    640     }
    641 
    642627    /* select on FDs we know about. */
    643628    owl_select();
Note: See TracChangeset for help on using the changeset viewer.