From 131f3f18447a9e159193b87f6e94cdfd9deda8dc Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 15 Oct 2002 17:24:08 +0000 Subject: [PATCH] Move the explanation of "why" into the source code and leave just "what" in the ChangeLog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5418 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 8 ++------ src/frontends/xforms/XWorkArea.C | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 09b90b0cd2..71cb119419 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,11 +1,7 @@ 2002-10-15 Angus Leeming - * XWorkArea.C (work_area_handler): it transpires that - ev->xbutton.button == 0 when the mouse is dragged, - so it cannot be used to initialise x_button_state and - hence FuncRequest. - This patch uses the 'key' that is passed into the function - by xforms to extract this info and so resolve the problem. + * XWorkArea.C (work_area_handler): Pass the mouse button correctly to + dispatch on LFUN_MOUSE_MOTION. 2002-10-15 Angus Leeming diff --git a/src/frontends/xforms/XWorkArea.C b/src/frontends/xforms/XWorkArea.C index 1f0bd3beab..ff3a66e532 100644 --- a/src/frontends/xforms/XWorkArea.C +++ b/src/frontends/xforms/XWorkArea.C @@ -368,11 +368,25 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event, y_old = ev->xmotion.y; scrollbar_value_old = fl_get_scrollbar_value(area->scrollbar); lyxerr[Debug::WORKAREA] << "Workarea event: MOUSE" << endl; - area->dispatch( - FuncRequest(LFUN_MOUSE_MOTION, - ev->xbutton.x - ob->x, - ev->xbutton.y - ob->y, - x_button_state(key))); + + // It transpires that ev->xbutton.button == 0 when + // the mouse is dragged, so it cannot be used to + // initialise x_button_state and hence FuncRequest. + + // The 'key' that is passed into the function does + // contain the necessary info, however. + + // It is for this reason that x_button_state has + // been modified to work with key + // rather than ev->xbutton.button. + + // Angus 15 Oct 2002. + FuncRequest cmd(LFUN_MOUSE_MOTION, + ev->xbutton.x - ob->x, + ev->xbutton.y - ob->y, + x_button_state(key)); + area->dispatch(cmd); + } break; #if FL_VERSION < 1 && FL_REVISION < 89 -- 2.39.5