… | |
… | |
101 | { |
101 | { |
102 | if (cc->c2 == c2) return c1; |
102 | if (cc->c2 == c2) return c1; |
103 | cc = (*this)[cc->c1]; |
103 | cc = (*this)[cc->c1]; |
104 | } |
104 | } |
105 | |
105 | |
106 | // check to see wether this combination already exists otherwise |
106 | // check to see whether this combination already exists otherwise |
107 | for (cc = v.end (); cc-- > v.begin (); ) |
107 | for (cc = v.end (); cc-- > v.begin (); ) |
108 | { |
108 | { |
109 | if (cc->c1 == c1 && cc->c2 == c2) |
109 | if (cc->c1 == c1 && cc->c2 == c2) |
110 | return COMPOSE_LO + (cc - v.begin ()); |
110 | return COMPOSE_LO + (cc - v.begin ()); |
111 | } |
111 | } |
… | |
… | |
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); |
… | |
… | |
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)[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; |
… | |
… | |
992 | } |
995 | } |
993 | |
996 | |
994 | if (fix_screen || old_height == 0) |
997 | if (fix_screen || old_height == 0) |
995 | scr_reset (); |
998 | scr_reset (); |
996 | |
999 | |
997 | // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version |
|
|
998 | //scr_touch (false); |
|
|
999 | |
|
|
1000 | #ifdef HAVE_BG_PIXMAP |
1000 | #ifdef HAVE_BG_PIXMAP |
1001 | // 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 ? |
1002 | // if (bgPixmap.pixmap) |
1002 | // if (bgPixmap.pixmap) |
1003 | // scr_touch (false); |
1003 | // scr_touch (false); |
1004 | #endif |
1004 | #endif |
… | |
… | |
1075 | |
1075 | |
1076 | /* Checking whether input method is running. */ |
1076 | /* Checking whether input method is running. */ |
1077 | bool |
1077 | bool |
1078 | rxvt_term::IMisRunning () |
1078 | rxvt_term::IMisRunning () |
1079 | { |
1079 | { |
1080 | char *p; |
|
|
1081 | Atom atom; |
1080 | Atom atom; |
1082 | Window win; |
1081 | Window win; |
1083 | char server[IMBUFSIZ]; |
1082 | char server[IMBUFSIZ]; |
1084 | |
1083 | |
1085 | /* get current locale modifier */ |
1084 | /* get current locale modifier */ |
1086 | if ((p = XSetLocaleModifiers (NULL)) != NULL) |
1085 | if (char *p = XSetLocaleModifiers (0)) |
1087 | { |
1086 | { |
1088 | strcpy (server, "@server="); |
1087 | strcpy (server, "@server="); |
1089 | strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */ |
1088 | strncat (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */ |
1090 | |
1089 | |
1091 | if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ |
1090 | if (p = strchr (server + 1, '@')) /* first one only */ |
1092 | *p = '\0'; |
1091 | *p = '\0'; |
1093 | |
1092 | |
1094 | atom = XInternAtom (dpy, server, False); |
1093 | atom = XInternAtom (dpy, server, False); |
1095 | win = XGetSelectionOwner (dpy, atom); |
1094 | win = XGetSelectionOwner (dpy, atom); |
1096 | |
1095 | |
… | |
… | |
1163 | |
1162 | |
1164 | term->make_current (); |
1163 | term->make_current (); |
1165 | |
1164 | |
1166 | if (text) |
1165 | if (text) |
1167 | { |
1166 | { |
1168 | void *str; |
1167 | wchar_t *str; |
1169 | |
1168 | |
1170 | if (!text->encoding_is_wchar && text->string.multi_byte) |
1169 | if (!text->encoding_is_wchar && text->string.multi_byte) |
1171 | { |
1170 | { |
1172 | // of course, X makes it ugly again |
1171 | // of course, X makes it ugly again |
1173 | if (term->rs[Rs_imLocale]) |
1172 | if (term->rs[Rs_imLocale]) |
1174 | SET_LOCALE (term->rs[Rs_imLocale]); |
1173 | SET_LOCALE (term->rs[Rs_imLocale]); |
1175 | |
1174 | |
1176 | str = rxvt_temp_buf ((text->length + 1) * sizeof (wchar_t)); |
1175 | str = rxvt_temp_buf<wchar_t> (text->length + 1); |
1177 | mbstowcs ((wchar_t *)str, text->string.multi_byte, text->length + 1); |
1176 | mbstowcs (str, text->string.multi_byte, text->length + 1); |
1178 | |
1177 | |
1179 | if (term->rs[Rs_imLocale]) |
1178 | if (term->rs[Rs_imLocale]) |
1180 | SET_LOCALE (term->locale); |
1179 | SET_LOCALE (term->locale); |
1181 | } |
1180 | } |
1182 | else |
1181 | else |
1183 | str = (void *)text->string.wide_char; |
1182 | str = text->string.wide_char; |
1184 | |
1183 | |
1185 | HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW, |
1184 | HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW, |
1186 | DT_INT, call_data->caret, |
1185 | DT_INT, call_data->caret, |
1187 | DT_INT, call_data->chg_first, |
1186 | DT_INT, call_data->chg_first, |
1188 | DT_INT, call_data->chg_length, |
1187 | DT_INT, call_data->chg_length, |