+2003-03-09 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
+
+ * keyboard.c (make_lispy_event): Extend mouse_syms if needed for
+ toolkit scrollbar click.
+
+ * xterm.c (x_window_to_scroll_bar): Call xg_get_scroll_id_for_window
+ for USE_GTK.
+ (x_scroll_bar_handle_click): Use this function for toolkit scrollbars
+ also.
+ (handle_one_xevent): ButtonPress/Release: If event is for a toolkit
+ scrollbar and control is pressed, call x_scroll_bar_handle_click.
+
+ * gtkutil.h: Declare xg_get_scroll_id_for_window.
+
+ * gtkutil.c (xg_get_scroll_id_for_window): New function.
+ (xg_tool_bar_item_expose_callback): New function.
+ (xg_tool_bar_expose_callback): Call update_frame_tool_bar.
+ (xg_create_tool_bar): Connect xg_tool_bar_expose_callback to expose
+ on the tool bar widget.
+ (update_frame_tool_bar): Connect xg_tool_bar_item_expose_callback
+ to expose on the tool bar item widgets.
+
2003-03-08 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of
event->modifiers |= click_modifier;
event->modifiers &= ~up_modifier;
+ if (event->code >= ASIZE (mouse_syms))
+ mouse_syms = larger_vector (mouse_syms, event->code + 1, Qnil);
+
/* Get the symbol we should use for the mouse click. */
head = modify_event_symbol (event->code,
event->modifiers,
{
Lisp_Object tail;
+#ifdef USE_GTK
+ window_id = (Window) xg_get_scroll_id_for_window (window_id);
+#endif /* USE_GTK */
+
for (tail = Vframe_list;
XGCTYPE (tail) == Lisp_Cons;
tail = XCDR (tail))
This may be called from a signal handler, so we have to ignore GC
mark bits. */
-#ifndef USE_TOOLKIT_SCROLL_BARS
static void
x_scroll_bar_handle_click (bar, event, emacs_event)
XSETINT (bar->dragging, y - XINT (bar->start));
#endif
+#ifndef USE_TOOLKIT_SCROLL_BARS
/* If the user has released the handle, set it to its final position. */
if (event->type == ButtonRelease
&& ! NILP (bar->dragging))
x_scroll_bar_set_handle (bar, new_start, new_end, 0);
bar->dragging = Qnil;
}
+#endif
/* Same deal here as the other #if 0. */
#if 0
}
}
+#ifndef USE_TOOLKIT_SCROLL_BARS
+
/* Handle some mouse motion while someone is dragging the scroll bar.
This may be called from a signal handler, so we have to ignore GC
}
else
{
-#ifndef USE_TOOLKIT_SCROLL_BARS
struct scroll_bar *bar
= x_window_to_scroll_bar (event.xbutton.window);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+ /* Make the "Ctrl-Mouse-2 splits window" work for toolkit
+ scroll bars. */
+ if (bar && event.xbutton.state & ControlMask)
+ {
+ x_scroll_bar_handle_click (bar, &event, &emacs_event);
+ *finish = X_EVENT_DROP;
+ }
+#else /* not USE_TOOLKIT_SCROLL_BARS */
if (bar)
x_scroll_bar_handle_click (bar, &event, &emacs_event);
#endif /* not USE_TOOLKIT_SCROLL_BARS */
OTHER:
#ifdef USE_X_TOOLKIT
BLOCK_INPUT;
- XtDispatchEvent (&event);
+ if (*finish != X_EVENT_DROP)
+ XtDispatchEvent (&event);
UNBLOCK_INPUT;
#endif /* USE_X_TOOLKIT */
break;