Changes in owl.c [3aa0522:f7cf6c2]
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r3aa0522 rf7cf6c2 311 311 { 312 312 owl_input j; 313 WINDOW *typwin; 314 315 typwin = owl_global_get_curs_typwin(&g); 313 316 314 317 while (1) { 315 j.ch = wgetch( g.input_pad);318 j.ch = wgetch(typwin); 316 319 if (j.ch == ERR) return; 317 320 … … 336 339 337 340 for (i = 1; i < bytes; i++) { 338 int tmp = wgetch(g.input_pad);341 int tmp = wgetch(typwin); 339 342 /* If what we got was not a byte, or not a continuation byte */ 340 343 if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) { … … 455 458 #endif /* OWL_STDERR_REDIR */ 456 459 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; 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 } 483 466 } 484 467 … … 486 469 int main(int argc, char **argv, char **env) 487 470 { 471 WINDOW *sepwin, *typwin; 488 472 int argcsave; 489 473 const char *const *argvsave; … … 599 583 owl_function_source(NULL); 600 584 585 update_panels(); 586 601 587 /* Set the default style */ 602 588 owl_function_debugmsg("startup: setting startup and default style"); … … 619 605 owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv"); 620 606 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 622 612 owl_select_add_pre_select_action(owl_process_messages, NULL, NULL); 623 613 … … 625 615 /* main loop */ 626 616 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 627 642 /* select on FDs we know about. */ 628 643 owl_select();
Note: See TracChangeset
for help on using the changeset viewer.