Re: test of math previews
On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). So, I think the better patch can also be applied. -- Enrico
Re: [LyX/master] Fix setting of pref hide scrollbar in fullscreen
On Thu, Jun 25, 2015 at 02:42:40PM +0200, Scott Kostyshak wrote: commit 5e7cbc8f2c141889950628d0b81fcdb148fa278b Author: Scott Kostyshak skost...@lyx.org Date: Thu Jun 25 08:21:46 2015 -0400 Fix setting of pref hide scrollbar in fullscreen The symptom of the bug is that the preference could be incorrectly displayed (based on the value of the statusbar preference). This seems to have been a copy/paste mistake introduced in 214f7ed2. OK for branch? Scott
Re: Unable to enter custom negative spaces
Am Donnerstag, 25. Juni 2015 um 10:04:47, schrieb Scott Kostyshak skost...@lyx.org On Thu, Jun 25, 2015 at 07:01:06AM -0700, Kornel Benko wrote: The dialog in master does not allow negative values anymore. Neither for horizontal, nor vertical space. I can reproduce. Possibly related to 9e166088. Scott Good guess. Bisecting leads to it too. 9e16608867f72e417b04267d080fed28802e92a4 is the first bad commit commit 9e16608867f72e417b04267d080fed28802e92a4 Author: Juergen Spitzmueller sp...@lyx.org Date: Wed May 20 19:12:23 2015 +0200 Fix problems with immediate apply and length validators Fixes bugs #7022 and #7599. :04 04 6b9a5994435f4a86e54f26f53258254a3e907f23 4cfd99cbc33ae00afdf5eb20273fddf8908ed229 M src Kornel signature.asc Description: This is a digitally signed message part.
Unable to enter custom negative spaces
The dialog in master does not allow negative values anymore. Neither for horizontal, nor vertical space. Entering the values with external editor works and is also correctly displayed afterwards. Kornel signature.asc Description: This is a digitally signed message part.
Re: Unable to enter custom negative spaces
On Thu, Jun 25, 2015 at 07:01:06AM -0700, Kornel Benko wrote: The dialog in master does not allow negative values anymore. Neither for horizontal, nor vertical space. I can reproduce. Possibly related to 9e166088. Scott
Re: test of math previews
On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). I had a closer look and this behavior is independent of the patch. Only when using dvipng blank images can be detected reliably, so what described above occurs only when using the legacy route for generating images. So, I think the better patch can also be applied. More rightly, as in stable the legacy route is always used as a fallback. -- Enrico
Re: test of math previews
On 06/25/2015 02:13 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). I had a closer look and this behavior is independent of the patch. Only when using dvipng blank images can be detected reliably, so what described above occurs only when using the legacy route for generating images. So, I think the better patch can also be applied. More rightly, as in stable the legacy route is always used as a fallback. OK with me then. This more or less completes this work? (For which thanks very much, to you and Guillaume.) Richard
Re: test of math previews
On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: On 06/25/2015 02:13 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). I had a closer look and this behavior is independent of the patch. Only when using dvipng blank images can be detected reliably, so what described above occurs only when using the legacy route for generating images. So, I think the better patch can also be applied. More rightly, as in stable the legacy route is always used as a fallback. OK with me then. This more or less completes this work? I think so. The most important glitches were identified and solved. (For which thanks very much, to you and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. -- Enrico
Re: test of math previews
On 06/25/2015 02:58 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: This more or less completes this work? I think so. The most important glitches were identified and solved. (For which thanks very much, to you and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. Somebody had to write the code rh
Re: test of math previews
Le 25/06/2015 23:45, Richard Heck a écrit : On 06/25/2015 02:58 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: This more or less completes this work? I think so. The most important glitches were identified and solved. (For which thanks very much, to you and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. Somebody had to write the code rh This is also what I believe. Thank you! By the way will f3b03699 be backported as well? It seems that segfaults are almost guaranteed for people with previews on during Ctrl+C...
Re: test of math previews
On Wed, Jun 24, 2015 at 09:36:50PM -0400, Richard Heck wrote: On 06/24/2015 08:49 PM, Guillaume M-M wrote: Le 25/06/2015 00:44, Enrico Forestieri a écrit : On Mon, Jun 22, 2015 at 11:32:17PM +0100, Guillaume M-M wrote: 3) Previews have the incorrect size with layouts that offer font sizes other than 1[0-2]pt (lyx-preview-fontsize.lyx). The legacy method offers a function that retrieves the actual font size and calculates the actual dpi. Attached is a patch (extract_resolution.diff) that imports this function in the new script. Thank you, this is much better than trying to catch all possible cases. I have applied the patch to master at 0751f96d. Thank you for applying it. Here's a trivial patch for stable, if you are not ready to backport 0751f96d. Both were tested in stable. This is fine with me, as is the original patch, as Enrico sees fit. Richard, I am attaching 3 patches for stable. The first one fix crashes occurring when zooming after latex completely failed to generate an output and when copying a macro with instant preview on. This last crash also occurs in 2.1.3. The second patch assures that a lonely math inset is previewed. The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. -- Enrico diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index eb25805..e20f1ad 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -709,6 +709,7 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) if (git == in_progress_.end()) { lyxerr PreviewLoader::finishedGenerating(): unable to find data for PID pid endl; + finished_generating_ = true; return; } @@ -717,8 +718,11 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) LYXERR(Debug::GRAPHICS, PreviewLoader::finishedInProgress( retval ): processing status for command); - if (retval 0) + if (retval 0) { + in_progress_.erase(git); + finished_generating_ = true; return; + } // Read the metrics file, if it exists vectordouble ascent_fractions(git-second.snippets.size()); diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h index 3bd04ea..030e6f7 100644 --- a/src/mathed/MacroTable.h +++ b/src/mathed/MacroTable.h @@ -69,6 +69,8 @@ public: char const * MathMLtype() const; /// void setSymbol(latexkeys const * sym) { sym_ = sym; } + /// + DocIterator const pos() { return pos_; } /// lock while being drawn to avoid recursions int lock() const { return ++lockCount_; } diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 06cfd5c..a25c5db 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -176,6 +176,14 @@ void MathMacro::assign(MathMacro const that) if (p) p-setOwner(this); } + if (macro_ lyxrc.preview == LyXRC::PREVIEW_ON) { + // We need to update macro_ by ourselves because in this case + // MathData::metrics() is not called when selecting a math inset + DocIterator const pos = macroBackup_.pos(); + macro_ = pos.buffer() ? pos.buffer()-getMacro(name(), pos) : 0; + if (!macro_) + macro_ = macroBackup_; + } } diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 06cfd5c..9744366 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -604,6 +612,20 @@ bool MathMacro::validName() const void MathMacro::validate(LaTeXFeatures features) const { + // Immediately after a document is loaded, in some cases the MacroData + // of the global macros defined in the lib/symbols file may still not + // be known to the macro machinery because it will be set only after + // the first call to updateMacros(). This is not a problem unless + // instant preview is on for math, in which case we will be missing + // the corresponding requirements. + // In this case, we get the required info from the global macro table. + if (requires_.empty() !macro_) { + // Update requires for known global macros. + MacroData const * data = MacroTable::globalMacros().get(name()); + if (data !data-requires().empty()) + features.require(data-requires()); + } +
Re: test of math previews
On Wed, Jun 24, 2015 at 09:36:50PM -0400, Richard Heck wrote: > On 06/24/2015 08:49 PM, Guillaume M-M wrote: > >Le 25/06/2015 00:44, Enrico Forestieri a écrit : > >>On Mon, Jun 22, 2015 at 11:32:17PM +0100, Guillaume M-M wrote: > >>> > >>>3) Previews have the incorrect size with layouts that offer font sizes > >>>other > >>>than 1[0-2]pt (lyx-preview-fontsize.lyx). The legacy method offers a > >>>function that retrieves the actual font size and calculates the actual > >>>dpi. > >>>Attached is a patch (extract_resolution.diff) that imports this > >>>function in > >>>the new script. > >> > >>Thank you, this is much better than trying to catch all possible cases. > >>I have applied the patch to master at 0751f96d. > >> > > > >Thank you for applying it. > > > >Here's a trivial patch for stable, if you are not ready to backport > >0751f96d. Both were tested in stable. > > This is fine with me, as is the original patch, as Enrico sees fit. Richard, I am attaching 3 patches for stable. The first one fix crashes occurring when zooming after latex completely failed to generate an output and when copying a macro with instant preview on. This last crash also occurs in 2.1.3. The second patch assures that a lonely math inset is previewed. The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. -- Enrico diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index eb25805..e20f1ad 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -709,6 +709,7 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) if (git == in_progress_.end()) { lyxerr << "PreviewLoader::finishedGenerating(): unable to find " "data for PID " << pid << endl; + finished_generating_ = true; return; } @@ -717,8 +718,11 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) LYXERR(Debug::GRAPHICS, "PreviewLoader::finishedInProgress(" << retval << "): processing " << status << " for " << command); - if (retval > 0) + if (retval > 0) { + in_progress_.erase(git); + finished_generating_ = true; return; + } // Read the metrics file, if it exists vector ascent_fractions(git->second.snippets.size()); diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h index 3bd04ea..030e6f7 100644 --- a/src/mathed/MacroTable.h +++ b/src/mathed/MacroTable.h @@ -69,6 +69,8 @@ public: char const * MathMLtype() const; /// void setSymbol(latexkeys const * sym) { sym_ = sym; } + /// + DocIterator const & pos() { return pos_; } /// lock while being drawn to avoid recursions int lock() const { return ++lockCount_; } diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 06cfd5c..a25c5db 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -176,6 +176,14 @@ void MathMacro::assign(MathMacro const & that) if (p) p->setOwner(this); } + if (macro_ && lyxrc.preview == LyXRC::PREVIEW_ON) { + // We need to update macro_ by ourselves because in this case + // MathData::metrics() is not called when selecting a math inset + DocIterator const & pos = macroBackup_.pos(); + macro_ = pos.buffer() ? pos.buffer()->getMacro(name(), pos) : 0; + if (!macro_) + macro_ = _; + } } diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 06cfd5c..9744366 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -604,6 +612,20 @@ bool MathMacro::validName() const void MathMacro::validate(LaTeXFeatures & features) const { + // Immediately after a document is loaded, in some cases the MacroData + // of the global macros defined in the lib/symbols file may still not + // be known to the macro machinery because it will be set only after + // the first call to updateMacros(). This is not a problem unless + // instant preview is on for math, in which case we will be missing + // the corresponding requirements. + // In this case, we get the required info from the global macro table. + if (requires_.empty() && !macro_) { + // Update requires for known global macros. + MacroData const * data = MacroTable::globalMacros().get(name()); + if (data &&
Re: test of math previews
On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: > > The third patch is the simpler one proposed by Guillaume. I have already > applied the better patch to master but there is a glitch with it. > Namely, if a preview snippet produces a blank image, its metrics are > not invalidated and thus the image would not be visible on the LyX > screen (actually, it is replaced by a small red square). I still have > to take a look at it, so I think that for the time being the simpler > patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). So, I think the better patch can also be applied. -- Enrico
Re: [LyX/master] Fix setting of pref "hide scrollbar in fullscreen"
On Thu, Jun 25, 2015 at 02:42:40PM +0200, Scott Kostyshak wrote: > commit 5e7cbc8f2c141889950628d0b81fcdb148fa278b > Author: Scott Kostyshak> Date: Thu Jun 25 08:21:46 2015 -0400 > > Fix setting of pref "hide scrollbar in fullscreen" > > The symptom of the bug is that the preference could be incorrectly > displayed (based on the value of the statusbar preference). > > This seems to have been a copy/paste mistake introduced in 214f7ed2. OK for branch? Scott
Unable to enter custom negative spaces
The dialog in master does not allow negative values anymore. Neither for horizontal, nor vertical space. Entering the values with external editor works and is also correctly displayed afterwards. Kornel signature.asc Description: This is a digitally signed message part.
Re: Unable to enter custom negative spaces
On Thu, Jun 25, 2015 at 07:01:06AM -0700, Kornel Benko wrote: > The dialog in master does not allow negative values anymore. > Neither for horizontal, nor vertical space. I can reproduce. Possibly related to 9e166088. Scott
Re: Unable to enter custom negative spaces
Am Donnerstag, 25. Juni 2015 um 10:04:47, schrieb Scott Kostyshak> On Thu, Jun 25, 2015 at 07:01:06AM -0700, Kornel Benko wrote: > > The dialog in master does not allow negative values anymore. > > Neither for horizontal, nor vertical space. > > I can reproduce. Possibly related to 9e166088. > > Scott Good guess. Bisecting leads to it too. 9e16608867f72e417b04267d080fed28802e92a4 is the first bad commit commit 9e16608867f72e417b04267d080fed28802e92a4 Author: Juergen Spitzmueller Date: Wed May 20 19:12:23 2015 +0200 Fix problems with immediate apply and length validators Fixes bugs #7022 and #7599. :04 04 6b9a5994435f4a86e54f26f53258254a3e907f23 4cfd99cbc33ae00afdf5eb20273fddf8908ed229 M src Kornel signature.asc Description: This is a digitally signed message part.
Re: test of math previews
On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: > On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: > > > > The third patch is the simpler one proposed by Guillaume. I have already > > applied the better patch to master but there is a glitch with it. > > Namely, if a preview snippet produces a blank image, its metrics are > > not invalidated and thus the image would not be visible on the LyX > > screen (actually, it is replaced by a small red square). I still have > > to take a look at it, so I think that for the time being the simpler > > patch will do. > > Actually, it seems doing the right thing, as things such as $\quad$ or > $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ > produce a small vertical strip with the required characteristics (as > revealed by selecting the images in LyX). I had a closer look and this behavior is independent of the patch. Only when using dvipng blank images can be detected reliably, so what described above occurs only when using the legacy route for generating images. > So, I think the better patch can also be applied. More rightly, as in stable the legacy route is always used as a fallback. -- Enrico
Re: test of math previews
On 06/25/2015 02:13 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: The third patch is the simpler one proposed by Guillaume. I have already applied the better patch to master but there is a glitch with it. Namely, if a preview snippet produces a blank image, its metrics are not invalidated and thus the image would not be visible on the LyX screen (actually, it is replaced by a small red square). I still have to take a look at it, so I think that for the time being the simpler patch will do. Actually, it seems doing the right thing, as things such as $\quad$ or $\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ produce a small vertical strip with the required characteristics (as revealed by selecting the images in LyX). I had a closer look and this behavior is independent of the patch. Only when using dvipng blank images can be detected reliably, so what described above occurs only when using the legacy route for generating images. So, I think the better patch can also be applied. More rightly, as in stable the legacy route is always used as a fallback. OK with me then. This more or less completes this work? (For which thanks very much, to you and Guillaume.) Richard
Re: test of math previews
On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: > On 06/25/2015 02:13 PM, Enrico Forestieri wrote: > >On Thu, Jun 25, 2015 at 01:44:15PM +0200, Enrico Forestieri wrote: > >>On Thu, Jun 25, 2015 at 10:16:21AM +0200, Enrico Forestieri wrote: > >>>The third patch is the simpler one proposed by Guillaume. I have already > >>>applied the better patch to master but there is a glitch with it. > >>>Namely, if a preview snippet produces a blank image, its metrics are > >>>not invalidated and thus the image would not be visible on the LyX > >>>screen (actually, it is replaced by a small red square). I still have > >>>to take a look at it, so I think that for the time being the simpler > >>>patch will do. > >>Actually, it seems doing the right thing, as things such as $\quad$ or > >>$\relax$ are left as is, while $\raisebox{6mm}{}$ or $\raisebox{-6mm}{}$ > >>produce a small vertical strip with the required characteristics (as > >>revealed by selecting the images in LyX). > >I had a closer look and this behavior is independent of the patch. > >Only when using dvipng blank images can be detected reliably, so what > >described above occurs only when using the legacy route for generating > >images. > > > >>So, I think the better patch can also be applied. > >More rightly, as in stable the legacy route is always used as a fallback. > > OK with me then. > > This more or less completes this work? I think so. The most important glitches were identified and solved. > (For which thanks very much, to you > and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. -- Enrico
Re: test of math previews
On 06/25/2015 02:58 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: This more or less completes this work? I think so. The most important glitches were identified and solved. (For which thanks very much, to you and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. Somebody had to write the code rh
Re: test of math previews
Le 25/06/2015 23:45, Richard Heck a écrit : On 06/25/2015 02:58 PM, Enrico Forestieri wrote: On Thu, Jun 25, 2015 at 02:16:19PM -0400, Richard Heck wrote: This more or less completes this work? I think so. The most important glitches were identified and solved. (For which thanks very much, to you and Guillaume.) The credit goes mainly to Guillaume for his accurate testing. Somebody had to write the code rh This is also what I believe. Thank you! By the way will f3b03699 be backported as well? It seems that segfaults are almost guaranteed for people with previews on during Ctrl+C...