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.

2 responses to “Firefox plugin woes”

  1. otte

    NPP is a pointer already, so this diff should fix it:

    – g_signal_connect (install, “refresh”, G_CALLBACK (pk_main_refresh_cb), &instance);
    + g_signal_connect (install, “refresh”, G_CALLBACK (pk_main_refresh_cb), instance);

    plus an s/NPP*/NPP/ in the callback.

Bad Behavior has blocked 2769 access attempts in the last 7 days.