X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFeedbackController.C;h=01dcc2bf29e083844916663ace4b0bc1942ad734;hb=ce708d095c65866617424f940c1dac6b7e236d61;hp=16b6ebf9bd7ccf6e3fbd7e6b5af9cd939435384e;hpb=cf27d6019a775a1c56c6766ffd4c2f8643a4b06f;p=lyx.git diff --git a/src/frontends/xforms/FeedbackController.C b/src/frontends/xforms/FeedbackController.C index 16b6ebf9bd..01dcc2bf29 100644 --- a/src/frontends/xforms/FeedbackController.C +++ b/src/frontends/xforms/FeedbackController.C @@ -80,18 +80,21 @@ void FeedbackController::PrehandlerCB(FL_OBJECT * ob, int event, int key) // using the middle mouse button. InputCB(ob, 0); - // This is very odd: - // event == FL_LEAVE when the mouse enters the folder and - // event == FL_ENTER are it leaves! - } else if (ob->objclass == FL_TABFOLDER && event == FL_LEAVE) { - // This prehandler is used to work-around an xforms bug. - // It updates the form->x, form->y coords of the active - // tabfolder when the mouse enters. - FL_FORM * const form = fl_get_active_folder(ob); - Window win = fl_prepare_form_window(form, 0, 0, "Folder"); - if (win) { - FL_Coord w, h; - fl_get_wingeometry(win, &(form->x), &(form->y), &w, &h); + } else if (ob->objclass == FL_TABFOLDER && + (event == FL_ENTER || event == FL_LEAVE)) { + // This prehandler is used to work-around an xforms bug and + // ensures that the form->x, form->y coords of the active + // tabfolder are up to date. + + // The tabfolder itself can be very narrow, being just + // the visible border to the tabs. + // We thus use both FL_ENTER and FL_LEAVE as flags, + // in case the FL_ENTER event is not caught. + + FL_FORM * const folder = fl_get_active_folder(ob); + if (folder && folder->window) { + fl_get_winorigin(folder->window, + &(folder->x), &(folder->y)); } } else if (message_widget_ &&