Le 2 novembre 2017 11:24:19 GMT+01:00, Pavel Sanda <sa...@lyx.org> a écrit : >Jean-Marc Lasgouttes wrote: >> Le 31 octobre 2017 13:36:47 GMT+01:00, Jean-Marc Lasgouttes ><lasgout...@lyx.org> a écrit : >> >Yes 2 is good for fixing the symptom, but it is very fragile... >> >> We could also try >> 4. Note when we have requested a repaint and exit early from >paintEvent() when we did not ask for this repaint. (Or even boldlier do >a full metrics+draw). > >like this? > >int process=0; //0 - not updating; 1 - just in update; >1 update >requested while in update >fun update(){ > //not a thread safe > if (process) {process++; return;} > process++; > > do_updates(); > > process--; > if (process) {process=0; assynchronously_trigger_new_update();} > >}
No it is not a recursion issue, but about knowing who asked for update. I would set a Boolean request_redraw in requestRedraw() and reset it to false after redraw is done. JMarc