… | |
… | |
227 | delete fontset[0]; |
227 | delete fontset[0]; |
228 | |
228 | |
229 | #ifdef HAVE_BG_PIXMAP |
229 | #ifdef HAVE_BG_PIXMAP |
230 | bgPixmap.destroy (); |
230 | bgPixmap.destroy (); |
231 | #endif |
231 | #endif |
|
|
232 | #ifdef HAVE_AFTERIMAGE |
|
|
233 | if (asv) |
|
|
234 | destroy_asvisual (asv, 0); |
|
|
235 | if (asimman) |
|
|
236 | destroy_image_manager (asimman, 0); |
|
|
237 | #endif |
232 | |
238 | |
233 | if (display) |
239 | if (display) |
234 | { |
240 | { |
235 | selection_clear (); |
241 | selection_clear (); |
236 | |
242 | |
… | |
… | |
619 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
625 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
620 | |
626 | |
621 | if (recalc_y) |
627 | if (recalc_y) |
622 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
628 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
623 | |
629 | |
624 | ncol = width / fwidth; |
630 | ncol = width / fwidth; |
625 | nrow = height / fheight; |
631 | nrow = height / fheight; |
626 | } |
632 | } |
627 | |
633 | |
628 | /*----------------------------------------------------------------------*/ |
634 | /*----------------------------------------------------------------------*/ |
629 | /* |
635 | /* |
… | |
… | |
640 | |
646 | |
641 | ws.ws_col = ncol; |
647 | ws.ws_col = ncol; |
642 | ws.ws_row = nrow; |
648 | ws.ws_row = nrow; |
643 | ws.ws_xpixel = width; |
649 | ws.ws_xpixel = width; |
644 | ws.ws_ypixel = height; |
650 | ws.ws_ypixel = height; |
645 | (void)ioctl (pty->pty, TIOCSWINSZ, &ws); |
651 | ioctl (pty->pty, TIOCSWINSZ, &ws); |
646 | |
652 | |
647 | #if 0 |
653 | #if 0 |
648 | // TIOCSWINSZ is supposed to do this automatically and correctly |
654 | // TIOCSWINSZ is supposed to do this automatically and correctly |
649 | if (cmd_pid) /* force through to the command */ |
655 | if (cmd_pid) /* force through to the command */ |
650 | kill (-cmd_pid, SIGWINCH); |
656 | kill (-cmd_pid, SIGWINCH); |
… | |
… | |
682 | delete fontset[0]; |
688 | delete fontset[0]; |
683 | fontset[0] = fs; |
689 | fontset[0] = fs; |
684 | |
690 | |
685 | prop = (*fs)[1]->properties (); |
691 | prop = (*fs)[1]->properties (); |
686 | prop.height += lineSpace; |
692 | prop.height += lineSpace; |
|
|
693 | prop.width += letterSpace; |
687 | |
694 | |
688 | fs->set_prop (prop, false); |
695 | fs->set_prop (prop, false); |
689 | |
696 | |
690 | fwidth = prop.width; |
697 | fwidth = prop.width; |
691 | fheight = prop.height; |
698 | fheight = prop.height; |
… | |
… | |
905 | int old_width = szHint.width; |
912 | int old_width = szHint.width; |
906 | int old_height = szHint.height; |
913 | int old_height = szHint.height; |
907 | |
914 | |
908 | window_calc (newwidth, newheight); |
915 | window_calc (newwidth, newheight); |
909 | |
916 | |
910 | if (!HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END))) |
917 | bool set_hint = !HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END)); |
|
|
918 | |
|
|
919 | // to avoid races between us and the wm, we clear the incremental size hints around the xresizewindow |
|
|
920 | if (set_hint) |
|
|
921 | { |
|
|
922 | szHint.flags &= ~(PBaseSize | PResizeInc); |
911 | XSetWMNormalHints (dpy, parent[0], &szHint); |
923 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
924 | szHint.flags |= PBaseSize | PResizeInc; |
|
|
925 | } |
912 | |
926 | |
913 | if (!ignoreparent) |
927 | if (!ignoreparent) |
914 | { |
928 | { |
915 | #ifdef SMART_RESIZE |
929 | #ifdef SMART_RESIZE |
916 | /* |
930 | /* |
… | |
… | |
956 | #else |
970 | #else |
957 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
971 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
958 | #endif |
972 | #endif |
959 | } |
973 | } |
960 | |
974 | |
|
|
975 | if (set_hint) |
|
|
976 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
977 | |
961 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
978 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
962 | |
979 | |
963 | if (fix_screen || newwidth != old_width || newheight != old_height) |
980 | if (fix_screen || newwidth != old_width || newheight != old_height) |
964 | { |
981 | { |
965 | if (scrollBar.state) |
982 | if (scrollBar.state) |
… | |
… | |
971 | |
988 | |
972 | #ifdef HAVE_BG_PIXMAP |
989 | #ifdef HAVE_BG_PIXMAP |
973 | if (bgPixmap.window_size_sensitive ()) |
990 | if (bgPixmap.window_size_sensitive ()) |
974 | update_background (); |
991 | update_background (); |
975 | #endif |
992 | #endif |
976 | |
|
|
977 | scr_clear (); |
|
|
978 | } |
993 | } |
979 | |
994 | |
980 | if (fix_screen || old_height == 0) |
995 | if (fix_screen || old_height == 0) |
981 | scr_reset (); |
996 | scr_reset (); |
982 | |
997 | |
… | |
… | |
1061 | |
1076 | |
1062 | /* Checking whether input method is running. */ |
1077 | /* Checking whether input method is running. */ |
1063 | bool |
1078 | bool |
1064 | rxvt_term::IMisRunning () |
1079 | rxvt_term::IMisRunning () |
1065 | { |
1080 | { |
1066 | char *p; |
|
|
1067 | Atom atom; |
1081 | Atom atom; |
1068 | Window win; |
1082 | Window win; |
1069 | char server[IMBUFSIZ]; |
1083 | char server[IMBUFSIZ]; |
1070 | |
1084 | |
1071 | /* get current locale modifier */ |
1085 | /* get current locale modifier */ |
1072 | if ((p = XSetLocaleModifiers (NULL)) != NULL) |
1086 | if (char *p = XSetLocaleModifiers (0)) |
1073 | { |
1087 | { |
1074 | strcpy (server, "@server="); |
1088 | strcpy (server, "@server="); |
1075 | strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */ |
1089 | strncat (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */ |
1076 | |
1090 | |
1077 | if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ |
1091 | if (p = strchr (server + 1, '@')) /* first one only */ |
1078 | *p = '\0'; |
1092 | *p = '\0'; |
1079 | |
1093 | |
1080 | atom = XInternAtom (dpy, server, False); |
1094 | atom = XInternAtom (dpy, server, False); |
1081 | win = XGetSelectionOwner (dpy, atom); |
1095 | win = XGetSelectionOwner (dpy, atom); |
1082 | |
1096 | |