diff options
| author | Stefan Monnier | 2005-03-31 22:43:13 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-03-31 22:43:13 +0000 |
| commit | 6ca5360192fbe50abd5e43ba2ed28aa115af4d65 (patch) | |
| tree | a807373c17c75cf35bef5dfe0801e667a345d908 /src/xterm.c | |
| parent | 94da3cf11183e6ad3569140e666c4296c431f7e1 (diff) | |
| download | emacs-6ca5360192fbe50abd5e43ba2ed28aa115af4d65.tar.gz emacs-6ca5360192fbe50abd5e43ba2ed28aa115af4d65.zip | |
Include ThreeD.h for XtNbeNiceToColormap.
(x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it.
Use XtNtopShadowPixel and XtNbottomShadowPixel.
(x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't
really work and that breaks with some versions of Xaw3d.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/xterm.c b/src/xterm.c index 609ffefcbbe..fcc4c67743a 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -130,9 +130,7 @@ extern void _XEditResCheckMessages (); | |||
| 130 | #ifdef HAVE_XAW3D | 130 | #ifdef HAVE_XAW3D |
| 131 | #include <X11/Xaw3d/Simple.h> | 131 | #include <X11/Xaw3d/Simple.h> |
| 132 | #include <X11/Xaw3d/Scrollbar.h> | 132 | #include <X11/Xaw3d/Scrollbar.h> |
| 133 | #define ARROW_SCROLLBAR | 133 | #include <X11/Xaw3d/ThreeD.h> |
| 134 | #define XAW_ARROW_SCROLLBARS | ||
| 135 | #include <X11/Xaw3d/ScrollbarP.h> | ||
| 136 | #else /* !HAVE_XAW3D */ | 134 | #else /* !HAVE_XAW3D */ |
| 137 | #include <X11/Xaw/Simple.h> | 135 | #include <X11/Xaw/Simple.h> |
| 138 | #include <X11/Xaw/Scrollbar.h> | 136 | #include <X11/Xaw/Scrollbar.h> |
| @@ -4547,6 +4545,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4547 | f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; | 4545 | f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; |
| 4548 | } | 4546 | } |
| 4549 | 4547 | ||
| 4548 | #ifdef XtNbeNiceToColormap | ||
| 4550 | /* Tell the toolkit about them. */ | 4549 | /* Tell the toolkit about them. */ |
| 4551 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1 | 4550 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1 |
| 4552 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) | 4551 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) |
| @@ -4570,16 +4569,17 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4570 | pixel = f->output_data.x->scroll_bar_top_shadow_pixel; | 4569 | pixel = f->output_data.x->scroll_bar_top_shadow_pixel; |
| 4571 | if (pixel != -1) | 4570 | if (pixel != -1) |
| 4572 | { | 4571 | { |
| 4573 | XtSetArg (av[ac], "topShadowPixel", pixel); | 4572 | XtSetArg (av[ac], XtNtopShadowPixel, pixel); |
| 4574 | ++ac; | 4573 | ++ac; |
| 4575 | } | 4574 | } |
| 4576 | pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; | 4575 | pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; |
| 4577 | if (pixel != -1) | 4576 | if (pixel != -1) |
| 4578 | { | 4577 | { |
| 4579 | XtSetArg (av[ac], "bottomShadowPixel", pixel); | 4578 | XtSetArg (av[ac], XtNbottomShadowPixel, pixel); |
| 4580 | ++ac; | 4579 | ++ac; |
| 4581 | } | 4580 | } |
| 4582 | } | 4581 | } |
| 4582 | #endif | ||
| 4583 | 4583 | ||
| 4584 | widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass, | 4584 | widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass, |
| 4585 | f->output_data.x->edit_widget, av, ac); | 4585 | f->output_data.x->edit_widget, av, ac); |
| @@ -4725,30 +4725,11 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4725 | XawScrollbarSetThumb (widget, top, shown); | 4725 | XawScrollbarSetThumb (widget, top, shown); |
| 4726 | else | 4726 | else |
| 4727 | { | 4727 | { |
| 4728 | #ifdef HAVE_XAW3D | ||
| 4729 | ScrollbarWidget sb = (ScrollbarWidget) widget; | ||
| 4730 | int scroll_mode = 0; | ||
| 4731 | |||
| 4732 | /* `scroll_mode' only exists with Xaw3d + ARROW_SCROLLBAR. */ | ||
| 4733 | if (xaw3d_arrow_scroll) | ||
| 4734 | { | ||
| 4735 | /* Xaw3d stupidly ignores resize requests while dragging | ||
| 4736 | so we have to make it believe it's not in dragging mode. */ | ||
| 4737 | scroll_mode = sb->scrollbar.scroll_mode; | ||
| 4738 | if (scroll_mode == 2) | ||
| 4739 | sb->scrollbar.scroll_mode = 0; | ||
| 4740 | } | ||
| 4741 | #endif | ||
| 4742 | /* Try to make the scrolling a tad smoother. */ | 4728 | /* Try to make the scrolling a tad smoother. */ |
| 4743 | if (!xaw3d_pick_top) | 4729 | if (!xaw3d_pick_top) |
| 4744 | shown = min (shown, old_shown); | 4730 | shown = min (shown, old_shown); |
| 4745 | 4731 | ||
| 4746 | XawScrollbarSetThumb (widget, top, shown); | 4732 | XawScrollbarSetThumb (widget, top, shown); |
| 4747 | |||
| 4748 | #ifdef HAVE_XAW3D | ||
| 4749 | if (xaw3d_arrow_scroll && scroll_mode == 2) | ||
| 4750 | sb->scrollbar.scroll_mode = scroll_mode; | ||
| 4751 | #endif | ||
| 4752 | } | 4733 | } |
| 4753 | } | 4734 | } |
| 4754 | } | 4735 | } |