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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines