Re: [LyX/master] tex2lyx: improve module support

2021-02-01 Thread Scott Kostyshak
On Thu, Apr 04, 2019 at 03:55:15PM +0200, Juergen Spitzmueller wrote:
> commit 0b54650f0e7f1eae39f93444cac6c8525811975b
> Author: Juergen Spitzmueller 
> Date:   Thu Apr 4 15:46:49 2019 +0200
> 
> tex2lyx: improve module support
> 
> The current heuristics only considered modules with styles that defined
> a searched command in their preamble, and only for commands/environments
> that were defined in the document's preamble. This limited the module
> support drastically.
> 
> The new heuristics also checks for commands coming from packages. If the
> command is not (re-)defined in the document preamble, it checks modules
> that provide a style with a matching LaTeXName, checks for their
> requirements and matches those with the packages loaded by the document.
> 
> If no module provides a searched style, but we found modules that load
> packages that are loaded in the imported tex file, and if those packages
> are not auto-loaded by LyX anyway, we also load this module.
> 
> fixes: #11259, part of #8229
> ---

Starting with this commit, tex2lyx is a bit slower. For importing the string 
"\textbf{hello}", it took about 0.15s before (as measured by the "real" row of 
the "time" command output) and now it takes about 0.56s. I tested by putting 
the string in a file mwe.tex and running the following command:

$ time /path/to/tex2lyx -userdir /path/to/user-dir -fixedenc utf8 -f mwe.tex 
/dev/null

The fix seems like nice feature, so the small increase in time might be worth 
it. Also, tex2lyx is not usually a feature that a user uses repeatedly, so in 
my opinion a delay is fine. Nonetheless, I note the increased time just in case 
it was unexpected.

By the way, for anyone testing, if you see long delays from tex2lyx it could be 
from updating layouts.


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Scott Kostyshak
On Mon, Feb 01, 2021 at 08:01:22PM +0100, Jean-Marc Lasgouttes wrote:
> Le 01/02/2021 à 19:53, Scott Kostyshak a écrit :
> > On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote:
> > > Le 01/02/2021 à 14:03, Pavel Sanda a écrit :
> > > > Small updates, I get perfect reproducibility now:
> > > > - You dont need to type anything in new window 2, just zoom-in couple 
> > > > times is enough
> > > > - The cursor in table in window 1 is necessary, just loading up the 
> > > > manual is not enough.
> > > > I generally put the cursor in the middle of "phantom" string in of 
> > > > the first row.
> > > > - The crash happens in branch too.
> > > 
> > > I cannot reproduce, but I see that the window redraw is done without
> > > recomputing metrics.
> > 
> > Is this related at all to #11919?
> 
> I would be surprised, but you are welcome to try :) This is really a
> multi-view issue.

Good to know, I tried and it doesn't seem to change that behavior.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/2021 à 19:02, Pavel Sanda a écrit :

Can you confirm that the following patch helps?


After applying this patch I can't reproduce the crash anymore.
On top of that, any zoom change is immediately visible in the other window
and I do not experience any strange painting misalignments there.


Thanks, I will commit it then. If you find other situations where this 
is required, please chime in.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/2021 à 19:53, Scott Kostyshak a écrit :

On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote:

Le 01/02/2021 à 14:03, Pavel Sanda a écrit :

Small updates, I get perfect reproducibility now:
- You dont need to type anything in new window 2, just zoom-in couple times is 
enough
- The cursor in table in window 1 is necessary, just loading up the manual is 
not enough.
I generally put the cursor in the middle of "phantom" string in of the 
first row.
- The crash happens in branch too.


I cannot reproduce, but I see that the window redraw is done without
recomputing metrics.


Is this related at all to #11919?


