On some recent Windows versions, GetLastError() may also return
NO_ERROR instead of ERROR_IO_PENDING during an overlapped write
operation to a pipe. This was confusing the state machine in
Server.cpp so that replies to commands were scheduled but were
never actually output.
(cherry picked from commit cf5f2661dc)
Qt 5.2 introduces the possibility to place a checkbox on a QMessageBox,
so we need no longer to use our own crude dialog.
(cherry picked from commit 0148ef7e6c)
Apparently, a new paragraph is started after a float even if
no blank line is actually present. So, account for this fact.
(cherry picked from commit f6922b8c88)
This is detected when an undo group is open and contains at east one
element. This means indeed that changes are in progress. Note that the
group is in general opened in GuiApplication::dispatch. The code there
is changed to ensure that the group is closed before updating the
screen.
This patch is experimental. It is expected to be replaced in master by
a more complete solution. It could in the meantime be backported to 2.3.x.
Fixes bug #11159.
(cherry picked from commit c7496a11b2)
(cherry picked from commit 4d0c43f9aa)
The problem is that popping dialogs during reload can cause paint
events for which we are not ready. If this does not work, then we
can introduce a new flag, besides 'busy', for that case. But busy
does not seem to be used very widely, so hopefully this works.
Note that when paintEvent is triggered on macOS, the least we can do
is to copy our backing store to the screen.
(cherry picked from commit 19e6977b5b)
(cherry picked from commit d03deeca0c)
Completion uses a complicated async scheme based on timers to update
itself. This is probably not necessary anymore and is fragile to
event order changes.
This is what happens with the new painting scheme. Therefore the
asyncHideXXX() methods have to be made more robust and detect whether
completion state has changed by the time they are triggered.
(cherry picked from commit f1ea7fee5c)
When an image has to be loaded a second time and the cache
is not used or the image is not in the cache, its preview is
going to be regenerated again. Hence, if the same image
appears more than once on screen, avoid requesting simultaneous
generation of the same preview.
See also this thread:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg205057.html
The code in 90cfe4ec3 only handled the cells which metrics are
computed directly, and missed those who were linearized inside a MathRow.
To fix this, we use the fact that all the positions in a math row have
the same height and make MathRow::metrics return a boolean indicating
whether it contains a caret for a given bufferview.
Fixes bug #11153.
(cherry picked from commit a3868e40a4)
It is better to handle SinglePar before FitCursor, since the later
requires correct metrics at cursor position.
Fixes bug #11139 and probably #11125.
(cherry picked from commit 7f83d26934)
Compute a height from current font and current cell vertical
dimensions in MathData::metrics(), because this is where current font
is known.
Introduce BufferView::setCaretAscentDescent to remember this value.
This mechanism is not used for text because Cursor::current_font is
restored by undo, and the caret height would not be changed then. But
in principle it is doable.
(cherry picked from commit 90cfe4ec3b)
When computing a cell metrics, it is now possible to specify whether it
is tight (at least as tall as 'x') or not (as tall as the max height of
the font).
Use this to make sure that grid insets have large enough cells. It
will probably appear that other cells needn't be tight. Currently, the
only cell which is known to be tight is the nucleus of the root inset.
Others should be examined one by one. It might be that the default of
MathData::metrics tight parameter should be `false'.
Fixes bug #11050.
(cherry picked from commit 7bcb78a778)
The value used here is the x height. It would be nice to see what the
TeXbook really says.
This makes a big difference with \tilde{.}, for example.
(cherry picked from commit 6df8c42e59)
It surprises me a bit that the code is different in this case
from the case when EXPORT_in_THREAD is not set. I should check
to see if there's a problem in the other case, too.
(cherry picked from commit 0fc50a2637)
This commit fixes an issue where the menu option "Insert Separated
Frame Below" would show up twice, with one instance disabled. This
occurred when there was a "Standard" environment nested in a
"Frame". With this commit, the duplicate instance is removed.
(cherry picked from commit 4f7a5f8c3e)
The new code is much simpler: what it does is, after redrawing has
been done, to mark the cursor row as changed, so that it will be
repainted on next paint event.
This avoids some crashes at the price of possibly repainting the row
when it was not necessary.
(cherry picked from commit 2f1eb35b86)
When the cursor is inside a subscript that may become empty, metrics
issues can happen. This patch fixes the issue, although it is not
clear to see what the problem is.
Still, requesting a metrics update also in the case where the macro
mode is canceled makes sense.
Fixes bug #11125.
(cherry picked from commit 68ec34e603)
The idea here is to force commands to be run syncrhonously when
they are launched via "command-sequence" or "repeat". We do this
by using a new flag in FuncRequest.
(cherry picked from commit 2477493cf5)
For some reason, special code was added for LFUN_INDEX_INSERT
when it was not actually needed. So just delete it.
(cherry picked from commit 83356ab9fe)