--- rxvt-unicode/src/main.C 2004/04/08 20:31:45 1.66 +++ rxvt-unicode/src/main.C 2004/07/30 14:59:12 1.73 @@ -157,6 +157,15 @@ #ifdef TEXT_BLINK text_blink_ev (this, &rxvt_term::text_blink_cb), #endif +#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING + cont_scroll_ev (this, &rxvt_term::cont_scroll_cb), +#endif +#ifdef SELECTION_SCROLLING + sel_scroll_ev (this, &rxvt_term::sel_scroll_cb), +#endif +#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) + slip_wheel_ev (this, &rxvt_term::slip_wheel_cb), +#endif #ifdef POINTER_BLANK pointer_ev (this, &rxvt_term::pointer_cb), #endif @@ -235,7 +244,10 @@ // TODO: free pixcolours, colours should become part of rxvt_display - delete PixColors; + delete PixColorsFocused; +#ifdef OFF_FOCUS_FADING + delete PixColorsUnFocused; +#endif displays.put (display); @@ -288,6 +300,12 @@ #ifdef TEXT_BLINK text_blink_ev.stop (); #endif +#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING + cont_scroll_ev.stop (); +#endif +#ifdef SELECTION_SCROLLING + sel_scroll_ev.stop (); +#endif #ifdef POINTER_BLANK pointer_ev.stop (); #endif @@ -742,20 +760,23 @@ szHint.base_width = szHint.base_height = 2 * TermWin.int_bwidth; sb_w = mb_h = 0; - window_vt_x = window_vt_y = 0; + window_vt_x = window_vt_y = TermWin.int_bwidth; + if (scrollbar_visible ()) { sb_w = scrollbar_TotalWidth (); szHint.base_width += sb_w; - if (! (Options & Opt_scrollBar_right)) - window_vt_x = sb_w; + if (!(Options & Opt_scrollBar_right)) + window_vt_x += sb_w; } + if (menubar_visible ()) { mb_h = menuBar_TotalHeight (); szHint.base_height += mb_h; - window_vt_y = mb_h; + window_vt_y += mb_h; } + szHint.width_inc = TermWin.fwidth; szHint.height_inc = TermWin.fheight; szHint.min_width = szHint.base_width + szHint.width_inc; @@ -771,6 +792,7 @@ MIN_IT (TermWin.width, max_width); szHint.width = szHint.base_width + TermWin.width; } + if (height && height - szHint.base_height < max_height) { szHint.height = height; @@ -781,6 +803,7 @@ MIN_IT (TermWin.height, max_height); szHint.height = szHint.base_height + TermWin.height; } + if (scrollbar_visible () && (Options & Opt_scrollBar_right)) window_sb_x = szHint.width - sb_w; @@ -937,7 +960,7 @@ { /* bright colors */ i -= 8; # ifndef NO_BRIGHTCOLOR - PixColors[idx] = PixColors[minBrightCOLOR + i]; + PixColorsFocused[idx] = PixColorsFocused[minBrightCOLOR + i]; SET_PIXCOLOR (idx); goto Done; # endif @@ -945,7 +968,7 @@ } if (i >= 0 && i <= 7) { /* normal colors */ - PixColors[idx] = PixColors[minCOLOR + i]; + PixColorsFocused[idx] = PixColorsFocused[minCOLOR + i]; SET_PIXCOLOR (idx); goto Done; } @@ -972,15 +995,17 @@ } # endif - PixColors[idx] = xcol; + PixColorsFocused[idx] = xcol; SET_PIXCOLOR (idx); /* XSetWindowAttributes attr; */ /* Cursor cursor; */ Done: +#ifdef OFF_FOCUS_FADING + PixColorsUnFocused[idx] = PixColorsFocused[idx].fade (display, atoi (rs[Rs_fade])); +#endif if (idx == Color_bg && ! (Options & Opt_transparent)) - XSetWindowBackground (display->display, TermWin.vt, - PixColors[Color_bg]); + XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); /* handle Color_BD, scrollbar background, etc. */ @@ -998,8 +1023,8 @@ { XColor xcol[2]; - xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColors[Color_pointer_fg] : PixColors[Color_fg]; - xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColors[Color_pointer_bg] : PixColors[Color_bg]; + xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColorsFocused[Color_pointer_fg] : PixColorsFocused[Color_fg]; + xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColorsFocused[Color_pointer_bg] : PixColorsFocused[Color_bg]; XQueryColors (display->display, XCMAP, xcol, 2); XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); } @@ -1081,6 +1106,7 @@ window_calc (width, height); XSetWMNormalHints (display->display, TermWin.parent[0], &szHint); + if (!ignoreparent) { #ifdef SMART_RESIZE @@ -1125,36 +1151,34 @@ XMoveResizeWindow (display->display, TermWin.parent[0], x + dx, y + dy, szHint.width, szHint.height); #else - XResizeWindow (display->display, TermWin.parent[0], szHint.width, - szHint.height); + XResizeWindow (display->display, TermWin.parent[0], szHint.width, szHint.height); #endif - } - fix_screen = (TermWin.ncol != prev_ncol - || TermWin.nrow != prev_nrow); + fix_screen = TermWin.ncol != prev_ncol || TermWin.nrow != prev_nrow; if (fix_screen || width != old_width || height != old_height) { if (scrollbar_visible ()) { - XMoveResizeWindow (display->display, scrollBar.win, window_sb_x, - 0, scrollbar_TotalWidth (), szHint.height); + XMoveResizeWindow (display->display, scrollBar.win, + window_sb_x, 0, + scrollbar_TotalWidth (), szHint.height); resize_scrollbar (); } if (menubar_visible ()) - XMoveResizeWindow (display->display, menuBar.win, window_vt_x, - 0, TermWin_TotalWidth (), menuBar_TotalHeight ()); - - XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, - window_vt_y, TermWin_TotalWidth (), - TermWin_TotalHeight ()); - scr_clear (height != old_height); + XMoveResizeWindow (display->display, menuBar.win, + window_vt_x, 0, + TermWin_TotalWidth (), menuBar_TotalHeight ()); + + XMoveResizeWindow (display->display, TermWin.vt, + window_vt_x, window_vt_y, + TermWin_TotalWidth (), TermWin_TotalHeight ()); + scr_clear (); #ifdef XPM_BACKGROUND resize_pixmap (); #endif - } if (fix_screen || old_height == 0)