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.307 by ayin, Tue Feb 19 10:47:03 2008 UTC vs.
Revision 1.312 by root, Tue Nov 4 16:41:12 2008 UTC

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
237#ifdef USE_XIM 243#ifdef USE_XIM
238 im_destroy (); 244 im_destroy ();
239#endif 245#endif
240#ifdef XTERM_SCROLLBAR 246 scrollBar.destroy ();
241 if (xscrollbarGC) XFreeGC (dpy, xscrollbarGC);
242 if (ShadowGC) XFreeGC (dpy, ShadowGC);
243#endif
244#ifdef PLAIN_SCROLLBAR
245 if (pscrollbarGC) XFreeGC (dpy, pscrollbarGC);
246#endif
247#ifdef NEXT_SCROLLBAR
248 if (blackGC) XFreeGC (dpy, blackGC);
249 if (whiteGC) XFreeGC (dpy, whiteGC);
250 if (grayGC) XFreeGC (dpy, grayGC);
251 if (darkGC) XFreeGC (dpy, darkGC);
252 if (stippleGC) XFreeGC (dpy, stippleGC);
253 if (dimple) XFreePixmap (dpy, dimple);
254 if (upArrow) XFreePixmap (dpy, upArrow);
255 if (downArrow) XFreePixmap (dpy, downArrow);
256 if (upArrowHi) XFreePixmap (dpy, upArrowHi);
257 if (downArrowHi) XFreePixmap (dpy, downArrowHi);
258#endif
259#ifdef RXVT_SCROLLBAR
260 if (topShadowGC) XFreeGC (dpy, topShadowGC);
261 if (botShadowGC) XFreeGC (dpy, botShadowGC);
262 if (scrollbarGC) XFreeGC (dpy, scrollbarGC);
263#endif
264 if (gc) XFreeGC (dpy, gc); 247 if (gc) XFreeGC (dpy, gc);
265 248
266 delete drawable; 249 delete drawable;
267 // destroy all windows 250 // destroy all windows
268 if (parent[0]) 251 if (parent[0])
545 if (rs[Rs_geometry]) 528 if (rs[Rs_geometry])
546 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); 529 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h);
547 530
548 if (flags & WidthValue) 531 if (flags & WidthValue)
549 { 532 {
533 if (!w)
534 rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n");
535
550 ncol = clamp (w, 0, std::numeric_limits<int16_t>::max ()); 536 ncol = clamp (w, 1, std::numeric_limits<int16_t>::max ());
551 szHint.flags |= USSize; 537 szHint.flags |= USSize;
552 } 538 }
553 539
554 if (flags & HeightValue) 540 if (flags & HeightValue)
555 { 541 {
542 if (!h)
543 rxvt_fatal ("illegal window geometry (width and height must be non-zero), aborting.\n");
544
556 nrow = clamp (h, 0, std::numeric_limits<int16_t>::max ()); 545 nrow = clamp (h, 1, std::numeric_limits<int16_t>::max ());
557 szHint.flags |= USSize; 546 szHint.flags |= USSize;
558 } 547 }
559 548
560 if (flags & XValue) 549 if (flags & XValue)
561 { 550 {
636 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; 625 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth;
637 626
638 if (recalc_y) 627 if (recalc_y)
639 szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; 628 szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth;
640 629
641 ncol = width / fwidth; 630 ncol = width / fwidth;
642 nrow = height / fheight; 631 nrow = height / fheight;
643} 632}
644 633
645/*----------------------------------------------------------------------*/ 634/*----------------------------------------------------------------------*/
646/* 635/*
922 int old_width = szHint.width; 911 int old_width = szHint.width;
923 int old_height = szHint.height; 912 int old_height = szHint.height;
924 913
925 window_calc (newwidth, newheight); 914 window_calc (newwidth, newheight);
926 915
927 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 if (set_hint)
919 {
920 szHint.flags &= ~(PBaseSize | PResizeInc);
928 XSetWMNormalHints (dpy, parent[0], &szHint); 921 XSetWMNormalHints (dpy, parent[0], &szHint);
922 szHint.flags |= PBaseSize | PResizeInc;
923 }
929 924
930 if (!ignoreparent) 925 if (!ignoreparent)
931 { 926 {
932#ifdef SMART_RESIZE 927#ifdef SMART_RESIZE
933 /* 928 /*
992#endif 987#endif
993 988
994 scr_clear (); 989 scr_clear ();
995 } 990 }
996 991
992 if (set_hint)
993 XSetWMNormalHints (dpy, parent[0], &szHint);
994
997 if (fix_screen || old_height == 0) 995 if (fix_screen || old_height == 0)
998 scr_reset (); 996 scr_reset ();
999 997
1000 // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version 998 // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version
1001 //scr_touch (false); 999 //scr_touch (false);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines