Firefox plugin woes

The PackageKit browser plugin hasn’t had a lot of love recently. It was written in C++ a few months ago by Owen, but started to bitrot over the last few xulrunner releases.

I’ve spruced up the code, and ported everything to C (using GObject where possible) and now it all seems to work with one exception: invalidaterect doesn’t seem to work where I think it’s supposed to.

I’m setting up the plugin with some default content, which gets shown to the screen. I’m then doing a PackageKit query, and a few ms later I get the results. I then update some internal state, and call the invalidaterect for the whole drawing area, expecting a GraphicsExpose event to render the new content. But alas, invalidaterect seems to do nothing.

I’ve even tried adding a forceredraw call after invalidaterect, but that also gets ignored. If I manually resize the epiphany/firefox window then the GraphicsExpose event gets called, and the plugin then shows the correct state. This is a windowless plugin and nsplugginwrapper has been removed, and so I think I’m doing everything by the book, so to speak. Help welcomed, and anyone pointing out the bug will be rewarded with a beverage of your choice. Code is here. Thanks.