summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2021-07-01 17:44:54 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2021-07-01 18:42:03 +0200
commite3e8fe494d71a0ab1869fd4fcd275366373b464d (patch)
treedf3242f0bd2328cac5d5c830ecfd371ec81cdbec
parent55eee459d4a85edb6cda94e033c9b915bbfcfdbd (diff)
Fix FL_MOUSEWHEEL event coordinates in subwindow (#210)
Issue #210: "Fl::event_x() & event_y() doesn't take into account embedded window's coords with Mouse wheel events" In fact the calculation of Fl::event_x() and Fl::event_y() used the wrong window coordinates if the event was sent to a subwindow.
-rw-r--r--src/Fl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index da4fa4716..cf591cd77 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1341,7 +1341,7 @@ int Fl::handle_(int e, Fl_Window* window)
return 1;
}
// Finally try sending it to the window, the event occurred in
- if (send_event(FL_MOUSEWHEEL, window, window)) return 1;
+ if (send_event(FL_MOUSEWHEEL, window, window->top_window())) return 1;
default:
break;
}