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.360 by sf-exg, Fri Aug 19 16:01:37 2011 UTC vs.
Revision 1.368 by root, Wed Jan 18 12:26:59 2012 UTC

267 for (int i = 0; i < allocated.size (); i++) 267 for (int i = 0; i < allocated.size (); i++)
268 free (allocated [i]); 268 free (allocated [i]);
269 269
270 free (selection.text); 270 free (selection.text);
271 free (selection.clip_text); 271 free (selection.clip_text);
272 // TODO: manage env vars in child only(!)
273 free (env_display);
274 free (env_term);
275 free (locale); 272 free (locale);
276 free (v_buffer); 273 free (v_buffer);
277 274
278 delete selection_req; 275 delete selection_req;
279 276
353 350
354 delete this; 351 delete this;
355} 352}
356 353
357void 354void
358rxvt_term::set_option (uint8_t opt, bool set) 355rxvt_term::set_option (uint8_t opt, bool set) NOTHROW
359{ 356{
360 if (!opt) 357 if (!opt)
361 return; 358 return;
362 359
363 uint8_t mask = 1 << (opt & 7); 360 uint8_t mask = 1 << (opt & 7);
713 // size, i.e., when the wm does not honour our size hints, there are 710 // size, i.e., when the wm does not honour our size hints, there are
714 // extra areas not covered by the terminal screen. Such gaps, when a 711 // extra areas not covered by the terminal screen. Such gaps, when a
715 // bg pixmap is set, would have to be cleared manually to properly 712 // bg pixmap is set, would have to be cleared manually to properly
716 // refresh the background. We take the simpler route and shrink the 713 // refresh the background. We take the simpler route and shrink the
717 // vt window so as to avoid creating gaps. 714 // vt window so as to avoid creating gaps.
718 width = ncol * fwidth; 715 vt_width = ncol * fwidth;
719 height = nrow * fheight; 716 vt_height = nrow * fheight;
720} 717}
721 718
722/*----------------------------------------------------------------------*/ 719/*----------------------------------------------------------------------*/
723/* 720/*
724 * Tell the teletype handler what size the window is. 721 * Tell the teletype handler what size the window is.
732 729
733 struct winsize ws; 730 struct winsize ws;
734 731
735 ws.ws_col = ncol; 732 ws.ws_col = ncol;
736 ws.ws_row = nrow; 733 ws.ws_row = nrow;
737 ws.ws_xpixel = width; 734 ws.ws_xpixel = vt_width;
738 ws.ws_ypixel = height; 735 ws.ws_ypixel = vt_height;
739 ioctl (pty->pty, TIOCSWINSZ, &ws); 736 ioctl (pty->pty, TIOCSWINSZ, &ws);
740 737
741#if 0 738#if 0
742 // TIOCSWINSZ is supposed to do this automatically and correctly 739 // TIOCSWINSZ is supposed to do this automatically and correctly
743 if (cmd_pid) /* force through to the command */ 740 if (cmd_pid) /* force through to the command */
947 944
948/*----------------------------------------------------------------------*/ 945/*----------------------------------------------------------------------*/
949/* 946/*
950 * find if fg/bg matches any of the normal (low-intensity) colors 947 * find if fg/bg matches any of the normal (low-intensity) colors
951 */ 948 */
952void 949char *
953rxvt_term::set_colorfgbg () 950rxvt_term::get_colorfgbg ()
954{ 951{
955 unsigned int i; 952 unsigned int i;
956 const char *xpmb = ""; 953 const char *xpmb = "";
957 char fstr[] = "default"; 954 char fstr[] = "default";
958 char bstr[] = "default"; 955 char bstr[] = "default";
956 char *env_colorfgbg;
959 957
960 for (i = Color_Black; i <= Color_White; i++) 958 for (i = Color_Black; i <= Color_White; i++)
961 if (pix_colors[Color_fg] == pix_colors[i]) 959 if (pix_colors[Color_fg] == pix_colors[i])
962 { 960 {
963 sprintf (fstr, "%d", i - Color_Black); 961 sprintf (fstr, "%d", i - Color_Black);
972 xpmb = "default;"; 970 xpmb = "default;";
973#endif 971#endif
974 break; 972 break;
975 } 973 }
976 974
975 env_colorfgbg = (char *)rxvt_malloc (sizeof ("COLORFGBG=default;default;bg"));
977 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); 976 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr);
977 return env_colorfgbg;
978} 978}
979 979
980/*----------------------------------------------------------------------*/ 980/*----------------------------------------------------------------------*/
981 981
982bool 982bool
1075 if (scrollBar.state) 1075 if (scrollBar.state)
1076 scrollBar.resize (); 1076 scrollBar.resize ();
1077 1077
1078 XMoveResizeWindow (dpy, vt, 1078 XMoveResizeWindow (dpy, vt,
1079 window_vt_x, window_vt_y, 1079 window_vt_x, window_vt_y,
1080 width, height); 1080 vt_width, vt_height);
1081 1081
1082#ifdef HAVE_BG_PIXMAP 1082#ifdef HAVE_BG_PIXMAP
1083 if (bg_window_size_sensitive ()) 1083 if (bg_window_size_sensitive ())
1084 update_background (); 1084 update_background ();
1085#endif 1085#endif
1110 newwidth = wattr.width - szHint.base_width; 1110 newwidth = wattr.width - szHint.base_width;
1111 if (newheight == 0) 1111 if (newheight == 0)
1112 newheight = wattr.height - szHint.base_height; 1112 newheight = wattr.height - szHint.base_height;
1113 } 1113 }
1114 1114
1115 if (newwidth != width || newheight != height) 1115 if (newwidth != vt_width || newheight != vt_height)
1116 { 1116 {
1117 newwidth += szHint.base_width; 1117 newwidth += szHint.base_width;
1118 newheight += szHint.base_height; 1118 newheight += szHint.base_height;
1119 resize_all_windows (newwidth, newheight, 0); 1119 resize_all_windows (newwidth, newheight, 0);
1120 } 1120 }
1568 1568
1569 /* try with no modifiers base IF the user didn't specify an IM */ 1569 /* try with no modifiers base IF the user didn't specify an IM */
1570 if (im_get_ic ("@im=none")) 1570 if (im_get_ic ("@im=none"))
1571 goto done; 1571 goto done;
1572 1572
1573done: 1573done: ;
1574#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1574#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1575 if (rs[Rs_imLocale]) 1575 if (rs[Rs_imLocale])
1576 SET_LOCALE (locale); 1576 SET_LOCALE (locale);
1577#endif 1577#endif
1578} 1578}
1659 if (update_background_ev.is_active ()) 1659 if (update_background_ev.is_active ())
1660 return; 1660 return;
1661 1661
1662 bg_invalidate (); 1662 bg_invalidate ();
1663 1663
1664 if (!mapped)
1665 return;
1666
1664 ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); 1667 ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since);
1665 1668
1666 if (to_wait <= 0.) 1669 if (to_wait <= 0.)
1667 bg_render (); 1670 bg_render ();
1668 else 1671 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines