There is some discussion on plugin-features to implement a plugin visibility notification to NPAPI. The cases are - Plug-in instance goes out of sight after page scrolling. - Plug-in instance comes in sight after page scrolling. - Plug-in instance goes out of sight after browser window goes background. - Plug-in instance comes in sight after browser window goes foreground. See thread about it at: https://mail.mozilla.org/pipermail/plugin-futures/2010-July/000123.html Wiki entry: https://wiki.mozilla.org/NPAPI:VisibilityNotification The bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=583109 This is probably interesting to all platforms but note that the public flash player does not support it and hence this task is Qt/Maemo5 specific for now.
The clipRect parameter of SetWindow is used different on Mac and Linux/Windows. On Mac, it is used to indicate the position of the plugin. When clipRect is set to 0, it means that it's not visible anymore. On Linux/Windows, clipRect indicates the clipping rect for the painting operation and is called before every paint(). In the plugin-features thread, Adobe person mentions that clipRect is used only on Mac (https://mail.mozilla.org/pipermail/plugin-futures/2010-July/000125.html). So, I guess Flash doesn't use this value. Currently, in Qt/WebKit, clipRect is always set to 0 on X11 in Windowless mode. In Windowed mode, we call it with the visibile rect but with a quirk (PluginQuirkDontCallSetWindowMoreThanOnce) wherein the height/width is never changed in the lifetime of the plugin.
Created attachment 65453 [details] Set clipRect correctly on X11
Comment on attachment 65453 [details] Set clipRect correctly on X11 WebCore/plugins/qt/PluginViewQt.cpp:588 + // position and clipRect is relative to the Drawable comments start with capital and ends with . Why is Drawable with a capital d? The comments could be a bit more explanatory.
Created attachment 65545 [details] Set clipRect correctly on X11 Ok, I have a better patch now that also takes care of setting the clip rect to 0 when the plugin is scrolled out in both windowed and windowless mode.
Attachment 65545 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/plugins/qt/PluginViewQt.cpp:588: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 65546 [details] Set clipRect correctly on X11 Fix codings style
Landed in r66095
http://trac.webkit.org/changeset/66095 might have broken Qt Linux Release
Committed r66097: <http://trac.webkit.org/changeset/66097>
Committed r66095: <http://trac.webkit.org/changeset/66095>
Revision r66095 cherry-picked into qtwebkit-2.1 with commit 4a3c8a09303316623216e38f5dea9e0b3f215a26 Revision r66097 cherry-picked into qtwebkit-2.1 with commit fb2dbc367407000b4a1e7d741e740d8b1417946d