I would be surprised, but you are welcome to try :) This is really a 
multi-view issue.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Scott Kostyshak
On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote:
> Le 01/02/2021 à 14:03, Pavel Sanda a écrit :
> > Small updates, I get perfect reproducibility now:
> > - You dont need to type anything in new window 2, just zoom-in couple times 
> > is enough
> > - The cursor in table in window 1 is necessary, just loading up the manual 
> > is not enough.
> >I generally put the cursor in the middle of "phantom" string in of the 
> > first row.
> > - The crash happens in branch too.
> 
> I cannot reproduce, but I see that the window redraw is done without
> recomputing metrics.

Is this related at all to #11919? 

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote:
> Le 01/02/2021 ?? 14:03, Pavel Sanda a écrit :
> >Small updates, I get perfect reproducibility now:
> >- You dont need to type anything in new window 2, just zoom-in couple times 
> >is enough
> >- The cursor in table in window 1 is necessary, just loading up the manual 
> >is not enough.
> >   I generally put the cursor in the middle of "phantom" string in of the 
> > first row.
> >- The crash happens in branch too.
> 
> I cannot reproduce, but I see that the window redraw is done without
> recomputing metrics.
> 
> Can you confirm that the following patch helps?

After applying this patch I can't reproduce the crash anymore.
On top of that, any zoom change is immediately visible in the other window
and I do not experience any strange painting misalignments there.

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/2021 à 14:03, Pavel Sanda a écrit :

Small updates, I get perfect reproducibility now:
- You dont need to type anything in new window 2, just zoom-in couple times is 
enough
- The cursor in table in window 1 is necessary, just loading up the manual is 
not enough.
   I generally put the cursor in the middle of "phantom" string in of the first 
row.
- The crash happens in branch too.


I cannot reproduce, but I see that the window redraw is done without 
recomputing metrics.


Can you confirm that the following patch helps?

JMarc

>From 53bed3fc5177176b30c031b3f452ace688646353 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes 
Date: Mon, 1 Feb 2021 18:19:46 +0100
Subject: [PATCH] Force redraw of all bufferviews after zoom in/out

Add a new ForceAll update flag that forces to update metrics and
redraw all buffer views.

The situation in multi windows setting is very fragile and will need
to be adressed properly in the 2.5 cycle.
---
 src/frontends/qt/GuiApplication.cpp | 13 -
 src/frontends/qt/GuiView.cpp|  2 +-
 src/update_flags.h  |  4 +++-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index 90d25b2525..455dbedfe0 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -1479,13 +1479,16 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
 
 	dr.screenUpdate(Update::FitCursor);
 	{
-		// This handles undo groups automagically
+		// All the code is kept inside the undo group because
+		// updateBuffer can create undo actions (see #11292)
 		UndoGroupHelper ugh(buffer);
 		dispatch(cmd, dr);
-		// redraw the screen at the end (first of the two drawing steps).
-		// This is done unless explicitly requested otherwise.
-		// This code is kept inside the undo group because updateBuffer
-		// can create undo actions (see #11292)
+		if (dr.screenUpdate() & Update::ForceAll) {
+			for (Buffer const * b : theBufferList())
+b->changed(true);
+			dr.screenUpdate(dr.screenUpdate() & ~Update::ForceAll);
+		}
+
 		updateCurrentView(cmd, dr);
 	}
 
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index bdd7f1d2b9..3ff1858657 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -4550,7 +4550,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 	  lyxrc.currentZoom, lyxrc.defaultZoom));
 
 			guiApp->fontLoader().update();
-			dr.screenUpdate(Update::Force | Update::FitCursor);
+			dr.screenUpdate(Update::ForceAll | Update::FitCursor);
 			break;
 		}
 
diff --git a/src/update_flags.h b/src/update_flags.h
index af71c0e78d..0efa541122 100644
--- a/src/update_flags.h
+++ b/src/update_flags.h
@@ -29,7 +29,9 @@ namespace Update {
 		SinglePar = 8,
 		/// Only the inset decorations need to be redrawn, no text metrics
 		/// update is needed.
-		Decoration = 16
+		Decoration = 16,
+		/// Force metrics and redraw for all buffers.
+		ForceAll = 32
 	};
 
 inline flags operator|(flags const f, flags const g)
