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.312 by root, Tue Nov 4 16:41:12 2008 UTC vs.
Revision 1.322 by root, Tue Mar 30 23:00:35 2010 UTC

237#endif 237#endif
238 238
239 if (display) 239 if (display)
240 { 240 {
241 selection_clear (); 241 selection_clear ();
242 selection_clear (true);
242 243
243#ifdef USE_XIM 244#ifdef USE_XIM
244 im_destroy (); 245 im_destroy ();
245#endif 246#endif
246 scrollBar.destroy (); 247 scrollBar.destroy ();
271 /* clear all resources */ 272 /* clear all resources */
272 for (int i = 0; i < allocated.size (); i++) 273 for (int i = 0; i < allocated.size (); i++)
273 free (allocated [i]); 274 free (allocated [i]);
274 275
275 free (selection.text); 276 free (selection.text);
277 free (selection.clip_text);
276 // TODO: manage env vars in child only(!) 278 // TODO: manage env vars in child only(!)
277 free (env_display); 279 free (env_display);
278 free (env_term); 280 free (env_term);
279 free (locale); 281 free (locale);
280 free (v_buffer); 282 free (v_buffer);
646 648
647 ws.ws_col = ncol; 649 ws.ws_col = ncol;
648 ws.ws_row = nrow; 650 ws.ws_row = nrow;
649 ws.ws_xpixel = width; 651 ws.ws_xpixel = width;
650 ws.ws_ypixel = height; 652 ws.ws_ypixel = height;
651 (void)ioctl (pty->pty, TIOCSWINSZ, &ws); 653 ioctl (pty->pty, TIOCSWINSZ, &ws);
652 654
653#if 0 655#if 0
654 // TIOCSWINSZ is supposed to do this automatically and correctly 656 // TIOCSWINSZ is supposed to do this automatically and correctly
655 if (cmd_pid) /* force through to the command */ 657 if (cmd_pid) /* force through to the command */
656 kill (-cmd_pid, SIGWINCH); 658 kill (-cmd_pid, SIGWINCH);
686#endif 688#endif
687 689
688 delete fontset[0]; 690 delete fontset[0];
689 fontset[0] = fs; 691 fontset[0] = fs;
690 692
691 prop = (*fs)[1]->properties (); 693 prop = fs->get (0, 1)->properties ();
692 prop.height += lineSpace; 694 prop.height += lineSpace;
695 prop.width += letterSpace;
693 696
694 fs->set_prop (prop, false); 697 fs->set_prop (prop, false);
695 698
696 fwidth = prop.width; 699 fwidth = prop.width;
697 fheight = prop.height; 700 fheight = prop.height;
913 916
914 window_calc (newwidth, newheight); 917 window_calc (newwidth, newheight);
915 918
916 bool set_hint = !HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END)); 919 bool set_hint = !HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END));
917 920
921 // to avoid races between us and the wm, we clear the incremental size hints around the xresizewindow
918 if (set_hint) 922 if (set_hint)
919 { 923 {
920 szHint.flags &= ~(PBaseSize | PResizeInc); 924 szHint.flags &= ~(PBaseSize | PResizeInc);
921 XSetWMNormalHints (dpy, parent[0], &szHint); 925 XSetWMNormalHints (dpy, parent[0], &szHint);
922 szHint.flags |= PBaseSize | PResizeInc; 926 szHint.flags |= PBaseSize | PResizeInc;
968#else 972#else
969 XResizeWindow (dpy, parent[0], szHint.width, szHint.height); 973 XResizeWindow (dpy, parent[0], szHint.width, szHint.height);
970#endif 974#endif
971 } 975 }
972 976
977 if (set_hint)
978 XSetWMNormalHints (dpy, parent[0], &szHint);
979
973 fix_screen = ncol != prev_ncol || nrow != prev_nrow; 980 fix_screen = ncol != prev_ncol || nrow != prev_nrow;
974 981
975 if (fix_screen || newwidth != old_width || newheight != old_height) 982 if (fix_screen || newwidth != old_width || newheight != old_height)
976 { 983 {
977 if (scrollBar.state) 984 if (scrollBar.state)
983 990
984#ifdef HAVE_BG_PIXMAP 991#ifdef HAVE_BG_PIXMAP
985 if (bgPixmap.window_size_sensitive ()) 992 if (bgPixmap.window_size_sensitive ())
986 update_background (); 993 update_background ();
987#endif 994#endif
988
989 scr_clear ();
990 } 995 }
991
992 if (set_hint)
993 XSetWMNormalHints (dpy, parent[0], &szHint);
994 996
995 if (fix_screen || old_height == 0) 997 if (fix_screen || old_height == 0)
996 scr_reset (); 998 scr_reset ();
997
998 // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version
999 //scr_touch (false);
1000 999
1001#ifdef HAVE_BG_PIXMAP 1000#ifdef HAVE_BG_PIXMAP
1002// TODO: this don't seem to have any effect - do we still need it ? If so - in which case exactly ? 1001// TODO: this don't seem to have any effect - do we still need it ? If so - in which case exactly ?
1003// if (bgPixmap.pixmap) 1002// if (bgPixmap.pixmap)
1004// scr_touch (false); 1003// scr_touch (false);
1076 1075
1077/* Checking whether input method is running. */ 1076/* Checking whether input method is running. */
1078bool 1077bool
1079rxvt_term::IMisRunning () 1078rxvt_term::IMisRunning ()
1080{ 1079{
1081 char *p;
1082 Atom atom; 1080 Atom atom;
1083 Window win; 1081 Window win;
1084 char server[IMBUFSIZ]; 1082 char server[IMBUFSIZ];
1085 1083
1086 /* get current locale modifier */ 1084 /* get current locale modifier */
1087 if ((p = XSetLocaleModifiers (NULL)) != NULL) 1085 if (char *p = XSetLocaleModifiers (0))
1088 { 1086 {
1089 strcpy (server, "@server="); 1087 strcpy (server, "@server=");
1090 strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */ 1088 strncat (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */
1091 1089
1092 if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ 1090 if (p = strchr (server + 1, '@')) /* first one only */
1093 *p = '\0'; 1091 *p = '\0';
1094 1092
1095 atom = XInternAtom (dpy, server, False); 1093 atom = XInternAtom (dpy, server, False);
1096 win = XGetSelectionOwner (dpy, atom); 1094 win = XGetSelectionOwner (dpy, atom);
1097 1095
1164 1162
1165 term->make_current (); 1163 term->make_current ();
1166 1164
1167 if (text) 1165 if (text)
1168 { 1166 {
1169 void *str; 1167 wchar_t *str;
1170 1168
1171 if (!text->encoding_is_wchar && text->string.multi_byte) 1169 if (!text->encoding_is_wchar && text->string.multi_byte)
1172 { 1170 {
1173 // of course, X makes it ugly again 1171 // of course, X makes it ugly again
1174 if (term->rs[Rs_imLocale]) 1172 if (term->rs[Rs_imLocale])
1175 SET_LOCALE (term->rs[Rs_imLocale]); 1173 SET_LOCALE (term->rs[Rs_imLocale]);
1176 1174
1177 str = rxvt_temp_buf ((text->length + 1) * sizeof (wchar_t)); 1175 str = rxvt_temp_buf<wchar_t> (text->length + 1);
1178 mbstowcs ((wchar_t *)str, text->string.multi_byte, text->length + 1); 1176 mbstowcs (str, text->string.multi_byte, text->length + 1);
1179 1177
1180 if (term->rs[Rs_imLocale]) 1178 if (term->rs[Rs_imLocale])
1181 SET_LOCALE (term->locale); 1179 SET_LOCALE (term->locale);
1182 } 1180 }
1183 else 1181 else
1184 str = (void *)text->string.wide_char; 1182 str = text->string.wide_char;
1185 1183
1186 HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW, 1184 HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW,
1187 DT_INT, call_data->caret, 1185 DT_INT, call_data->caret,
1188 DT_INT, call_data->chg_first, 1186 DT_INT, call_data->chg_first,
1189 DT_INT, call_data->chg_length, 1187 DT_INT, call_data->chg_length,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines