… | |
… | |
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 | |
… | |
… | |
522 | if (rs[Rs_geometry]) |
528 | if (rs[Rs_geometry]) |
523 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
529 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
524 | |
530 | |
525 | if (flags & WidthValue) |
531 | if (flags & WidthValue) |
526 | { |
532 | { |
|
|
533 | if (!w) |
|
|
534 | rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n"); |
|
|
535 | |
527 | ncol = clamp (w, 0, std::numeric_limits<int16_t>::max ()); |
536 | ncol = clamp (w, 1, std::numeric_limits<int16_t>::max ()); |
528 | szHint.flags |= USSize; |
537 | szHint.flags |= USSize; |
529 | } |
538 | } |
530 | |
539 | |
531 | if (flags & HeightValue) |
540 | if (flags & HeightValue) |
532 | { |
541 | { |
|
|
542 | if (!h) |
|
|
543 | rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n"); |
|
|
544 | |
533 | nrow = clamp (h, 0, std::numeric_limits<int16_t>::max ()); |
545 | nrow = clamp (h, 1, std::numeric_limits<int16_t>::max ()); |
534 | szHint.flags |= USSize; |
546 | szHint.flags |= USSize; |
535 | } |
547 | } |
536 | |
548 | |
537 | if (flags & XValue) |
549 | if (flags & XValue) |
538 | { |
550 | { |
… | |
… | |
613 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
625 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
614 | |
626 | |
615 | if (recalc_y) |
627 | if (recalc_y) |
616 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
628 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
617 | |
629 | |
618 | ncol = width / fwidth; |
630 | ncol = width / fwidth; |
619 | nrow = height / fheight; |
631 | nrow = height / fheight; |
620 | } |
632 | } |
621 | |
633 | |
622 | /*----------------------------------------------------------------------*/ |
634 | /*----------------------------------------------------------------------*/ |
623 | /* |
635 | /* |
… | |
… | |
899 | int old_width = szHint.width; |
911 | int old_width = szHint.width; |
900 | int old_height = szHint.height; |
912 | int old_height = szHint.height; |
901 | |
913 | |
902 | window_calc (newwidth, newheight); |
914 | window_calc (newwidth, newheight); |
903 | |
915 | |
904 | 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); |
905 | XSetWMNormalHints (dpy, parent[0], &szHint); |
922 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
923 | szHint.flags |= PBaseSize | PResizeInc; |
|
|
924 | } |
906 | |
925 | |
907 | if (!ignoreparent) |
926 | if (!ignoreparent) |
908 | { |
927 | { |
909 | #ifdef SMART_RESIZE |
928 | #ifdef SMART_RESIZE |
910 | /* |
929 | /* |
… | |
… | |
950 | #else |
969 | #else |
951 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
970 | XResizeWindow (dpy, parent[0], szHint.width, szHint.height); |
952 | #endif |
971 | #endif |
953 | } |
972 | } |
954 | |
973 | |
|
|
974 | if (set_hint) |
|
|
975 | XSetWMNormalHints (dpy, parent[0], &szHint); |
|
|
976 | |
955 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
977 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
956 | |
978 | |
957 | if (fix_screen || newwidth != old_width || newheight != old_height) |
979 | if (fix_screen || newwidth != old_width || newheight != old_height) |
958 | { |
980 | { |
959 | if (scrollBar.state) |
981 | if (scrollBar.state) |
… | |
… | |
965 | |
987 | |
966 | #ifdef HAVE_BG_PIXMAP |
988 | #ifdef HAVE_BG_PIXMAP |
967 | if (bgPixmap.window_size_sensitive ()) |
989 | if (bgPixmap.window_size_sensitive ()) |
968 | update_background (); |
990 | update_background (); |
969 | #endif |
991 | #endif |
970 | |
|
|
971 | scr_clear (); |
|
|
972 | } |
992 | } |
973 | |
993 | |
974 | if (fix_screen || old_height == 0) |
994 | if (fix_screen || old_height == 0) |
975 | scr_reset (); |
995 | scr_reset (); |
976 | |
996 | |