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.305 by ayin, Sun Feb 17 11:37:21 2008 UTC vs.
Revision 1.309 by root, Wed Feb 27 01:02:33 2008 UTC

235 selection_clear (); 235 selection_clear ();
236 236
237#ifdef USE_XIM 237#ifdef USE_XIM
238 im_destroy (); 238 im_destroy ();
239#endif 239#endif
240#ifdef XTERM_SCROLLBAR 240 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); 241 if (gc) XFreeGC (dpy, gc);
265 242
266 delete drawable; 243 delete drawable;
267 // destroy all windows 244 // destroy all windows
268 if (parent[0]) 245 if (parent[0])
525 */ 502 */
526void 503void
527rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight) 504rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
528{ 505{
529 short recalc_x, recalc_y; 506 short recalc_x, recalc_y;
530 int x, y, sb_w, flags; 507 int x, y, flags;
531 unsigned int w, h; 508 unsigned int w, h;
532 unsigned int max_width, max_height; 509 unsigned int max_width, max_height;
533 510
534 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; 511 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
535 szHint.win_gravity = NorthWestGravity; 512 szHint.win_gravity = NorthWestGravity;
582 szHint.win_gravity = SouthEastGravity; 559 szHint.win_gravity = SouthEastGravity;
583 else 560 else
584 szHint.win_gravity = SouthWestGravity; 561 szHint.win_gravity = SouthWestGravity;
585 } 562 }
586 } 563 }
564
565 if (!szHint.width || !szHint.height)
566 rxvt_fatal ("window width or height must not be zero, aborting.\n");
587 } 567 }
588 568
589 /* TODO: BOUNDS */ 569 /* TODO: BOUNDS */
590 width = ncol * fwidth; 570 width = ncol * fwidth;
591 height = nrow * fheight; 571 height = nrow * fheight;
592 max_width = MAX_COLS * fwidth; 572 max_width = MAX_COLS * fwidth;
593 max_height = MAX_ROWS * fheight; 573 max_height = MAX_ROWS * fheight;
594 574
595 szHint.base_width = szHint.base_height = 2 * int_bwidth; 575 szHint.base_width = szHint.base_height = 2 * int_bwidth;
596 576
597 sb_w = 0;
598 window_vt_x = window_vt_y = int_bwidth; 577 window_vt_x = window_vt_y = int_bwidth;
599 578
600 if (scrollBar.state) 579 if (scrollBar.state)
601 { 580 {
602 sb_w = scrollBar.total_width (); 581 int sb_w = scrollBar.total_width ();
603 szHint.base_width += sb_w; 582 szHint.base_width += sb_w;
604 583
605 if (!option (Opt_scrollBar_right)) 584 if (!option (Opt_scrollBar_right))
606 window_vt_x += sb_w; 585 window_vt_x += sb_w;
607 } 586 }
630 else 609 else
631 { 610 {
632 min_it (height, max_height); 611 min_it (height, max_height);
633 szHint.height = szHint.base_height + height; 612 szHint.height = szHint.base_height + height;
634 } 613 }
635
636 if (scrollBar.state && option (Opt_scrollBar_right))
637 window_sb_x = szHint.width - sb_w;
638 614
639 if (recalc_x) 615 if (recalc_x)
640 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; 616 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth;
641 617
642 if (recalc_y) 618 if (recalc_y)
982 fix_screen = ncol != prev_ncol || nrow != prev_nrow; 958 fix_screen = ncol != prev_ncol || nrow != prev_nrow;
983 959
984 if (fix_screen || newwidth != old_width || newheight != old_height) 960 if (fix_screen || newwidth != old_width || newheight != old_height)
985 { 961 {
986 if (scrollBar.state) 962 if (scrollBar.state)
987 { 963 scrollBar.resize ();
988 XMoveResizeWindow (dpy, scrollBar.win,
989 window_sb_x, 0,
990 scrollBar.total_width (), szHint.height);
991 resize_scrollbar ();
992 }
993 964
994 XMoveResizeWindow (dpy, vt, 965 XMoveResizeWindow (dpy, vt,
995 window_vt_x, window_vt_y, 966 window_vt_x, window_vt_y,
996 width, height); 967 width, height);
997 968

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines