… | |
… | |
625 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
625 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
626 | |
626 | |
627 | if (recalc_y) |
627 | if (recalc_y) |
628 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
628 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
629 | |
629 | |
630 | ncol = width / fwidth; |
630 | ncol = width / fwidth; |
631 | nrow = height / fheight; |
631 | nrow = height / fheight; |
632 | } |
632 | } |
633 | |
633 | |
634 | /*----------------------------------------------------------------------*/ |
634 | /*----------------------------------------------------------------------*/ |
635 | /* |
635 | /* |
… | |
… | |
911 | int old_width = szHint.width; |
911 | int old_width = szHint.width; |
912 | int old_height = szHint.height; |
912 | int old_height = szHint.height; |
913 | |
913 | |
914 | window_calc (newwidth, newheight); |
914 | window_calc (newwidth, newheight); |
915 | |
915 | |
916 | if (!HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END))) |
916 | bool set_hint = !HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END)); |
|
|
917 | |
|
|
918 | // to avoid races between us and the wm, we clear the incremental size hints around the xresizewindow |
|
|
919 | if (set_hint) |
|
|
920 | { |
|
|
921 | szHint.flags &= ~(PBaseSize | PResizeInc); |
917 | XSetWMNormalHints (dpy, parent[0], &szHint); |
922 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
923 | szHint.flags |= PBaseSize | PResizeInc; |
|
|
924 | } |
918 | |
925 | |
919 | if (!ignoreparent) |
926 | if (!ignoreparent) |
920 | { |
927 | { |
921 | #ifdef SMART_RESIZE |
928 | #ifdef SMART_RESIZE |
922 | /* |
929 | /* |
… | |
… | |
962 | #else |
969 | #else |
963 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
970 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
964 | #endif |
971 | #endif |
965 | } |
972 | } |
966 | |
973 | |
|
|
974 | if (set_hint) |
|
|
975 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
976 | |
967 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
977 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
968 | |
978 | |
969 | if (fix_screen || newwidth != old_width || newheight != old_height) |
979 | if (fix_screen || newwidth != old_width || newheight != old_height) |
970 | { |
980 | { |
971 | if (scrollBar.state) |
981 | if (scrollBar.state) |
… | |
… | |
977 | |
987 | |
978 | #ifdef HAVE_BG_PIXMAP |
988 | #ifdef HAVE_BG_PIXMAP |
979 | if (bgPixmap.window_size_sensitive ()) |
989 | if (bgPixmap.window_size_sensitive ()) |
980 | update_background (); |
990 | update_background (); |
981 | #endif |
991 | #endif |
982 | |
|
|
983 | scr_clear (); |
|
|
984 | } |
992 | } |
985 | |
993 | |
986 | if (fix_screen || old_height == 0) |
994 | if (fix_screen || old_height == 0) |
987 | scr_reset (); |
995 | scr_reset (); |
988 | |
996 | |
… | |
… | |
1067 | |
1075 | |
1068 | /* Checking whether input method is running. */ |
1076 | /* Checking whether input method is running. */ |
1069 | bool |
1077 | bool |
1070 | rxvt_term::IMisRunning () |
1078 | rxvt_term::IMisRunning () |
1071 | { |
1079 | { |
1072 | char *p; |
|
|
1073 | Atom atom; |
1080 | Atom atom; |
1074 | Window win; |
1081 | Window win; |
1075 | char server[IMBUFSIZ]; |
1082 | char server[IMBUFSIZ]; |
1076 | |
1083 | |
1077 | /* get current locale modifier */ |
1084 | /* get current locale modifier */ |
1078 | if ((p = XSetLocaleModifiers (NULL)) != NULL) |
1085 | if (char *p = XSetLocaleModifiers (0)) |
1079 | { |
1086 | { |
1080 | strcpy (server, "@server="); |
1087 | strcpy (server, "@server="); |
1081 | strncat (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */ |
1088 | strncat (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */ |
1082 | |
1089 | |
1083 | if ((p = strchr (server + 1, '@')) != NULL) /* first one only */ |
1090 | if (p = strchr (server + 1, '@')) /* first one only */ |
1084 | *p = '\0'; |
1091 | *p = '\0'; |
1085 | |
1092 | |
1086 | atom = XInternAtom (dpy, server, False); |
1093 | atom = XInternAtom (dpy, server, False); |
1087 | win = XGetSelectionOwner (dpy, atom); |
1094 | win = XGetSelectionOwner (dpy, atom); |
1088 | |
1095 | |