summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Scrollbar.cxx4
-rw-r--r--src/Fl_mac.cxx12
2 files changed, 13 insertions, 3 deletions
diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx
index 370162a16..66547b469 100644
--- a/src/Fl_Scrollbar.cxx
+++ b/src/Fl_Scrollbar.cxx
@@ -132,11 +132,13 @@ int Fl_Scrollbar::handle(int event) {
if (horizontal()) {
if (Fl::e_dx==0) return 0;
handle_drag(clamp(value() + linesize_ * Fl::e_dx));
+ return 1;
} else {
if (Fl::e_dy==0) return 0;
handle_drag(clamp(value() + linesize_ * Fl::e_dy));
+ return 1;
}
- return 1;
+ break;
case FL_SHORTCUT:
case FL_KEYBOARD: {
int v = value();
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx
index a8f13cb34..b5779e4f1 100644
--- a/src/Fl_mac.cxx
+++ b/src/Fl_mac.cxx
@@ -799,15 +799,20 @@ static pascal OSStatus carbonMousewheelHandler( EventHandlerCallRef nextHandler,
// to me why Apple changed the API on this even though the current API
// supports two wheels just fine. Matthias,
EventRef event;
+// fprintf(stderr, "carbonMousewheelHandler: GetEventKind(ev=%p) = %d\n", ev,
+// GetEventKind(ev));
if (GetEventKind(ev)==11) {
// if this is a "MightyMouse" event, we need to convert it into a regular
// MouseWheel event
+// fputs("MightyMouse event!\n", stderr);
GetEventParameter( ev, kEventParamEventRef, typeEventRef, NULL, sizeof( EventRef ), NULL, &event );
} else {
// otherwise, we simply copy the event...
event = ev;
}
+// fprintf(stderr, "event=%p!\n", event);
+
fl_lock_function();
fl_os_event = event;
@@ -817,6 +822,7 @@ static pascal OSStatus carbonMousewheelHandler( EventHandlerCallRef nextHandler,
GetEventParameter( event, kEventParamMouseWheelAxis, typeMouseWheelAxis, NULL, sizeof(EventMouseWheelAxis), NULL, &axis );
long delta;
GetEventParameter( event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(long), NULL, &delta );
+// fprintf(stderr, "axis=%d, delta=%d\n", axis, delta);
if ( axis == kEventMouseWheelAxisX ) {
Fl::e_dx = delta;
if ( Fl::e_dx) Fl::handle( FL_MOUSEWHEEL, window );
@@ -1778,9 +1784,11 @@ void Fl_X::make(Fl_Window* w)
OSStatus ret;
EventHandlerUPP mousewheelHandler = NewEventHandlerUPP( carbonMousewheelHandler ); // will not be disposed by Carbon...
static EventTypeSpec mousewheelEvents[] = {
- { kEventClassMouse, 11 }, // "11" is the yet unlabled "MightyMouse" wheel event - sigh!
+// { kEventClassMouse, 11 }, // "11" is the yet unlabled "MightyMouse" wheel event - sigh!
{ kEventClassMouse, kEventMouseWheelMoved } };
- ret = InstallWindowEventHandler( x->xid, mousewheelHandler, 2, mousewheelEvents, w, 0L );
+ ret = InstallWindowEventHandler( x->xid, mousewheelHandler,
+ (int)(sizeof(mousewheelEvents)/sizeof(mousewheelEvents[0])),
+ mousewheelEvents, w, 0L );
EventHandlerUPP mouseHandler = NewEventHandlerUPP( carbonMouseHandler ); // will not be disposed by Carbon...
static EventTypeSpec mouseEvents[] = {
{ kEventClassMouse, kEventMouseDown },