Re: LyX-Workarea: Cursor invisible on Mac

2017-09-18 Thread Jean-Marc Lasgouttes

Le 17/09/2017 à 22:33, Stephan Witt a écrit :

Am 17.09.2017 um 22:30 schrieb Jean-Marc Lasgouttes :


Le 17/09/2017 à 22:26, Stephan Witt a écrit :

It works.


Good, feel free to commit, or I'll do it tomorrow.


No need to do it fast.


The patch is in now (and in features/properpaint).

JMarc


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 17.09.2017 um 22:30 schrieb Jean-Marc Lasgouttes :
> 
> Le 17/09/2017 à 22:26, Stephan Witt a écrit :
>> It works.
> 
> Good, feel free to commit, or I'll do it tomorrow.

No need to do it fast.

> Two lines below d->pixel_ratio_ can be used then?
>>  GuiPainter pain(viewport(), d->pixel_ratio_);
> 
> Actually, pixel_ratio_ is more like last_pixel_ratio_, used to remember the 
> last used value and to decide whether to resize in needResize() (which should 
> probably be replaced by an explicit test. The correct value to use everywhere 
> is pixelRatio() IMO.

I see.

Stephan

Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Jean-Marc Lasgouttes

Le 17/09/2017 à 22:26, Stephan Witt a écrit :

It works.


Good, feel free to commit, or I'll do it tomorrow.


Two lines below d->pixel_ratio_ can be used then?

GuiPainter pain(viewport(), d->pixel_ratio_);


Actually, pixel_ratio_ is more like last_pixel_ratio_, used to remember 
the last used value and to decide whether to resize in needResize() 
(which should probably be replaced by an explicit test. The correct 
value to use everywhere is pixelRatio() IMO.


JMarc


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 17.09.2017 um 21:38 schrieb Jean-Marc Lasgouttes :
> 
> Le 17/09/2017 à 18:42, Stephan Witt a écrit :
>> Now I made some progress. After sending the previous mail I’ve noticed
>> that LyX eats massively CPU time. The cause seems to be the missing
>> adjustment of GuiWorkArea::Private::pixel_ratio_ - that’s why the
>> GuiWorkArea::Private::needResize() returns constantly true.
> 
> Indeed, pixel_ratio_ needs to be set somewhere. Good catch. By looking at 
> 2.3.x sources, I suspect it should be set in paintEvent after the block that 
> tests for needResize().
> 
> Could you try the attached patch?

It works.

Two lines below d->pixel_ratio_ can be used then?

GuiPainter pain(viewport(), d->pixel_ratio_);

Stephan

> 
> JMarc
> 
> 
> 
> 
> 



Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Jean-Marc Lasgouttes

Le 17/09/2017 à 18:42, Stephan Witt a écrit :

Now I made some progress. After sending the previous mail I’ve noticed
that LyX eats massively CPU time. The cause seems to be the missing
adjustment of GuiWorkArea::Private::pixel_ratio_ - that’s why the
GuiWorkArea::Private::needResize() returns constantly true.


Indeed, pixel_ratio_ needs to be set somewhere. Good catch. By looking 
at 2.3.x sources, I suspect it should be set in paintEvent after the 
block that tests for needResize().


Could you try the attached patch?

JMarc




diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp
index bd3104c250..d6683ddcf1 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -1245,6 +1245,8 @@ void GuiWorkArea::paintEvent(QPaintEvent * ev)
 		}
 	}
 
+	d->pixel_ratio_ = pixelRatio();
+
 	GuiPainter pain(viewport(), pixelRatio());
 	d->buffer_view_->draw(pain, d->caret_visible_);
 


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Jean-Marc Lasgouttes
Le 17 septembre 2017 19:17:44 GMT+02:00, Stephan Witt  a écrit 
:
>
>>> I cannot find GuiWorkArea::Private::toggleCaret() in master.

I was probably wrong about the Private. I am not in front of the code right now.

