> On 22 Oct 2017, at 23:11, Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote: > > Le 21 octobre 2017 14:56:36 GMT+02:00, Patrick De Visschere > <pdvissch...@edpnet.be> a écrit : >> Jean-Marc, >> >> This works because every update is turned into a FullScreenUpdate. >> Right? > > If I understand correctly, it turns every update related to an UpdateRequest > event (something internal to qt) into a full screen update (in the LyX > sense). But I think that these updates (those which create the black screen) > are not the norm. > You can check that by adding some debug information along with the new code > in my patch to see how often it triggers.
With the patch in place, SingleParUpdate in bufferView::draw is never reached. > > It would be interesting to set a break on QWindow::requestUpdate and see > whether to is something we do that triggers this effect. I did and it’s never triggered. >> Isn’t this a waste of work? >> >> Do you consider this as a permanent solution? > > Yes maybe, along with other improvement on our draw code. But I might not > understand exactly what is happening. > >> I’ve tried to solve the problem by using: viewport()->update(0,y,w,h) >> and thus specifying the proper coordinates. > > Which one? The following gives me the correct coordinates for a simple paragraph (for tables using top_pit looks better). void BufferView::rectToUpdate(int *y, int *w, int *h) { if(d->update_strategy_ == SingleParUpdate) { Text & buftext = buffer_.text(); pit_type const bottom_pit = d->cursor_.bottom().pit(); TextMetrics & tm = textMetrics(&buftext); *h = tm.parMetrics(bottom_pit).height(); *y = tm.parMetrics(bottom_pit).position() - tm.parMetrics(bottom_pit).ascent(); } else { *y = 0; *h = height_; } *w = width_; } > >> If I pass the coordinates of the paragraph, I notice that >> “SingleParUpdate" actually means “SingleRowUpdate". Since only the >> current paragraph is painted black now, except for the current row. > > Interesting. Does this mean that we could somehow disable completely these > black screen paintings ? Actually I need the coordinates of the current Row instead of those of the Paragraph, but sofar I couldn’t find this information. I’m afraid that the currrent Row of a paragraph is not cached somewhere. And this does not work yet when making a selection or moving the cursor around. It will only work if for every update we can pass via viewport()->update(x, y, w,h) the exact area to be painted later. If it’s too large it will be partially black and if too small updates will be missed. > > The whole situation is not clear to me as you can see. I’m still having problems with the basics. I thought there existed a document describing the basics of textMetrics, paragraphMetrics … . I found something on the wiki but not so much. > > JMarc >
smime.p7s
Description: S/MIME cryptographic signature