aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-11-08 15:45:40 +0000
committerGerd Moellmann2000-11-08 15:45:40 +0000
commitfa2dfc3000e53cbc0a4bed7e08f35b1d19260bf0 (patch)
tree6b8992159804ea8cf1329286dfd374d485fa4ca9
parent8e042df508228fa4ad591a8e21de0618130365e9 (diff)
downloademacs-fa2dfc3000e53cbc0a4bed7e08f35b1d19260bf0.tar.gz
emacs-fa2dfc3000e53cbc0a4bed7e08f35b1d19260bf0.zip
(x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]: Map the
scroll bar widget after configuring it, so that it will appear at the right position from the start. (XTredeem_scroll_bar): Cleaned up.
-rw-r--r--src/xterm.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0736459cf30..a49cc147f28 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8296,12 +8296,12 @@ x_scroll_bar_create (w, top, left, width, height)
8296 8296
8297 /* Map the window/widget. */ 8297 /* Map the window/widget. */
8298#if USE_TOOLKIT_SCROLL_BARS 8298#if USE_TOOLKIT_SCROLL_BARS
8299 XtMapWidget (SCROLL_BAR_X_WIDGET (bar));
8300 XtConfigureWidget (SCROLL_BAR_X_WIDGET (bar), 8299 XtConfigureWidget (SCROLL_BAR_X_WIDGET (bar),
8301 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 8300 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
8302 top, 8301 top,
8303 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 8302 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
8304 height, 0); 8303 height, 0);
8304 XtMapWidget (SCROLL_BAR_X_WIDGET (bar));
8305#else /* not USE_TOOLKIT_SCROLL_BARS */ 8305#else /* not USE_TOOLKIT_SCROLL_BARS */
8306 XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); 8306 XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar));
8307#endif /* not USE_TOOLKIT_SCROLL_BARS */ 8307#endif /* not USE_TOOLKIT_SCROLL_BARS */
@@ -8638,13 +8638,16 @@ XTcondemn_scroll_bars (frame)
8638 } 8638 }
8639} 8639}
8640 8640
8641
8641/* Un-mark WINDOW's scroll bar for deletion in this judgment cycle. 8642/* Un-mark WINDOW's scroll bar for deletion in this judgment cycle.
8642 Note that WINDOW isn't necessarily condemned at all. */ 8643 Note that WINDOW isn't necessarily condemned at all. */
8644
8643static void 8645static void
8644XTredeem_scroll_bar (window) 8646XTredeem_scroll_bar (window)
8645 struct window *window; 8647 struct window *window;
8646{ 8648{
8647 struct scroll_bar *bar; 8649 struct scroll_bar *bar;
8650 struct frame *f;
8648 8651
8649 /* We can't redeem this window's scroll bar if it doesn't have one. */ 8652 /* We can't redeem this window's scroll bar if it doesn't have one. */
8650 if (NILP (window->vertical_scroll_bar)) 8653 if (NILP (window->vertical_scroll_bar))
@@ -8653,36 +8656,33 @@ XTredeem_scroll_bar (window)
8653 bar = XSCROLL_BAR (window->vertical_scroll_bar); 8656 bar = XSCROLL_BAR (window->vertical_scroll_bar);
8654 8657
8655 /* Unlink it from the condemned list. */ 8658 /* Unlink it from the condemned list. */
8656 { 8659 f = XFRAME (WINDOW_FRAME (window));
8657 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); 8660 if (NILP (bar->prev))
8658 8661 {
8659 if (NILP (bar->prev)) 8662 /* If the prev pointer is nil, it must be the first in one of
8660 { 8663 the lists. */
8661 /* If the prev pointer is nil, it must be the first in one of 8664 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
8662 the lists. */ 8665 /* It's not condemned. Everything's fine. */
8663 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) 8666 return;
8664 /* It's not condemned. Everything's fine. */ 8667 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
8665 return; 8668 window->vertical_scroll_bar))
8666 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 8669 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
8667 window->vertical_scroll_bar)) 8670 else
8668 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; 8671 /* If its prev pointer is nil, it must be at the front of
8669 else 8672 one or the other! */
8670 /* If its prev pointer is nil, it must be at the front of 8673 abort ();
8671 one or the other! */ 8674 }
8672 abort (); 8675 else
8673 } 8676 XSCROLL_BAR (bar->prev)->next = bar->next;
8674 else
8675 XSCROLL_BAR (bar->prev)->next = bar->next;
8676 8677
8677 if (! NILP (bar->next)) 8678 if (! NILP (bar->next))
8678 XSCROLL_BAR (bar->next)->prev = bar->prev; 8679 XSCROLL_BAR (bar->next)->prev = bar->prev;
8679 8680
8680 bar->next = FRAME_SCROLL_BARS (f); 8681 bar->next = FRAME_SCROLL_BARS (f);
8681 bar->prev = Qnil; 8682 bar->prev = Qnil;
8682 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); 8683 XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
8683 if (! NILP (bar->next)) 8684 if (! NILP (bar->next))
8684 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); 8685 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
8685 }
8686} 8686}
8687 8687
8688/* Remove all scroll bars on FRAME that haven't been saved since the 8688/* Remove all scroll bars on FRAME that haven't been saved since the