+ // NOTE: editXY returns the top level inset of nested insets. If you happen
+ // to move from a text (inset=0) to a text inside an inset (e.g. an opened
+ // footnote inset, again inset=0), that inset will not be redrawn.
+ if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
+ bool need_redraw = false;
+
+ if (inset != last_inset_) {
+ if (last_inset_)
+ need_redraw |= last_inset_->setMouseHover(false);
+ if (inset)
+ need_redraw |= inset->setMouseHover(true);
+ last_inset_ = inset;
+ }
+
+ // if last metrics update was in singlepar mode, WorkArea::redraw() will
+ // not expose the button for redraw. We adjust here the metrics dimension
+ // to enable a full redraw.
+ // FIXME: It is possible to redraw only the area around the button!
+ if (need_redraw && metrics_info_.singlepar) {
+ // FIXME: It should be possible to redraw only the area around
+ // the button by doing this:
+ //
+ //metrics_info_.singlepar = false;
+ //metrics_info_.y1 = ymin of button;
+ //metrics_info_.y2 = ymax of button;
+ //
+ // Unfortunately, rowpainter.C:paintText() does not distinguish
+ // between background updates and text updates. So we use the hammer
+ // solution for now. We could also avoid the updateMetrics() below
+ // by using the first and last pit of the CoordCache. Have a look
+ // at LyXText::getPitNearY() to see what I mean.
+ //
+ //metrics_info_.pit1 = first pit of CoordCache;
+ //metrics_info_.pit2 = last pit of CoordCache;
+ //metrics_info_.singlepar = false;
+ //metrics_info_.y1 = 0;
+ //metrics_info_.y2 = height_;
+ //
+ updateMetrics(false);
+ }
+
+ // This event (moving without mouse click) is not passed further.
+ // This should be changed if it is further utilized.
+ return need_redraw;
+ }
+