aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy <[email protected]>1992-12-24 06:18:24 +0000
committerJim Blandy <[email protected]>1992-12-24 06:18:24 +0000
commit30c566e465ab310e39f9c0189623532851c4445f (patch)
tree91e0da058f688803fbbe5e6e8e4ede9949ab0596
parent20a558dc142b78198cacc5723ee7426e143a7929 (diff)
* xdisp.c: #include "termhooks.h".
(redisplay, redisplay_window): Use set_vertical_scrollbar_hook, condemn_scrollbars_hook, redeem_scrollbar_hook, and judge_scrollbars_hook to make scrollbars redisplay properly. It's a pain to remember that you can't assign to FRAME->visible. Let's change all references to the `visible' member of struct frame to use the accessor macros, and then write a setter for the `visible' field that does the right thing. * frame.h (FRAME_VISIBLE_P): Make this not an l-value. (FRAME_SET_VISIBLE): New macro. * frame.c (make_terminal_frame, Fdelete_frame): Use FRAME_SET_VISIBLE. (Fframe_visible_p, Fvisible_frame_list): Use FRAME_VISIBLE_P and FRAME_ICONIFIED_P. * dispnew.c (Fredraw_display): Use the FRAME_VISIBLE_P and FRAME_GARBAGED_P accessors. * xdisp.c (redisplay): Use the FRAME_VISIBLE_P accessor. * xfns.c (x_set_foreground_color, x_set_background_color, x_set_cursor_color, x_set_border_pixel, x_set_icon_type): Use the FRAME_VISIBLE_P accessor. (Fx_create_frame): Use FRAME_SET_VISIBILITY. * xterm.c (clear_cursor, x_display_bar_cursor, x_display_box_cursor): Use FRAME_SET_VISIBILITY.
-rw-r--r--src/xdisp.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index c9cb8f01ea..b4b502884a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32,6 +32,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "commands.h"
#include "macros.h"
#include "disptab.h"
+#include "termhooks.h"
extern int interrupt_input;
extern int command_loop_level;
@@ -497,8 +498,20 @@ redisplay ()
buffer_shared = 0;
FOR_EACH_FRAME (tail, f)
- if (FRAME_VISIBLE_P (f))
- redisplay_windows (FRAME_ROOT_WINDOW (f));
+ {
+ /* Mark all the scrollbars to be removed; we'll redeem the ones
+ we want when we redisplay their windows. */
+ if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
+ (*condemn_scrollbars_hook) (f);
+
+ if (FRAME_VISIBLE_P (f))
+ redisplay_windows (FRAME_ROOT_WINDOW (f));
+
+ /* Any scrollbars which redisplay_windows should have nuked
+ should now go away. */
+ if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
+ (*judge_scrollbars_hook) (f);
+ }
}
else if (FRAME_VISIBLE_P (selected_frame))
{
@@ -530,7 +543,7 @@ update:
continue;
f = XFRAME (XCONS (tail)->car);
- if (f->visible)
+ if (FRAME_VISIBLE_P (f))
{
pause |= update_frame (f, 0, 0);
if (!pause)
@@ -697,13 +710,12 @@ redisplay_window (window, just_this_one)
int just_this_one;
{
register struct window *w = XWINDOW (window);
- FRAME_PTR f = XFRAME (w->frame);
+ FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
int height;
register int lpoint = point;
struct buffer *old = current_buffer;
register int width = XFASTINT (w->width) - 1
- - (XFASTINT (w->width) + XFASTINT (w->left)
- != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))));
+ - (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f));
register int startp;
register int hscroll = XINT (w->hscroll);
struct position pos;
@@ -958,6 +970,25 @@ done:
SET_PT (opoint);
current_buffer = old;
SET_PT (lpoint);
+
+ if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
+ {
+ struct scrollbar *bar = WINDOW_VERTICAL_SCROLLBAR (w);
+
+ /* This isn't guaranteed to be right. For the moment, we'll pretend
+ it is. */
+ int endp = Z - XINT (w->window_end_pos);
+
+ /* Indicate what this scrollbar ought to be displaying now. */
+ bar = ((*set_vertical_scrollbar_hook)
+ (bar, w, endp - startp, Z - BEG, startp));
+
+ /* Note that we actually used the scrollbar attached to this window,
+ so it shouldn't be deleted at the end of redisplay. */
+ (*redeem_scrollbar_hook) (bar);
+
+ XSET (w->vertical_scrollbar, Lisp_Int, bar);
+ }
}
/* Do full redisplay on one window, starting at position `pos'. */