JMarc


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 17.09.2017 um 18:42 schrieb Stephan Witt :
> 
> Am 17.09.2017 um 18:17 schrieb Stephan Witt :
>> 
>> Am 14.09.2017 um 16:30 schrieb Jean-Marc Lasgouttes :
>>> 
>>> Le 14/09/2017 à 15:15, Stephan Witt a écrit :
 Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
> 
> Le 14/09/2017 à 13:16, Stephan Witt a écrit :
>> Hi JMarc,
>> with master I have two problems on Mac, ATM:
>> * The cursor is not visible in LyX’s buffer view (or doesn’t start 
>> blinking?)
> 
> You mean that you cannot make it appear? Even by clicking or such?
 Yes, I’m able to select text. But by a click the selection disappears and 
 no cursor is shown.
>>> 
>>> What you can do is put a break or some debug message to see whether the 
>>> code goes into GuiWorkArea::Private::toggleCaret()
>> 
>> No, GuiWorkArea::toggleCaret() isn’t entered.
>> 
>> I cannot find GuiWorkArea::Private::toggleCaret() in master.
> 
> Now I made some progress. After sending the previous mail I’ve noticed
> that LyX eats massively CPU time. The cause seems to be the missing
> adjustment of GuiWorkArea::Private::pixel_ratio_ - that’s why the
> GuiWorkArea::Private::needResize() returns constantly true.
> 
> The attached patch cures it - but I don’t know what I do. Please verify
> if the location of the assignment is correct.
> 
> Stephan
> 
> 

BTW, this patch solves the problem with lyx SyncTeX pipe too :)

Stephan

Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 17.09.2017 um 18:42 schrieb Kornel Benko :
> 
> Am Sonntag, 17. September 2017 um 18:17:47, schrieb Stephan Witt 
> 
>> Am 14.09.2017 um 16:30 schrieb Jean-Marc Lasgouttes :
>>> 
>>> Le 14/09/2017 à 15:15, Stephan Witt a écrit :
 Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
> 
> Le 14/09/2017 à 13:16, Stephan Witt a écrit :
>> Hi JMarc,
>> with master I have two problems on Mac, ATM:
>> * The cursor is not visible in LyX’s buffer view (or doesn’t start 
>> blinking?)
> 
> You mean that you cannot make it appear? Even by clicking or such?
 Yes, I’m able to select text. But by a click the selection disappears and 
 no cursor is shown.
>>> 
>>> What you can do is put a break or some debug message to see whether the 
>>> code goes into GuiWorkArea::Private::toggleCaret()
>> 
>> No, GuiWorkArea::toggleCaret() isn’t entered.
>> 
>> I cannot find GuiWorkArea::Private::toggleCaret() in master.
> 
> ??
> src/frontends/qt4/GuiWorkArea.h:111
> src/frontends/qt4/GuiWorkArea.cpp:443

This isn’t GuiWorkArea::Private. It’s the GuiWorkArea class.

GuiWorkArea::Private is in src/frontends/qt4/GuiWorkArea_private.h

Stephan



Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 17.09.2017 um 18:17 schrieb Stephan Witt :
> 
> Am 14.09.2017 um 16:30 schrieb Jean-Marc Lasgouttes :
>> 
>> Le 14/09/2017 à 15:15, Stephan Witt a écrit :
>>> Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
 
 Le 14/09/2017 à 13:16, Stephan Witt a écrit :
> Hi JMarc,
> with master I have two problems on Mac, ATM:
> * The cursor is not visible in LyX’s buffer view (or doesn’t start 
> blinking?)
 
 You mean that you cannot make it appear? Even by clicking or such?
>>> Yes, I’m able to select text. But by a click the selection disappears and 
>>> no cursor is shown.
>> 
>> What you can do is put a break or some debug message to see whether the code 
>> goes into GuiWorkArea::Private::toggleCaret()
> 
> No, GuiWorkArea::toggleCaret() isn’t entered.
> 
> I cannot find GuiWorkArea::Private::toggleCaret() in master.