-- 
2.27.0

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX Ver 2.4.0-alpha1 Math Manual Edits

2021-02-01 Thread Richard Kimberly Heck

On 1/30/21 4:38 PM, Pavel Sanda wrote:

On Sun, Jan 24, 2021 at 04:01:29AM -0500, Richard Kimberly Heck wrote:

On 1/23/21 11:17 AM, Q wrote:

Pavel et all,

Here are my edits for the 2.4.0 Alpha 1 Version of the Math manual.

If anyone has questions on what I did feel free to contact me.
(I trust that someone, presumably the document owner will review these and
not blindly enter them, that's a terrifying thought)

Thanks very much for these! Unfortunately, the previous maintainer of
this manual, Uwe, is no longer working on LyX. So I will have a look at
your changes, unless someone else beats me to it.

I'll go through these.


Thanks, Pavel.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Patches for Python scripts

2021-02-01 Thread José Abílio Matos
On Monday, February 1, 2021 2:42:43 AM WET Thibaut Cuvelier wrote:
> More generally, what about the other patches? Are formatting changes
> considered risky? What about Joel's suggestions?

My issue is not about the formatting changes, I can live with them even if in 
some cases I think that it is a matter of taste.
The example about documentation strings is striking, why do I need triple 
quotes if the documentation string will only span a single line?

My main doubt, that I still did not get any feedback, comes from the regular 
expression changes. Those are in no way formatting changes...

And even if the current code is faulty, i.e. it works by accident, the 
proposed changes are wrong.
-- 
José Abílio-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
On Mon, Feb 01, 2021 at 01:36:15PM +0100, Pavel Sanda wrote:
> On Mon, Feb 01, 2021 at 11:42:38AM +0100, Jean-Marc Lasgouttes wrote:
> > Le 01/02/2021 ?? 11:36, Pavel Sanda a écrit :
> > >Struggling to find recipy, but already happened 3x in the morning while 
> > >trying to merge changes from Phil's review:
> > >
> > >1. Open math manual, go to the second table in 3.7
> > >2. Open new window 2, open new file and starting to reproduce the formula
> > >3. ctrl+m ^19
> > >4. unclear sequence of these:
> > >a) backspace to delete 19, or type something again
> > >b) zoom in/zoom out
> > >c) switch to different window/workspace (the immediate crash trigger seems 
> > >to be always when activating LyX window after wandering elsewhere)
> > 
> > I'll take a look. It may be that the cache is cleared when zooming but the
> > metrics are not rebuilt.
> 
> As I got more skillful in triggering this bug most consistent way how to 
> trigger is
> after step 3:
> 4. Zoom in many times
> 5. switch to former window with math manual (the cursor there inside the 
> table)
> 6. kaboom

Small updates, I get perfect reproducibility now: 
- You dont need to type anything in new window 2, just zoom-in couple times is 
enough
- The cursor in table in window 1 is necessary, just loading up the manual is 
not enough.
  I generally put the cursor in the middle of "phantom" string in of the first 
row.
- The crash happens in branch too.

> Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
On Mon, Feb 01, 2021 at 01:19:08PM +0100, Kornel Benko wrote:
> Am Mon, 1 Feb 2021 13:15:47 +0100
> schrieb Pavel Sanda :
> 
> > On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote:
> > > Will try to come up with better backtrace, but this is what I have now:  
> > 
> 
> You could try 'bt full'.

I can recompile to get optimized-out values printed so such backtrace is useful,
let me know if that's helpful.
Anyway, with the updated recipy I have almost 100% crash-rate, so painting gurus
might be able to reproduce themselves.

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
On Mon, Feb 01, 2021 at 11:42:38AM +0100, Jean-Marc Lasgouttes wrote:
> Le 01/02/2021 ?? 11:36, Pavel Sanda a écrit :
> >Struggling to find recipy, but already happened 3x in the morning while 
> >trying to merge changes from Phil's review:
> >
> >1. Open math manual, go to the second table in 3.7
> >2. Open new window 2, open new file and starting to reproduce the formula
> >3. ctrl+m ^19
> >4. unclear sequence of these:
> >a) backspace to delete 19, or type something again
> >b) zoom in/zoom out
> >c) switch to different window/workspace (the immediate crash trigger seems 
> >to be always when activating LyX window after wandering elsewhere)
> 
> I'll take a look. It may be that the cache is cleared when zooming but the
> metrics are not rebuilt.

