summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/cross
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-17 21:42:54 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-17 21:42:54 +0000
commit9149cdc6f2acf0db263281ce2d4bb40112847582 (patch)
treef2749b3565b65aad5ed076201a3eacdbc496f95e /o3d/plugin/cross
parent0cbacf170644b4efce6c98b6637bba942b9110a5 (diff)
downloadchromium_src-9149cdc6f2acf0db263281ce2d4bb40112847582.zip
chromium_src-9149cdc6f2acf0db263281ce2d4bb40112847582.tar.gz
chromium_src-9149cdc6f2acf0db263281ce2d4bb40112847582.tar.bz2
Rewrote full-screen support on Windows. O3D now always creates its own
window in which to render, rather than rendering into either the browser's window or a separate full-screen window. The O3D window is removed from the browser's hierarchy and made top-level in order to go to full-screen mode via Direct3D. This solves fundamental focus fighting problems seen on Windows Vista. This change allowed the event forwarding code in the plugin's window message loop to be deleted, but a new workaround for a flicker upon the first mouse click in O3D in Firefox was required. Split the Renderer's fullscreen API into GoFullscreen and CancelFullscreen to solve chicken-and-egg problems with coming out of full-screen mode. Changed how the plugin detects resize events. Rather than responding to WM_SIZE messages, NPP_SetWindow is now responsible for propagating resize events to the client. Changed the ActiveX host control to call NPP_SetWindow in response to SetObjectRects. Fixed RendererGL::IsCurrent() on non-Mac platforms. Removed the bogus current_renderer_ static variable. Tested the following scenarios in IE and Firefox on Windows: - Full-screen involving display mode change, Escape to exit. - Full-screen involving display mode change, Alt-Tab to exit. - Full-screen involving display mode change, Alt-F4 to exit. - Full-screen involving display mode change, timeout to exit. - Full-screen with no display mode change, Escape to exit. - Full-screen with no display mode change, Alt-Tab to exit. - Full-screen with no display mode change, Alt-F4 to exit. - Full-screen with no display mode change, timeout to exit. - Beach demo, particle demo, other tests. Tested the following scenarios on the Mac in Safari (for which the code path didn't change): - Full-screen, escape to exit. - Full-screen, Alt-Tab to exit. - Full-screen, timeout to exit. When http://crbug.com/21921 is fixed, full-screen mode will work on Windows Vista with Aero on in Chrome. Review URL: http://codereview.chromium.org/210005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/cross')
-rw-r--r--o3d/plugin/cross/o3d_glue.cc6
-rw-r--r--o3d/plugin/cross/o3d_glue.h32
2 files changed, 11 insertions, 27 deletions
diff --git a/o3d/plugin/cross/o3d_glue.cc b/o3d/plugin/cross/o3d_glue.cc
index 9053255..5911285 100644
--- a/o3d/plugin/cross/o3d_glue.cc
+++ b/o3d/plugin/cross/o3d_glue.cc
@@ -110,10 +110,8 @@ PluginObject::PluginObject(NPP npp)
pending_ticks_(0),
#ifdef OS_WIN
hWnd_(NULL),
- fullscreen_hWnd_(NULL),
- parent_hWnd_(NULL),
plugin_hWnd_(NULL),
- default_plugin_window_proc_(NULL),
+ content_hWnd_(NULL),
got_dblclick_(false),
painted_once_(false),
#endif
@@ -743,11 +741,11 @@ void PluginObject::StorePluginProperty(HWND hWnd, PluginObject *obj) {
if (obj->GetHWnd()) { // Clear out the record from the old window first.
ClearPluginProperty(obj->GetHWnd());
}
+ obj->SetHWnd(hWnd);
StorePluginPropertyUnsafe(hWnd, obj);
}
void PluginObject::StorePluginPropertyUnsafe(HWND hWnd, PluginObject *obj) {
- obj->SetHWnd(hWnd);
if (hWnd) {
SetProp(hWnd, kWindowPropertyName, static_cast<HANDLE>(obj));
::DragAcceptFiles(hWnd, true);
diff --git a/o3d/plugin/cross/o3d_glue.h b/o3d/plugin/cross/o3d_glue.h
index 6143db2..12fb572 100644
--- a/o3d/plugin/cross/o3d_glue.h
+++ b/o3d/plugin/cross/o3d_glue.h
@@ -158,36 +158,24 @@ class PluginObject: public NPObject {
public:
#ifdef OS_WIN
- void SetDefaultPluginWindowProc(WNDPROC proc) {
- default_plugin_window_proc_ = proc;
- }
- WNDPROC GetDefaultPluginWindowProc() {
- return default_plugin_window_proc_;
- }
void SetHWnd(HWND hWnd) {
hWnd_ = hWnd;
}
HWND GetHWnd() {
return hWnd_;
}
- void SetFullscreenHWnd(HWND hWnd) {
- fullscreen_hWnd_ = hWnd;
- }
- HWND GetFullscreenHWnd() {
- return fullscreen_hWnd_;
- }
- void SetParentHWnd(HWND hWnd) {
- parent_hWnd_ = hWnd;
- }
- HWND GetParentHWnd() {
- return parent_hWnd_;
- }
void SetPluginHWnd(HWND hWnd) {
plugin_hWnd_ = hWnd;
}
HWND GetPluginHWnd() {
return plugin_hWnd_;
}
+ void SetContentHWnd(HWND hWnd) {
+ content_hWnd_ = hWnd;
+ }
+ HWND GetContentHWnd() {
+ return content_hWnd_;
+ }
bool RecordPaint() {
bool painted = painted_once_;
painted_once_ = true;
@@ -431,13 +419,11 @@ class PluginObject: public NPObject {
int fullscreen_region_height_;
int fullscreen_region_mode_id_;
#ifdef OS_WIN
- HWND hWnd_; // The window we are currenlty drawing to (use this)
- HWND fullscreen_hWnd_; // The fullscreen window if we are fullscreen
- HWND parent_hWnd_;
- HWND plugin_hWnd_; // The window we were given inside the browser.
+ HWND hWnd_; // The window we are currently drawing to (use this).
+ HWND plugin_hWnd_; // The window we were given inside the browser.
+ HWND content_hWnd_; // The window containing the D3D or OpenGL content.
HCURSOR cursors_[o3d::Cursor::NUM_CURSORS]; // loaded windows cursors.
HCURSOR hCursor_;
- WNDPROC default_plugin_window_proc_;
bool painted_once_;
#endif // OS_WIN
};