Now I made some progress. After sending the previous mail I’ve noticed
that LyX eats massively CPU time. The cause seems to be the missing
adjustment of GuiWorkArea::Private::pixel_ratio_ - that’s why the
GuiWorkArea::Private::needResize() returns constantly true.

The attached patch cures it - but I don’t know what I do. Please verify
if the location of the assignment is correct.

Stephan



pixel_ratio_.patch
Description: Binary data


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Kornel Benko
Am Sonntag, 17. September 2017 um 18:17:47, schrieb Stephan Witt 

> Am 14.09.2017 um 16:30 schrieb Jean-Marc Lasgouttes :
> > 
> > Le 14/09/2017 à 15:15, Stephan Witt a écrit :
> >> Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
> >>> 
> >>> Le 14/09/2017 à 13:16, Stephan Witt a écrit :
>  Hi JMarc,
>  with master I have two problems on Mac, ATM:
>  * The cursor is not visible in LyX’s buffer view (or doesn’t start 
>  blinking?)
> >>> 
> >>> You mean that you cannot make it appear? Even by clicking or such?
> >> Yes, I’m able to select text. But by a click the selection disappears and 
> >> no cursor is shown.
> > 
> > What you can do is put a break or some debug message to see whether the 
> > code goes into GuiWorkArea::Private::toggleCaret()
> 
> No, GuiWorkArea::toggleCaret() isn’t entered.
> 
> I cannot find GuiWorkArea::Private::toggleCaret() in master.

??
src/frontends/qt4/GuiWorkArea.h:111
src/frontends/qt4/GuiWorkArea.cpp:443

> Stephan

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-17 Thread Stephan Witt
Am 14.09.2017 um 16:30 schrieb Jean-Marc Lasgouttes :
> 
> Le 14/09/2017 à 15:15, Stephan Witt a écrit :
>> Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
>>> 
>>> Le 14/09/2017 à 13:16, Stephan Witt a écrit :
 Hi JMarc,
 with master I have two problems on Mac, ATM:
 * The cursor is not visible in LyX’s buffer view (or doesn’t start 
 blinking?)
>>> 
>>> You mean that you cannot make it appear? Even by clicking or such?
>> Yes, I’m able to select text. But by a click the selection disappears and no 
>> cursor is shown.
> 
> What you can do is put a break or some debug message to see whether the code 
> goes into GuiWorkArea::Private::toggleCaret()

No, GuiWorkArea::toggleCaret() isn’t entered.

I cannot find GuiWorkArea::Private::toggleCaret() in master.

Stephan

Re: LyX-Workarea: Cursor invisible on Mac

2017-09-14 Thread Jean-Marc Lasgouttes

Le 14/09/2017 à 15:15, Stephan Witt a écrit :

Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :


Le 14/09/2017 à 13:16, Stephan Witt a écrit :

Hi JMarc,
with master I have two problems on Mac, ATM:
* The cursor is not visible in LyX’s buffer view (or doesn’t start blinking?)


You mean that you cannot make it appear? Even by clicking or such?


Yes, I’m able to select text. But by a click the selection disappears and no 
cursor is shown.


What you can do is put a break or some debug message to see whether the 
code goes into GuiWorkArea::Private::toggleCaret()


JMarc


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-14 Thread Jean-Marc Lasgouttes

Le 14/09/2017 à 14:31, Jean-Marc Lasgouttes a écrit :
Another bug I know of: when a insetgraphics is loaded (e.g. a toolbar 
icon of InsetInfo), the image is changed, but the metrics are not 
updated, which leads to a distorted graphics. Clicking on the workarea 
resolves the issue. I would appreciate hints about what triggers an 
update when the necessary pixmap is ready.


This one should be fixed now. However, thais may lead to other problem, 
although the new approach (getting rid of scheduleRedraw) is sound AFAICT.


JMarc


Re: LyX-Workarea: Cursor invisible on Mac

