aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c80
1 files changed, 12 insertions, 68 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 45155bc2a65..9c410569b7a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -23,8 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25 25
26#ifdef HAVE_X_WINDOWS
27
28#include "lisp.h" 26#include "lisp.h"
29#include "blockinput.h" 27#include "blockinput.h"
30#include "syssignal.h" 28#include "syssignal.h"
@@ -3030,26 +3028,7 @@ XTflash (struct frame *f)
3030 /* These will be the left and right margins of the rectangles. */ 3028 /* These will be the left and right margins of the rectangles. */
3031 int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); 3029 int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f);
3032 int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); 3030 int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f);
3033 3031 int width = flash_right - flash_left;
3034 int width;
3035
3036 /* Don't flash the area between a scroll bar and the frame
3037 edge it is next to. */
3038 switch (FRAME_VERTICAL_SCROLL_BAR_TYPE (f))
3039 {
3040 case vertical_scroll_bar_left:
3041 flash_left += VERTICAL_SCROLL_BAR_WIDTH_TRIM;
3042 break;
3043
3044 case vertical_scroll_bar_right:
3045 flash_right -= VERTICAL_SCROLL_BAR_WIDTH_TRIM;
3046 break;
3047
3048 default:
3049 break;
3050 }
3051
3052 width = flash_right - flash_left;
3053 3032
3054 /* If window is tall, flash top and bottom line. */ 3033 /* If window is tall, flash top and bottom line. */
3055 if (height > 3 * FRAME_LINE_HEIGHT (f)) 3034 if (height > 3 * FRAME_LINE_HEIGHT (f))
@@ -5064,12 +5043,9 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
5064 5043
5065 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5044 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5066 /* Position and size of scroll bar. */ 5045 /* Position and size of scroll bar. */
5067 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5046 left, top, width, height,
5068 top,
5069 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5070 height,
5071 /* Border width, depth, class, and visual. */ 5047 /* Border width, depth, class, and visual. */
5072 0, 5048 0,
5073 CopyFromParent, 5049 CopyFromParent,
5074 CopyFromParent, 5050 CopyFromParent,
5075 CopyFromParent, 5051 CopyFromParent,
@@ -5104,19 +5080,11 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
5104#ifdef USE_TOOLKIT_SCROLL_BARS 5080#ifdef USE_TOOLKIT_SCROLL_BARS
5105 { 5081 {
5106#ifdef USE_GTK 5082#ifdef USE_GTK
5107 xg_update_scrollbar_pos (f, 5083 xg_update_scrollbar_pos (f, bar->x_window, top,
5108 bar->x_window, 5084 left,width, max (height, 1));
5109 top,
5110 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5111 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5112 max (height, 1));
5113#else /* not USE_GTK */ 5085#else /* not USE_GTK */
5114 Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar); 5086 Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
5115 XtConfigureWidget (scroll_bar, 5087 XtConfigureWidget (scroll_bar, left, top, width, max (height, 1), 0);
5116 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5117 top,
5118 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5119 max (height, 1), 0);
5120 XtMapWidget (scroll_bar); 5088 XtMapWidget (scroll_bar);
5121#endif /* not USE_GTK */ 5089#endif /* not USE_GTK */
5122 } 5090 }
@@ -5364,33 +5332,15 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5364 left, top, width, height); 5332 left, top, width, height);
5365 } 5333 }
5366#ifdef USE_GTK 5334#ifdef USE_GTK
5367 xg_update_scrollbar_pos (f, 5335 xg_update_scrollbar_pos (f, bar->x_window, top,
5368 bar->x_window, 5336 sb_left, sb_width, max (height, 1));
5369 top,
5370 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5371 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM *2,
5372 max (height, 1));
5373#else /* not USE_GTK */ 5337#else /* not USE_GTK */
5374 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar), 5338 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
5375 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5339 sb_left, top, sb_width, max (height, 1), 0);
5376 top,
5377 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5378 max (height, 1), 0);
5379#endif /* not USE_GTK */ 5340#endif /* not USE_GTK */
5380 } 5341 }
5381#else /* not USE_TOOLKIT_SCROLL_BARS */ 5342#else /* not USE_TOOLKIT_SCROLL_BARS */
5382 5343
5383 /* Clear areas not covered by the scroll bar because of
5384 VERTICAL_SCROLL_BAR_WIDTH_TRIM. */
5385 if (VERTICAL_SCROLL_BAR_WIDTH_TRIM)
5386 {
5387 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5388 left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
5389 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5390 left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5391 top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
5392 }
5393
5394 /* Clear areas not covered by the scroll bar because it's not as 5344 /* Clear areas not covered by the scroll bar because it's not as
5395 wide as the area reserved for it. This makes sure a 5345 wide as the area reserved for it. This makes sure a
5396 previous mode line display is cleared after C-x 2 C-x 1, for 5346 previous mode line display is cleared after C-x 2 C-x 1, for
@@ -5414,9 +5364,9 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5414 { 5364 {
5415 XWindowChanges wc; 5365 XWindowChanges wc;
5416 5366
5417 wc.x = sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM; 5367 wc.x = sb_left;
5418 wc.y = top; 5368 wc.y = top;
5419 wc.width = sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2; 5369 wc.width = sb_width;
5420 wc.height = height; 5370 wc.height = height;
5421 XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window, 5371 XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window,
5422 mask, &wc); 5372 mask, &wc);
@@ -5579,7 +5529,6 @@ x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event)
5579 Window w = bar->x_window; 5529 Window w = bar->x_window;
5580 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 5530 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
5581 GC gc = f->output_data.x->normal_gc; 5531 GC gc = f->output_data.x->normal_gc;
5582 int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM;
5583 5532
5584 block_input (); 5533 block_input ();
5585 5534
@@ -5592,11 +5541,8 @@ x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event)
5592 5541
5593 /* Draw a one-pixel border just inside the edges of the scroll bar. */ 5542 /* Draw a one-pixel border just inside the edges of the scroll bar. */
5594 XDrawRectangle (FRAME_X_DISPLAY (f), w, gc, 5543 XDrawRectangle (FRAME_X_DISPLAY (f), w, gc,
5595
5596 /* x, y, width, height */ 5544 /* x, y, width, height */
5597 0, 0, 5545 0, 0, bar->width - 1, bar->height - 1);
5598 bar->width - 1 - width_trim - width_trim,
5599 bar->height - 1);
5600 5546
5601 /* Restore the foreground color of the GC if we changed it above. */ 5547 /* Restore the foreground color of the GC if we changed it above. */
5602 if (f->output_data.x->scroll_bar_foreground_pixel != -1) 5548 if (f->output_data.x->scroll_bar_foreground_pixel != -1)
@@ -10883,5 +10829,3 @@ default is nil, which is the same as `super'. */);
10883 make_float (DEFAULT_REHASH_THRESHOLD), 10829 make_float (DEFAULT_REHASH_THRESHOLD),
10884 Qnil); 10830 Qnil);
10885} 10831}
10886
10887#endif /* HAVE_X_WINDOWS */