Symptom:
1. start lyx, open a doc, open another window
2. from window A, click at paragraph X, scroll down to paragraph Y.
3. go to window B, click, and return focus to window A
4. when mouse moves, lyx finds the correct pit Y under mouse, click,
lyx finds pit for paragraph X and scroll back to paragraph X.
The problem is found: switching window focus triggers a resize and a
forced update, which then scrolls the window back to its text cursor
position. This is not needed since windows size is not changed.
The following patch seems to work.
Index: src/BufferView.C
===================================================================
--- src/BufferView.C (revision 16274)
+++ src/BufferView.C (working copy)
@@ -1016,14 +1016,16 @@
bool const widthChange = width != width_;
bool const heightChange = height != height_;
- // Update from work area
- width_ = width;
- height_ = height;
+ if (widthChange || heightChange) {
+ // Update from work area
+ width_ = width;
+ height_ = height;
- if (buffer_)
- resize();
+ if (buffer_)
+ resize();
- update();
+ update();
+ }
}
I have not really tested the patch since I want to ask first: why do
we force an update without dimension change? The relevant code is:
void BufferView::workAreaResize(int width, int height)
{
bool const widthChange = width != width_;
bool const heightChange = height != height_;
// Update from work area
width_ = width;
height_ = height;
if (buffer_)
resize();
update();
}
Bo