+2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Cleaning up a few X scroll bar bits.
+ * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member.
+ * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
+ New member last_seen_part, going to replace...
+ * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part.
+ (xt_action_hook) [USE_LUCID]: Adjust user.
+ (xm_scroll_callback, xg_scroll_callback): Do not bloat with
+ Lucid-specific scroll bar support.
+ (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part
+ to int and adjust to use last_seen_part member.
+ (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user.
+ (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
+ Initialize last_seen_part.
+
2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
* insdel.c (insert_from_buffer_1): Don't mark buffer as modified when
static Lisp_Object window_being_scrolled;
-/* Last scroll bar part sent in xm_scroll_callback. */
-
-static int last_scroll_bar_part;
-
/* Whether this is an Xaw with arrow-scrollbars. This should imply
that movements of 1/20 of the screen size are mapped to up/down. */
&& WINDOWP (window_being_scrolled))
{
struct window *w;
+ struct scroll_bar *bar;
x_send_scroll_bar_event (window_being_scrolled,
scroll_bar_end_scroll, 0, 0);
w = XWINDOW (window_being_scrolled);
+ bar = XSCROLL_BAR (w->vertical_scroll_bar);
- if (XSCROLL_BAR (w->vertical_scroll_bar)->dragging != -1)
+ if (bar->dragging != -1)
{
- XSCROLL_BAR (w->vertical_scroll_bar)->dragging = -1;
+ bar->dragging = -1;
/* The thumb size is incorrect while dragging: fix it. */
set_vertical_scroll_bar (w);
}
window_being_scrolled = Qnil;
- last_scroll_bar_part = -1;
-
+#if defined (USE_LUCID)
+ bar->last_seen_part = scroll_bar_nowhere;
+#endif
/* Xt timeouts no longer needed. */
toolkit_scroll_bar_interaction = 0;
}
if (part >= 0)
{
window_being_scrolled = bar->window;
- last_scroll_bar_part = part;
x_send_scroll_bar_event (bar->window, part, portion, whole);
}
}
if (part >= 0)
{
window_being_scrolled = bar->window;
- last_scroll_bar_part = part;
x_send_scroll_bar_event (bar->window, part, portion, whole);
}
float top = *top_addr;
float shown;
int whole, portion, height;
- int part;
+ enum scroll_bar_part part;
/* Get the size of the thumb, a value between 0 and 1. */
block_input ();
window_being_scrolled = bar->window;
bar->dragging = portion;
- last_scroll_bar_part = part;
+ bar->last_seen_part = part;
x_send_scroll_bar_event (bar->window, part, portion, whole);
}
/* The position really is stored cast to a pointer. */
int position = (intptr_t) call_data;
Dimension height;
- int part;
+ enum scroll_bar_part part;
/* Get the height of the scroll bar. */
block_input ();
window_being_scrolled = bar->window;
bar->dragging = -1;
- last_scroll_bar_part = part;
+ bar->last_seen_part = part;
x_send_scroll_bar_event (bar->window, part, position, height);
}
NULL);
/* Massage the top+shown values. */
- if (bar->dragging == -1 || last_scroll_bar_part == scroll_bar_down_arrow)
+ if (bar->dragging == -1 || bar->last_seen_part == scroll_bar_down_arrow)
top = max (0, min (1, top));
else
top = old_top;
bar->end = 0;
bar->dragging = -1;
bar->fringe_extended_p = 0;
+#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
+ bar->last_seen_part = scroll_bar_nowhere;
+#endif
/* Add bar to its frame's list of scroll bars. */
bar->next = FRAME_SCROLL_BARS (f);