]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FeedbackController.C
ws fixes, formatting and some other small changes
[lyx.git] / src / frontends / xforms / FeedbackController.C
index fbb0f32eabc4f4fdd39894150dc3157a3494a4ad..01dcc2bf29e083844916663ace4b0bc1942ad734 100644 (file)
@@ -73,10 +73,29 @@ void FeedbackController::MessageCB(FL_OBJECT * ob, int event)
 
 void FeedbackController::PrehandlerCB(FL_OBJECT * ob, int event, int key)
 {
-       if (event == FL_PUSH && key == 2 && ob->objclass == FL_INPUT) {
+       lyx::Assert(ob);
+
+       if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
                // Trigger an input event when pasting in an xforms input object
                // using the middle mouse button.
                InputCB(ob, 0);
+               
+       } 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_ &&
                   (event == FL_ENTER || event == FL_LEAVE)) {