aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-12-24 06:18:24 +0000
committerJim Blandy1992-12-24 06:18:24 +0000
commit30c566e465ab310e39f9c0189623532851c4445f (patch)
tree91e0da058f688803fbbe5e6e8e4ede9949ab0596 /src
parent20a558dc142b78198cacc5723ee7426e143a7929 (diff)
downloademacs-30c566e465ab310e39f9c0189623532851c4445f.tar.gz
emacs-30c566e465ab310e39f9c0189623532851c4445f.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index c9cb8f01ea5..b4b502884aa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32,6 +32,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
32#include "commands.h" 32#include "commands.h"
33#include "macros.h" 33#include "macros.h"
34#include "disptab.h" 34#include "disptab.h"
35#include "termhooks.h"
35 36
36extern int interrupt_input; 37extern int interrupt_input;
37extern int command_loop_level; 38extern int command_loop_level;
@@ -497,8 +498,20 @@ redisplay ()
497 buffer_shared = 0; 498 buffer_shared = 0;
498 499
499 FOR_EACH_FRAME (tail, f) 500 FOR_EACH_FRAME (tail, f)
500 if (FRAME_VISIBLE_P (f)) 501 {
501 redisplay_windows (FRAME_ROOT_WINDOW (f)); 502 /* Mark all the scrollbars to be removed; we'll redeem the ones
503 we want when we redisplay their windows. */
504 if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
505 (*condemn_scrollbars_hook) (f);
506
507 if (FRAME_VISIBLE_P (f))
508 redisplay_windows (FRAME_ROOT_WINDOW (f));
509
510 /* Any scrollbars which redisplay_windows should have nuked
511 should now go away. */
512 if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
513 (*judge_scrollbars_hook) (f);
514 }
502 } 515 }
503 else if (FRAME_VISIBLE_P (selected_frame)) 516 else if (FRAME_VISIBLE_P (selected_frame))
504 { 517 {
@@ -530,7 +543,7 @@ update:
530 continue; 543 continue;
531 544
532 f = XFRAME (XCONS (tail)->car); 545 f = XFRAME (XCONS (tail)->car);
533 if (f->visible) 546 if (FRAME_VISIBLE_P (f))
534 { 547 {
535 pause |= update_frame (f, 0, 0); 548 pause |= update_frame (f, 0, 0);
536 if (!pause) 549 if (!pause)
@@ -697,13 +710,12 @@ redisplay_window (window, just_this_one)
697 int just_this_one; 710 int just_this_one;
698{ 711{
699 register struct window *w = XWINDOW (window); 712 register struct window *w = XWINDOW (window);
700 FRAME_PTR f = XFRAME (w->frame); 713 FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
701 int height; 714 int height;
702 register int lpoint = point; 715 register int lpoint = point;
703 struct buffer *old = current_buffer; 716 struct buffer *old = current_buffer;
704 register int width = XFASTINT (w->width) - 1 717 register int width = XFASTINT (w->width) - 1
705 - (XFASTINT (w->width) + XFASTINT (w->left) 718 - (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f));
706 != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))));
707 register int startp; 719 register int startp;
708 register int hscroll = XINT (w->hscroll); 720 register int hscroll = XINT (w->hscroll);
709 struct position pos; 721 struct position pos;
@@ -958,6 +970,25 @@ done:
958 SET_PT (opoint); 970 SET_PT (opoint);
959 current_buffer = old; 971 current_buffer = old;
960 SET_PT (lpoint); 972 SET_PT (lpoint);
973
974 if (FRAME_HAS_VERTICAL_SCROLLBARS (f))
975 {
976 struct scrollbar *bar = WINDOW_VERTICAL_SCROLLBAR (w);
977
978 /* This isn't guaranteed to be right. For the moment, we'll pretend
979 it is. */
980 int endp = Z - XINT (w->window_end_pos);
981
982 /* Indicate what this scrollbar ought to be displaying now. */
983 bar = ((*set_vertical_scrollbar_hook)
984 (bar, w, endp - startp, Z - BEG, startp));
985
986 /* Note that we actually used the scrollbar attached to this window,
987 so it shouldn't be deleted at the end of redisplay. */
988 (*redeem_scrollbar_hook) (bar);
989
990 XSET (w->vertical_scrollbar, Lisp_Int, bar);
991 }
961} 992}
962 993
963/* Do full redisplay on one window, starting at position `pos'. */ 994/* Do full redisplay on one window, starting at position `pos'. */