hust-marx / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

InvalidateWindow is not implemented correctly in PluginWindowMacCocoa and PluginWindowMacCarbon #150

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the latest 1.4 release InvalidateWindow() is implemented incorrectly.  The 
current implementation creates an NPRect relative to the page (or whatever the 
terminology is).  The correct behavior (or at least the behavior the browsers 
seem to follow) is for the rectangle to be relative to the top left corner of 
the plugin.

This is easily fixed by updating InvalidateWindow in PluginWindowMacCocoa and 
PluginWindowMacCarbon to:

void PluginWindowMac[Cocoa,Carbon]::InvalidateWindow() const {

    NPRect r = { 0, 0, m_height, m_width };
    if (!m_npHost->isMainThread()) {
        m_npHost->ScheduleOnMainThread(m_npHost, boost::bind(&Npapi::NpapiBrowserHost::InvalidateRect2, m_npHost, r));
    } else {
        m_npHost->InvalidateRect(&r);
    }
}

Original issue reported on code.google.com by physics...@gmail.com on 22 Feb 2011 at 9:48

GoogleCodeExporter commented 9 years ago
I will fix this; it is worth mentioning that all this code is replaced in 1.5.

Original comment by richarda...@gmail.com on 22 Feb 2011 at 4:32

GoogleCodeExporter commented 9 years ago
Fixed in 1.4

Original comment by taxilian on 23 Feb 2011 at 6:30

GoogleCodeExporter commented 9 years ago
Looks like the fix has width and height swapped.

Original comment by physics...@gmail.com on 25 Feb 2011 at 9:35

GoogleCodeExporter commented 9 years ago
serious? that's weird.  I'll look at it again today.  

Original comment by richarda...@gmail.com on 25 Feb 2011 at 3:28

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by amack...@gmail.com on 25 Feb 2011 at 3:44