As I got more skillful in triggering this bug most consistent way how to 
trigger is
after step 3:
4. Zoom in many times
5. switch to former window with math manual (the cursor there inside the table)
6. kaboom

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Kornel Benko
Am Mon, 1 Feb 2021 13:15:47 +0100
schrieb Pavel Sanda :

> On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote:
> > Will try to come up with better backtrace, but this is what I have now:  
> 

You could try 'bt full'.

Kornel


pgpw2I5hDgNTv.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote:
> Will try to come up with better backtrace, but this is what I have now:

Better one:
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x76558535 in __GI_abort () at abort.c:79
#2  0x55b831a4 in lyx::lyx_exit (exit_code=exit_code@entry=1) at 
LyX.cpp:272
#3  0x55cf88a4 in boost::assertion_failed (expr=0x5642b87c "false", 
function=0x5650d0a0 
 "void 
lyx::doAssertWithCallstack(bool)", file=0x5650d033 "lassert.cpp", line=45) 
at boost.cpp:47
#4  0x563861e0 in lyx::doAssertWithCallstack (value=value@entry=false) 
at lassert.cpp:45
#5  0x56386320 in lyx::doBufErr (expr=expr@entry=0x5642b87c 
"false", 
file=file@entry=0x5642adfd "CoordCache.cpp", line=line@entry=27) at 
lassert.cpp:83
#6  0x55d2eb08 in lyx::lyxbreaker (data=data@entry=0x57414d80, 
hint=hint@entry=0x563da4be "dim", size=0) at CoordCache.cpp:27
#7  0x55dfecf8 in lyx::CoordCacheBase::checkDim 
(hint=0x563da4be "dim", 
thing=0x57414d80, this=0x57ded878) at 
/usr/include/c++/8/bits/stl_tree.h:1012
#8  lyx::CoordCacheBase::dim (thing=, 
this=0x57ded878)
at ./CoordCache.h:93
#9  lyx::MathData::dimension (this=0x57414d80, bv=...) at 
mathed/MathData.cpp:926
#10 0x55d93dab in lyx::InsetMathGrid::cellXOffset 
(this=this@entry=0x5740df00, bv=..., 
idx=idx@entry=0) at mathed/InsetMathGrid.cpp:910
#11 0x55d981b2 in lyx::InsetMathGrid::draw 
(this=this@entry=0x5740df00, pi=..., x=x@entry=682, 
y=y@entry=12) at mathed/InsetMathGrid.cpp:601
#12 0x55db32ea in lyx::InsetMathHull::draw (this=0x5740df00, 
pi=..., x=681, y=12)
at mathed/InsetMathHull.cpp:661
#13 0x55d82dec in lyx::RowPainter::paintInset 
(this=this@entry=0x7fffc740, e=...)
at RowPainter.cpp:112
#14 0x55d83fde in lyx::RowPainter::paintText 
(this=this@entry=0x7fffc740) at RowPainter.cpp:555
#15 0x55caf1f1 in lyx::TextMetrics::drawParagraph 
(this=this@entry=0x589e8f08, pi=..., 
pit=, pit@entry=0, x=x@entry=681, y=y@entry=12) at 
TextMetrics.cpp:1958
#16 0x55caf5b8 in lyx::TextMetrics::draw 
(this=this@entry=0x589e8f08, pi=..., x=681, 
y=y@entry=12) at TextMetrics.cpp:1809
#17 0x5601c565 in lyx::InsetText::draw (this=0x574163e0, pi=..., 
x=677, y=12)
at insets/InsetText.cpp:235
#18 0x5600792a in lyx::InsetTabular::draw (this=0x57413660, pi=..., 
x=237, y=)
at /usr/include/c++/8/bits/shared_ptr_base.h:1307
#19 0x55d82dec in lyx::RowPainter::paintInset 
(this=this@entry=0x7fffcd30, e=...)
at RowPainter.cpp:112
#20 0x55d83fde in lyx::RowPainter::paintText 
(this=this@entry=0x7fffcd30) at RowPainter.cpp:555
#21 0x55caf1f1 in lyx::TextMetrics::drawParagraph 
(this=this@entry=0x589eb928, pi=..., 
pit=, pit@entry=78, x=x@entry=0, y=y@entry=-21) at 
TextMetrics.cpp:1958
#22 0x55caf5b8 in lyx::TextMetrics::draw 
(this=this@entry=0x589eb928, pi=..., x=x@entry=0, 
y=y@entry=-21) at TextMetrics.cpp:1809
#23 0x55d09284 in lyx::BufferView::draw (this=0x57ded400, pain=..., 
paint_caret=) at BufferView.cpp:3342
#24 0x560b73ab in lyx::frontend::GuiWorkArea::paintEvent 
(this=0x57de59c0, ev=0x7fffd810)
at GuiWorkArea.cpp:1257
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Patches for Python scripts

