static Lisp_Object window_being_scrolled;
-/* 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. */
+static Time
+x_get_last_toolkit_time (struct x_display_info *dpyinfo)
+{
+#ifdef USE_X_TOOLKIT
+ return XtLastTimestampProcessed (dpyinfo->display);
+#else
+ return dpyinfo->last_user_time;
+#endif
+}
#ifndef USE_GTK
-/* Id of action hook installed for scroll bars. */
+/* Id of action hook installed for scroll bars and horizontal scroll
+ bars. */
static XtActionHookId action_hook_id;
static XtActionHookId horizontal_action_hook_id;
+/* 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. */
+
static Boolean xaw3d_arrow_scroll;
/* Whether the drag scrolling maintains the mouse at the top of the
ievent->kind = SCROLL_BAR_CLICK_EVENT;
ievent->frame_or_window = window;
ievent->arg = Qnil;
-#ifdef USE_GTK
- ievent->timestamp = CurrentTime;
-#else
- ievent->timestamp =
- XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
-#endif
+ ievent->timestamp
+ = x_get_last_toolkit_time (FRAME_DISPLAY_INFO (XFRAME (w->frame)));
ievent->code = 0;
ievent->part = ev->data.l[2];
ievent->x = make_fixnum (ev->data.l[3]);
ievent->kind = HORIZONTAL_SCROLL_BAR_CLICK_EVENT;
ievent->frame_or_window = window;
ievent->arg = Qnil;
-#ifdef USE_GTK
- ievent->timestamp = CurrentTime;
-#else
- ievent->timestamp =
- XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
-#endif
+ ievent->timestamp
+ = x_get_last_toolkit_time (FRAME_DISPLAY_INFO (XFRAME (w->frame)));
ievent->code = 0;
ievent->part = ev->data.l[2];
ievent->x = make_fixnum (ev->data.l[3]);
bar widget. DATA is a pointer to the scroll_bar structure. */
static gboolean
-xg_scroll_callback (GtkRange *range,
- GtkScrollType scroll,
- gdouble value,
- gpointer user_data)
+xg_scroll_callback (GtkRange *range, GtkScrollType scroll,
+ gdouble value, gpointer user_data)
{
- int whole = 0, portion = 0;
- struct scroll_bar *bar = user_data;
- enum scroll_bar_part part = scroll_bar_nowhere;
- GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range));
- struct frame *f = g_object_get_data (G_OBJECT (range), XG_FRAME_DATA);
+ int whole, portion;
+ struct scroll_bar *bar;
+ enum scroll_bar_part part;
+ GtkAdjustment *adj;
+ struct frame *f;
+ guint32 time;
+ struct x_display_info *dpyinfo;
if (xg_ignore_gtk_scrollbar) return false;
+ whole = 0;
+ portion = 0;
+ bar = user_data;
+ part = scroll_bar_nowhere;
+ adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range));
+ f = g_object_get_data (G_OBJECT (range), XG_FRAME_DATA);
+ time = gtk_get_current_event_time ();
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
+ if (time != GDK_CURRENT_TIME)
+ x_display_set_last_user_time (dpyinfo, time, true);
+
switch (scroll)
{
case GTK_SCROLL_JUMP:
GdkEventButton *event,
gpointer user_data)
{
- struct scroll_bar *bar = user_data;
+ struct scroll_bar *bar;
+
+ bar = user_data;
bar->dragging = -1;
+
if (WINDOWP (window_being_scrolled))
{
x_send_scroll_bar_event (window_being_scrolled,