Le 9 sept. 2010 à 15:41, m0n0 a écrit : > > Hello to the list... > > I'm currently looking at the implementation of the plotters. One thing that > makes me curious is the fact that all the plotter functions are not chained > to any window. > > But how does NetSurf plotter calls distinguish between the different browser > windows? I mean, for example I'm opening page 1 in the first window, then I > open another Page 2 in another window. NetSurf will render them both at the > same time, but how do I know if the call to the plotter is for Window 1 oder > Window 2? > > Or... if NetSurf just renders one single window (the window on top),... how > would I tell netsurf which browser window is topped?
The core only handles a single window at a time (it's not reentrant). For the BeOS port I had to serialize the events to the main thread and let it draw from there, which is not the best way, and is one of the reason the drawing flickers a bit. Most ports including the BeOS one store the currently active graphic context (BView object for BeOS), and use it to draw each time. cf. nsbeos_current_gc() and friends. François.