2021-02-01 Thread Enrico Forestieri
On Mon, Feb 01, 2021 at 03:42:43AM +0100, Thibaut Cuvelier wrote:
> Thank you for testing on your side :)! What's frustrating with your report
> is that this bug can only appear on Python 2, and that it will very likely
> be dropped for the next release (I remember seeing people wanting to keep
> it for LyX 2.4). Nevertheless, I'm trying to do a few things about it.

Even if support for Python 2 is being discontinued, it is not going to
disappear overnight. So, supporting it for some more time is right, IMHO.

> What I've been doing: change the output when looking for programs, with a
> more explicit "not in path" instead of "no", and the same for the registry
> check; convert the result of winreg.QueryValueEx to a string (in Python 2,
> it looks like it's a byte array, hence the error). If that doesn't work, I
> really don't know what to do, apart from not telling the user what Java
> binary was found.
> 
> I'm attaching a differential patch (unnamed8) for the latest changes, plus
> a complete updated patch that should replace the original 0013 patch. Does
> it work for you?

Yes! This works also in a cygwin shell. Thanks!

...
checking for a java interpreter...
+checking for "java"...  not in path
+checking for java: found in Windows registry, C:\Program Files (x86)\Java\jre1.
8.0_281\bin\java.exe
...

> More generally, what about the other patches? Are formatting changes
> considered risky? What about Joel's suggestions?

I am leaving these to our python experts.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in equation paint (master)

2021-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/2021 à 11:36, Pavel Sanda a écrit :

Struggling to find recipy, but already happened 3x in the morning while trying 
to merge changes from Phil's review:

1. Open math manual, go to the second table in 3.7
2. Open new window 2, open new file and starting to reproduce the formula
3. ctrl+m ^19
4. unclear sequence of these:
a) backspace to delete 19, or type something again
b) zoom in/zoom out
c) switch to different window/workspace (the immediate crash trigger seems to 
be always when activating LyX window after wandering elsewhere)


I'll take a look. It may be that the cache is cleared when zooming but 
the metrics are not rebuilt.


JMarc



It seems that cursor size and geometry gets sometimes wrong unless I start 
typing and things go immediately right.
But sometimes it crashes. (is MathData::dimension dependent on zoom level?).
I am not even sure that the first window is necessary, but it might be related 
because
the zoom in/out changes the geometry in the first window as well... Instant 
preview is on.

Will try to come up with better backtrace, but this is what I have now:

