Hi Stephan, Stephan Assmus wrote: > Hi, > > I was trying to make BView::Invalidate() work. I'm giving up, because I > don't understand the code. If you spend some time on it, you will. Same happen to me when I came to work on app_server. :-) But I can understand you as the code is more complex now. > I have an idea what the problem is, but I > have no idea where to fix it. The triggering of update requests works > for moving windows arround. So I thought it must be simple to make > BView::Invalidate() work. It is simple. If it doesn't work, that's another problem... GetRootLayer()->GoRedraw(cl, reg) should've worked in this case. > However, there is no one central mechanism, > while it should be the same thing. There is a central mechanism: RootLayer::GoInvalidate() RootLayer::GoRedraw() from a tread != RootLayer's one RootLayer::invalidate_layer() RootLayer::redraw_layer() from inside RootLayer's thread. > Instead, there is horrible > commenting, bad naming of member variables and functions. A ton of > similar functions that seem to be ment for the same thing. Refactoring > is desperately needed. Yes, I agree. > A little commenting about the *structure* of the > code and the interacting parts would help too. When I'll have time I'll make a diagram about how region rebuilding and region invalidation works. You'll see that's it's pretty simple to grab by someone with your experience. [ The main idea is that all region rebuilding and canvas cleaning is done from one thread only: RootLayer's one. If you want to understand how that works start with RootLayer::invalidate_layer() and go down until you hit Painter :-) ] > Adi, if you find some time, it would be really nice if you could make > BView::Invalidate() work. I would do it, but I'm just clueless. OK, I will see what's wrong during this weekend. > Since this is an open source project, we all benefit from people > digging in and trying to help. So code should be written with that in > mind. We don't even have an alpha going, this is still early stage development, specifications are not complete and thus code is not that clear until a certain point in time when a cleaning is required. Clipping code still has some things left to be done, like BView origin support(not that big of a deal), dragging transparent surfaces, etc. I have started a big cleanup in window management code (RooLayer, WinBorder, Workspace, ServerWindow partially) and I'm almost finished, but I have not yet reached the clipping and update code. bye, Adi.