Kirill M. Katsnelson wrote:
Some time ago, Hrvoje Niksic wrote...
|+
| Place the mouse pointer over the scrollbar, evaluate the following
| code and drag the scrollbar:
|
| (event-over-modeline-p (next-event))
|
| For me, it crashes:
|-
Here's a fix. Channel of misc user events is actually used for
DND events only, where it is a frame. Chaging event channel
to frame object makes the behavior consistent accross all
types of misc-user events.
Index: src/events.h
===================================================================
RCS file: /var/cvsroot/ntxemacs/src/events.h,v
retrieving revision 1.9
diff --unified=2 -r1.9 events.h
--- src/events.h 1998/05/14 15:39:38 1.9
+++ src/events.h 1998/05/29 21:12:20
@@ -161,8 +161,5 @@
-- for timer, process, magic-eval, and eval events,
channel will be nil.
- -- for scrollbar misc-user events, channel
- will be a window.
- -- for menubar misc-user events, channel
- will be a frame.
+ -- for misc-user events, channel will be a frame.
-- for magic events, channel will be a frame
(usually) or a device.
Index: src/scrollbar-x.c
===================================================================
RCS file: /var/cvsroot/ntxemacs/src/scrollbar-x.c,v
retrieving revision 1.2
diff --unified=2 -r1.2 scrollbar-x.c
--- src/scrollbar-x.c 1998/05/09 08:59:01 1.2
+++ src/scrollbar-x.c 1998/05/29 21:16:50
@@ -401,5 +401,5 @@
struct device *d = get_device_from_display (XtDisplay (widget));
struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
- Lisp_Object win;
+ Lisp_Object win, frame;
struct scrollbar_instance *instance;
struct window_mirror *mirror;
@@ -414,4 +414,5 @@
return;
instance = mirror->scrollbar_vertical_instance;
+ frame = WINDOW_FRAME (XWINDOW (win));
/* It seems that this is necessary whenever signal_special_Xt_user_event()
@@ -422,9 +423,9 @@
{
case SCROLLBAR_LINE_UP:
- signal_special_Xt_user_event (win, Qscrollbar_line_up, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_line_up, win);
break;
case SCROLLBAR_LINE_DOWN:
- signal_special_Xt_user_event (win, Qscrollbar_line_down, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_line_down, win);
break;
@@ -443,9 +444,9 @@
if (line > -1.0)
line = -1.0;
- signal_special_Xt_user_event (win, Qscrollbar_page_up,
+ signal_special_Xt_user_event (frame, Qscrollbar_page_up,
Fcons (win, make_int ((int) line)));
}
#else
- signal_special_Xt_user_event (win, Qscrollbar_page_up,
+ signal_special_Xt_user_event (frame, Qscrollbar_page_up,
Fcons (win, Qnil));
#endif
@@ -466,5 +467,5 @@
if (line < 1.0)
line = 1.0;
- signal_special_Xt_user_event (win, Qscrollbar_page_down,
+ signal_special_Xt_user_event (frame, Qscrollbar_page_down,
Fcons (win,
make_int ((int) line)));
@@ -472,5 +473,5 @@
}
#else
- signal_special_Xt_user_event (win, Qscrollbar_page_down,
+ signal_special_Xt_user_event (frame, Qscrollbar_page_down,
Fcons (win, Qnil));
#endif
@@ -478,9 +479,9 @@
case SCROLLBAR_TOP:
- signal_special_Xt_user_event (win, Qscrollbar_to_top, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_to_top, win);
break;
case SCROLLBAR_BOTTOM:
- signal_special_Xt_user_event (win, Qscrollbar_to_bottom, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_to_bottom, win);
break;
@@ -584,5 +585,5 @@
value = SCROLLBAR_X_POS_DATA (instance).minimum;
- signal_special_Xt_user_event (win, Qscrollbar_vertical_drag,
+ signal_special_Xt_user_event (frame, Qscrollbar_vertical_drag,
Fcons (win, make_int (value)));
}
@@ -604,5 +605,5 @@
struct device *d = get_device_from_display (XtDisplay (widget));
struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
- Lisp_Object win;
+ Lisp_Object win, frame;
struct window_mirror *mirror;
@@ -615,4 +616,5 @@
if (NILP (win))
return;
+ frame = WINDOW_FRAME (XWINDOW (win));
/* It seems that this is necessary whenever signal_special_Xt_user_event()
@@ -623,20 +625,20 @@
{
case SCROLLBAR_LINE_UP:
- signal_special_Xt_user_event (win, Qscrollbar_char_left, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_char_left, win);
break;
case SCROLLBAR_LINE_DOWN:
- signal_special_Xt_user_event (win, Qscrollbar_char_right, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_char_right, win);
break;
case SCROLLBAR_PAGE_UP:
- signal_special_Xt_user_event (win, Qscrollbar_page_left, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_page_left, win);
break;
case SCROLLBAR_PAGE_DOWN:
- signal_special_Xt_user_event (win, Qscrollbar_page_right, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_page_right, win);
break;
case SCROLLBAR_TOP:
- signal_special_Xt_user_event (win, Qscrollbar_to_left, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_to_left, win);
break;
case SCROLLBAR_BOTTOM:
- signal_special_Xt_user_event (win, Qscrollbar_to_right, win);
+ signal_special_Xt_user_event (frame, Qscrollbar_to_right, win);
break;
case SCROLLBAR_CHANGE:
@@ -648,9 +650,9 @@
Lucid is the one mostly wrong.*/
#if defined (LWLIB_SCROLLBARS_LUCID) || defined (LWLIB_SCROLLBARS_ATHENA3D)
- signal_special_Xt_user_event (win, Qscrollbar_horizontal_drag,
+ signal_special_Xt_user_event (frame, Qscrollbar_horizontal_drag,
(Fcons
(win, make_int (data->slider_value))));
#else
- signal_special_Xt_user_event (win, Qscrollbar_horizontal_drag,
+ signal_special_Xt_user_event (frame, Qscrollbar_horizontal_drag,
(Fcons
(win,