Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r3aa0522 rf7cf6c2  
    311311{
    312312  owl_input j;
     313  WINDOW *typwin;
     314
     315  typwin = owl_global_get_curs_typwin(&g);
    313316
    314317  while (1) {
    315     j.ch = wgetch(g.input_pad);
     318    j.ch = wgetch(typwin);
    316319    if (j.ch == ERR) return;
    317320
     
    336339     
    337340      for (i = 1; i < bytes; i++) {
    338         int tmp = wgetch(g.input_pad);
     341        int tmp =  wgetch(typwin);
    339342        /* If what we got was not a byte, or not a continuation byte */
    340343        if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) {
     
    455458#endif /* OWL_STDERR_REDIR */
    456459
    457 static 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;
     460void 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  }
    483466}
    484467
     
    486469int main(int argc, char **argv, char **env)
    487470{
     471  WINDOW *sepwin, *typwin;
    488472  int argcsave;
    489473  const char *const *argvsave;
     
    599583  owl_function_source(NULL);
    600584
     585  update_panels();
     586
    601587  /* Set the default style */
    602588  owl_function_debugmsg("startup: setting startup and default style");
     
    619605  owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv");
    620606
    621   owl_select_add_pre_select_action(owl_refresh_pre_select_action, NULL, NULL);
     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
    622612  owl_select_add_pre_select_action(owl_process_messages, NULL, NULL);
    623613
     
    625615  /* main loop */
    626616  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
    627642    /* select on FDs we know about. */
    628643    owl_select();
Note: See TracChangeset for help on using the changeset viewer.