2017-09-14 Thread Stephan Witt
Am 14.09.2017 um 14:31 schrieb Jean-Marc Lasgouttes :
> 
> Le 14/09/2017 à 13:16, Stephan Witt a écrit :
>> Hi JMarc,
>> with master I have two problems on Mac, ATM:
>> * The cursor is not visible in LyX’s buffer view (or doesn’t start blinking?)
> 
> You mean that you cannot make it appear? Even by clicking or such?

Yes, I’m able to select text. But by a click the selection disappears and no 
cursor is shown.

>> * The LyX-Server doesn’t read data from pipe
>> I tried to verify the diff from 2.3.x to master but there’s nothing obvious.
>> Do you have an idea?
> 
> I am surprised that there may be a difference with 2.3.x. Are you sure that 
> the lyxserver works with 2.3.x? Can you give me a step by step recipe? I am 
> not used to the server.

Yes, I’ve tried it more then once. I was surprised too.

What I do:
1. Start the LyX application.
2. Verify the pipe presence manually:

$ ls ls -l /Users/stephan/Library/Application\ Support/LyX*/.lyxpipe.*
prw---  1 stephan  staff  0 14 Sep 13:11 /Users/stephan/Library/Application 
Support/LyX-2.4/.lyxpipe.in
prw---  1 stephan  staff  0 14 Sep 12:59 /Users/stephan/Library/Application 
Support/LyX-2.4/.lyxpipe.out

3. Open my test document ~/Documents/splash.lyx
4. Compile and view with Command-R
5. Search the .tex file

$ find /var/folders -name splash.tex -ls 2> /dev/null
912578828 -rw-r--r--1 stephan  staff3012 14 
Sep 12:59 
/var/folders/1x/zm63s22x7s591xrlgm4rl9v4gn/T/lyx_tmpdir.tYHtQWuF6822/lyx_tmpbuf0/splash.tex

6. Simulate the lyxeditor:
$ echo 
'LYXCMD:macdvix:server-goto-file-row:/var/folders/1x/zm63s22x7s591xrlgm4rl9v4gn/T/lyx_tmpdir.tYHtQWuF6822/lyx_tmpbuf0/splash.tex
 35' > "/Users/stephan/Library/Application Support/LyX-2.4/.lyxpipe.in"

The 2.3.x branch LyX jumps to and selects some text near the beginning and 
gives the answer in out-pipe
"INFO:macdvix:server-goto-file-row:“ (of course I’ve used the LyX-2.3 user dir 
to test that).

The master branch LyX doesn’t do anything and don’t give an answer.

Stephan

> Another bug I know of: when a insetgraphics is loaded (e.g. a toolbar icon of 
> InsetInfo), the image is changed, but the metrics are not updated, which 
> leads to a distorted graphics. Clicking on the workarea resolves the issue. I 
> would appreciate hints about what triggers an update when the necessary 
> pixmap is ready.
> 
> It would probably be a good idea to open tickets for all these problems.
> 
> JMarc



Re: LyX-Workarea: Cursor invisible on Mac

2017-09-14 Thread Jean-Marc Lasgouttes

Le 14/09/2017 à 13:16, Stephan Witt a écrit :

Hi JMarc,

with master I have two problems on Mac, ATM:

* The cursor is not visible in LyX’s buffer view (or doesn’t start blinking?)


You mean that you cannot make it appear? Even by clicking or such?


* The LyX-Server doesn’t read data from pipe

I tried to verify the diff from 2.3.x to master but there’s nothing obvious.
Do you have an idea?


I am surprised that there may be a difference with 2.3.x. Are you sure 
that the lyxserver works with 2.3.x? Can you give me a step by step 
recipe? I am not used to the server.


Another bug I know of: when a insetgraphics is loaded (e.g. a toolbar 
icon of InsetInfo), the image is changed, but the metrics are not 
updated, which leads to a distorted graphics. Clicking on the workarea 
resolves the issue. I would appreciate hints about what triggers an 
update when the necessary pixmap is ready.


It would probably be a good idea to open tickets for all these problems.

JMarc