[PATCH] Recompute column widths in BackingWindow::Resize() to partially fix #34392

Andras Timar timar74 at gmail.com
Mon Apr 9 09:03:34 PDT 2012


Gábor Stefanik <netrolller.3d at gmail.com> írta (2012. április 7. 2:13):
> With this patch, the start screen displays correctly on startup with
> scaling set to 130% (tested on OpenSUSE 11.4 x86-64).
>
> However, if you start LibreOffice with scaling @ 100%, then change
> scaling to 130% with the start screen still open, the bug remains.
> I've looked into it, and this appears to be a separate issue -
> Resize() is called too early on scaling change, before the new scaling
> factor is available. As a result, GetTextWidth() uses the old scaling
> factor to compute widths.
>
> If anyone can point me towards where Resize() is called on the scaling
> change codepath, that would be greatly appreciated.
>

Even without your patch, resizing works in the following scenario:
1. Set scaling to 130% (and observe the clipped text)
2. Press e.g. Text Document button to start Writer.
3. Close Writer with the X control at the top right of the window.
4. Observe that the start center buttons are resized correctly.

So basically you are right, the scaling information is missing in the
first call, and it is present in subsequent calls.
http://opengrok.libreoffice.org/xref/core/framework/source/services/backingwindow.cxx#627
calculates the text width. It is always 100% when called first,
regardless of the scaling factor. You need to find out why, e.g. by
setting a breakpoint to BackingWindow::initControls() and see the
backtrace at each call.

Andras


More information about the LibreOffice mailing list