]> git.lyx.org Git - features.git/commitdiff
Fix multi-window resize bug:
authorAbdelrazak Younes <younes@lyx.org>
Thu, 2 Nov 2006 23:55:49 +0000 (23:55 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 2 Nov 2006 23:55:49 +0000 (23:55 +0000)
Use case: Two window share the same buffer. The first window is resize. This modify the inner Buffer structure because Paragraph has a notion of line break and thus line width. When switching to the other window which does not have the same size, LyX crashes because the line break is not adapted the this BufferView width.

This commit fix the crash by resizing the BufferView on a focusInEvent(). That is not a good fix but it is a fix nevertheless. The bad side effect is that when the two BufferView shows the same portion of the Buffer, the second BufferView will show the same line breaks as the first one even though those line breaks are not adapted to the second BufferView width... such is life!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15697 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.C

index fb8a25df255871a7566521ab80e0ad04e9febf83..942e1f4f19c608a35615c84e4b493bf894ea4531 100644 (file)
@@ -299,6 +299,22 @@ void GuiWorkArea::focusInEvent(QFocusEvent * /*event*/)
        // in BufferList that could be connected to the different tabbar.
        lyx_view_.updateTab();
        startBlinkingCursor();
+
+       //FIXME: Use case: Two windows share the same buffer.
+       // The first window is resize. This modify the inner Buffer
+       // structure because Paragraph has a notion of line break and
+       // thus line width (this is very bad!).
+       // When switching to the other window which does not have the
+       // same size, LyX crashes because the line break is not adapted
+       // the this BufferView width.
+       // The following line fix the crash by resizing the BufferView 
+       // on a focusInEvent(). That is not a good fix but it is a fix
+       // nevertheless. The bad side effect is that when the two
+       // BufferViews show the same portion of the Buffer, the second 
+       // BufferView will show the same line breaks as the first one;
+       // even though those line breaks are not adapted to the second
+       // BufferView width... such is life!
+       resizeBufferView();
 }