CoordCache.cpp (25): break on pointer: 0x560af36eb560 hint: dim size: 0
(  1) src/lyx: lyx::doAssertWithCallstack(bool)
(  2) src/lyx: lyx::doBufErr(char const*, char const*, long)
(  3) src/lyx: lyx::lyxbreaker(void const*, char const*, int)
(  4) src/lyx: lyx::MathData::dimension(lyx::BufferView const&) const
(  5) src/lyx: lyx::InsetMathGrid::cellXOffset(lyx::BufferView const&, unsigned
long) const
(  6) src/lyx: lyx::InsetMathGrid::draw(lyx::PainterInfo&, int, int) const
(  7) src/lyx: lyx::InsetMathHull::draw(lyx::PainterInfo&, int, int) const
(  8) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const
(  9) src/lyx: lyx::RowPainter::paintText()
( 10) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int
) const
( 11) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const
( 12) src/lyx: lyx::InsetText::draw(lyx::PainterInfo&, int, int) const
( 13) src/lyx: lyx::InsetTabular::draw(lyx::PainterInfo&, int, int) const
( 14) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const
( 15) src/lyx: lyx::RowPainter::paintText()
( 16) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int
) const
( 17) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const
( 18) src/lyx: lyx::BufferView::draw(lyx::frontend::Painter&, bool)
( 19) src/lyx: lyx::frontend::GuiWorkArea::paintEvent(QPaintEvent*)
( 20) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QWidget::event(QEvent*)
( 21) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QFrame::event(QEvent*)
( 22) /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendTh
roughObjectEventFilters(QObject*, QEvent*)
( 23) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QApplicationPrivate::notify_


Pavel



--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Crash in equation paint (master)

2021-02-01 Thread Pavel Sanda
Struggling to find recipy, but already happened 3x in the morning while trying 
to merge changes from Phil's review:

1. Open math manual, go to the second table in 3.7
2. Open new window 2, open new file and starting to reproduce the formula
3. ctrl+m ^19
4. unclear sequence of these:
a) backspace to delete 19, or type something again
b) zoom in/zoom out
c) switch to different window/workspace (the immediate crash trigger seems to 
be always when activating LyX window after wandering elsewhere)

It seems that cursor size and geometry gets sometimes wrong unless I start 
typing and things go immediately right.
But sometimes it crashes. (is MathData::dimension dependent on zoom level?).
I am not even sure that the first window is necessary, but it might be related 
because
the zoom in/out changes the geometry in the first window as well... Instant 
preview is on.

Will try to come up with better backtrace, but this is what I have now:

CoordCache.cpp (25): break on pointer: 0x560af36eb560 hint: dim size: 0
(  1) src/lyx: lyx::doAssertWithCallstack(bool)
(  2) src/lyx: lyx::doBufErr(char const*, char const*, long)
(  3) src/lyx: lyx::lyxbreaker(void const*, char const*, int)
(  4) src/lyx: lyx::MathData::dimension(lyx::BufferView const&) const
(  5) src/lyx: lyx::InsetMathGrid::cellXOffset(lyx::BufferView const&, unsigned
long) const
(  6) src/lyx: lyx::InsetMathGrid::draw(lyx::PainterInfo&, int, int) const
(  7) src/lyx: lyx::InsetMathHull::draw(lyx::PainterInfo&, int, int) const
(  8) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const
(  9) src/lyx: lyx::RowPainter::paintText()
( 10) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int
) const
( 11) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const
( 12) src/lyx: lyx::InsetText::draw(lyx::PainterInfo&, int, int) const
( 13) src/lyx: lyx::InsetTabular::draw(lyx::PainterInfo&, int, int) const
( 14) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const
( 15) src/lyx: lyx::RowPainter::paintText()
( 16) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int
) const
( 17) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const
( 18) src/lyx: lyx::BufferView::draw(lyx::frontend::Painter&, bool)
( 19) src/lyx: lyx::frontend::GuiWorkArea::paintEvent(QPaintEvent*)
( 20) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QWidget::event(QEvent*)
( 21) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QFrame::event(QEvent*)
( 22) /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendTh
roughObjectEventFilters(QObject*, QEvent*)
( 23) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QApplicationPrivate::notify_


Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel