ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.295 by root, Fri Jan 4 20:39:42 2008 UTC vs.
Revision 1.301 by ayin, Sat Jan 19 13:00:10 2008 UTC

226 if (fontset[i] != fontset[0]) 226 if (fontset[i] != fontset[0])
227 delete fontset[i]; 227 delete fontset[i];
228#endif 228#endif
229 delete fontset[0]; 229 delete fontset[0];
230 230
231#ifdef HAVE_BG_PIXMAP
232 bgPixmap.destroy ();
233#endif
234
231 if (display) 235 if (display)
232 { 236 {
233 selection_clear (); 237 selection_clear ();
234 238
235#ifdef USE_XIM 239#ifdef USE_XIM
274 pix_colors_unfocused [i].free (this); 278 pix_colors_unfocused [i].free (this);
275#endif 279#endif
276 } 280 }
277 281
278 clear (); 282 clear ();
279 }
280 283
281#ifdef HAVE_BG_PIXMAP
282 bgPixmap.destroy ();
283#endif
284 display->flush (); /* ideally .put should do this */ 284 display->flush (); /* ideally .put should do this */
285 displays.put (display); 285 displays.put (display);
286 }
286 287
287 scr_release (); 288 scr_release ();
288 289
289 /* clear all resources */ 290 /* clear all resources */
290 for (int i = 0; i < allocated.size (); i++) 291 for (int i = 0; i < allocated.size (); i++)
467 DisplayString (display)); 468 DisplayString (display));
468 rxvt_emergency_cleanup (); 469 rxvt_emergency_cleanup ();
469 _exit (EXIT_FAILURE); 470 _exit (EXIT_FAILURE);
470} 471}
471 472
472/*----------------------------------------------------------------------*/
473void
474rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
475{
476 this->envv = envv;
477
478 SET_R (this);
479 set_locale ("");
480 set_environ (envv); // few things in X do not call setlocale :(
481
482 init_vars ();
483
484 init_secondary ();
485
486 const char **cmd_argv = init_resources (argc, argv);
487
488#ifdef KEYSYM_RESOURCE
489 keyboard->register_done ();
490#endif
491
492#ifdef HAVE_SCROLLBARS
493 if (option (Opt_scrollBar))
494 scrollBar.setIdle (); /* set existence for size calculations */
495#endif
496
497 pty = ptytty::create ();
498
499 create_windows (argc, argv);
500
501 init_xlocale ();
502
503 scr_reset (); // initialize screen
504
505#if 0
506 XSynchronize (dpy, True);
507#endif
508
509#ifdef HAVE_SCROLLBARS
510 if (option (Opt_scrollBar))
511 resize_scrollbar (); /* create and map scrollbar */
512#endif
513#ifdef HAVE_BG_PIXMAP
514 {
515 bgPixmap.set_target (this);
516
517#ifdef ENABLE_TRANSPARENCY
518 if (option (Opt_transparent))
519 {
520 bgPixmap.set_transparent ();
521
522#ifdef HAVE_AFTERIMAGE
523 if (rs [Rs_blurradius])
524 bgPixmap.set_blur_radius (rs [Rs_blurradius]);
525#endif
526 if (ISSET_PIXCOLOR (Color_tint))
527 bgPixmap.set_tint (pix_colors_focused [Color_tint]);
528
529 if (rs [Rs_shade])
530 bgPixmap.set_shade (rs [Rs_shade]);
531
532 bgPixmap.set_root_pixmap ();
533 XSelectInput (dpy, display->root, PropertyChangeMask);
534 rootwin_ev.start (display, display->root);
535 }
536#endif
537
538#ifdef BG_IMAGE_FROM_FILE
539 if (rs[Rs_backgroundPixmap])
540 {
541 const char *p = rs[Rs_backgroundPixmap];
542
543 if ((p = strchr (p, ';')) != 0)
544 {
545 p++;
546 bgPixmap.set_geometry (p);
547 }
548 else
549 bgPixmap.set_defaultGeometry ();
550
551 if (bgPixmap.set_file (rs[Rs_backgroundPixmap]))
552 if (!bgPixmap.window_position_sensitive ())
553 update_background ();
554 }
555#endif
556 }
557#endif
558
559#if ENABLE_PERL
560 rootwin_ev.start (display, display->root);
561#endif
562
563 set_colorfgbg ();
564
565 init_command (cmd_argv);
566
567 free (cmd_argv);
568
569 if (pty->pty >= 0)
570 pty_ev.start (pty->pty, ev::READ);
571
572 HOOK_INVOKE ((this, HOOK_START, DT_END));
573
574#if ENABLE_XEMBED
575 if (rs[Rs_embed])
576 {
577 long info[2] = { 0, XEMBED_MAPPED };
578
579 XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO],
580 32, PropModeReplace, (unsigned char *)&info, 2);
581 }
582#endif
583
584 XMapWindow (dpy, vt);
585 XMapWindow (dpy, parent[0]);
586}
587
588static struct sig_handlers 473static struct sig_handlers
589{ 474{
590 ev::sig sw_term, sw_int; 475 ev::sig sw_term, sw_int;
591 476
592 /* 477 /*
1716 if (update_background_ev.is_active ()) 1601 if (update_background_ev.is_active ())
1717 return; 1602 return;
1718 1603
1719 bgPixmap.invalidate (); 1604 bgPixmap.invalidate ();
1720 1605
1721 ev_tstamp refresh; 1606 ev_tstamp to_wait = 0.5 - (ev::now () - bgPixmap.valid_since);
1722 1607
1723 if (!bgPixmap.need_client_side_rendering ()) 1608 if (to_wait <= 0.)
1724 refresh = .05; 1609 bgPixmap.render ();
1725 else if (bgPixmap.flags & bgPixmap_t::blurNeeded)
1726 /* no chance of real time refresh if we are bluring! */
1727 refresh = .50;
1728 else 1610 else
1729 refresh = .07;
1730
1731 update_background_ev.start (refresh); 1611 update_background_ev.start (to_wait);
1732} 1612}
1733 1613
1734void 1614void
1735rxvt_term::update_background_cb (ev::timer &w, int revents) 1615rxvt_term::update_background_cb (ev::timer &w, int revents)
1736{ 1616{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines